Problem inserting blob field into another blob field using two ibsql
Hi Jeff.
I need pass one blob to a ibsql param from ibsql field, and inserting in
one table. I try following code, first with tblobstream and
later with tstream, but don't work. Any idea?
procedure TForm1.Button1Click(Sender: TObject);
var
Stream1 : TBlobStream; stream :tmemorystream;
begin
stream.create;
IBSQL1.ExecQuery; //select field imagen from one table
IBSQL1.fieldbyname('imagen').SaveToStream(stream); -> error here too
//Stream1 := TBlobStream.Create(IBSQL1.fieldbyname('imagen'),bmRead);->
error here
IBSQL2.ParamByName('IMAGEN').LoadFromStream(stream);
IBSQl2.ParamByName('entero').Asinteger:=141234;
IBSQl2.ParamByName('pk').asinteger:=93834;
try
IBSQL2.ExecQuery;
finally
Stream1.Free;
stream.free;
end;
end;
select sentence for ibsql1 are 'select imagen from datos where pk=1'
where imagen is a blob field. and
select sentence for ibsql2 are
'Insert into DATOS
(IMAGEN,PK)
Values
(:IMAGEN,:PK)'
Thanks in advance
--
Felipe Molina
CRELIPA S.L.
C/Claudio Coello 31
San Lorenzo del Escorial
28200-Madrid