Subject | RE: [ib-support] Using Blobs and Delphi |
---|---|
Author | Theo Bebekis |
Post date | 2001-06-12T09:13:40Z |
Jason
I'm passing the content as
IBStoredProc1.StoredProcName := 'SP_ADD_DATA';
IBStoredProc1.Prepare;
IBStoredProc1.ParamByName('ID').AsInteger := M.Age;
IBStoredProc1.ParamByName('DATA').LoadFromStream(MS, ftBlob);
CREATE PROCEDURE sp_ADD_DATA(ID INTEGER, DATA BLOB) AS
BEGIN
INSERT INTO BLOBTEST VALUES (:ID, :DATA);
END ^
Is there any danger in the above?
Is the following case, using a IBQuery, safer?
IBQuery1.SQL.Add('INSERT INTO BLOBTEST VALUES (:ID, :DATA)');
IBQuery1.Prepare;
IBQuery1.ParamByName('ID').AsInteger := M.Age;
IBQuery1.ParamByName('DATA').LoadFromStream(MS, ftBlob);
IBQuery1.ExecSQL;
Regards
Theo
-----------------------------------
Theo Bebekis
Thessaloniki, Greece
bebekis@...
-----------------------------------
> Care must be taken when dealing with BLOB columns as input parameters. Arenew
> you passing what will end up as the contents of the BLOB or the ID of the
> BLOB. In IBO, if you are using input parameters and BLOB's it will get a
I'm passing the content as
IBStoredProc1.StoredProcName := 'SP_ADD_DATA';
IBStoredProc1.Prepare;
IBStoredProc1.ParamByName('ID').AsInteger := M.Age;
IBStoredProc1.ParamByName('DATA').LoadFromStream(MS, ftBlob);
CREATE PROCEDURE sp_ADD_DATA(ID INTEGER, DATA BLOB) AS
BEGIN
INSERT INTO BLOBTEST VALUES (:ID, :DATA);
END ^
Is there any danger in the above?
Is the following case, using a IBQuery, safer?
IBQuery1.SQL.Add('INSERT INTO BLOBTEST VALUES (:ID, :DATA)');
IBQuery1.Prepare;
IBQuery1.ParamByName('ID').AsInteger := M.Age;
IBQuery1.ParamByName('DATA').LoadFromStream(MS, ftBlob);
IBQuery1.ExecSQL;
Regards
Theo
-----------------------------------
Theo Bebekis
Thessaloniki, Greece
bebekis@...
-----------------------------------
>