FTP | CCD | Buscar | Trucos | Trabajo | Foros |
|
Registrarse | FAQ | Miembros | Calendario | Guía de estilo | Temas de Hoy |
|
Herramientas | Buscar en Tema | Desplegado |
#1
|
|||
|
|||
ERROR lob locators cannot span transactions
Hola a todos tengo este codigo en delphi 6
procedure TForm1.Button1Click(Sender: TObject); var cont:integer; begin query1.Close; IF OpenPictureDialog1.Execute THEN begin IF NOT QUERY1.Active THEN QUERY1.Open; if QUERY1.State in [dsBrowse] then begin QUERY1.Insert; QUERY3.Close; QUERY3.sql.Clear; QUERY3.SQL.Add('SELECT COUNT(*) CONT FROM IMAGENES'); QUERY3.OPEN; cont:=QUERY3.FieldByName('CONT').AsInteger; QUERY1NOIMAGEN.AsInteger :=cont+1; QUERY1IMAGEN.LoadFromFile(OpenPictureDialog1.FileName); QUERY1NUMPARTE.AsString:='Prueba'+IntToStr(cont+1); QUERY1.Post; QUERY1.ApplyUpdates; end; end ELSE SHOWMESSAGE('Se Cancelo Carga de Archivo'); end; lo que hace es insertar una imagen a una tabla llamada imagenes en un campo blob de oracle 8i y me marca este error lob locators cannot span transactions lo que hice fue procedure TForm1.Button1Click(Sender: TObject); var cont:integer; begin query1.Close; IF OpenPictureDialog1.Execute THEN begin IF NOT QUERY1.Active THEN QUERY1.Open; if QUERY1.State in [dsBrowse] then begin Database1.StartTransaction; QUERY1.Insert; QUERY3.Close; QUERY3.sql.Clear; QUERY3.SQL.Add('SELECT COUNT(*) CONT FROM IMAGENES'); QUERY3.OPEN; cont:=QUERY3.FieldByName('CONT').AsInteger; QUERY1NOIMAGEN.AsInteger :=cont+1; QUERY1IMAGEN.LoadFromFile(OpenPictureDialog1.FileName); QUERY1NUMPARTE.AsString:='Prueba'+IntToStr(cont+1); QUERY1.Post; QUERY1.ApplyUpdates; Database1.Commit; end; end ELSE SHOWMESSAGE('Se Cancelo Carga de Archivo'); end; agregarle que empesara una transaccion y que le diera commit y ya no marca el error pero solo puedo insertar 1 registro y los demas se insertan pero sin la imagen que estoy seleccionando, alguien tiene alguna idea de como hacerlo? |
|
|
Temas Similares | ||||
Tema | Autor | Foro | Respuestas | Último mensaje |
Hacer Transactions con ADO+MyODBC ? | tcp_ip_es | MySQL | 1 | 19-12-2007 09:42:55 |
dbexpress ADO Transactions | JOTAAB | Conexión con bases de datos | 0 | 28-04-2006 17:37:30 |
Transactions Firebird | Abel Garcia | Firebird e Interbase | 2 | 31-01-2006 21:46:57 |
wait transactions con DBE | Ivanzinho | Firebird e Interbase | 3 | 15-10-2005 16:03:52 |
|