Insert into memo fails

Discussion of open issues, suggestions and bugs regarding IBDAC (InterBase Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
BlueMoon
Posts: 12
Joined: Tue 30 Mar 2010 17:22

Insert into memo fails

Post by BlueMoon » Thu 23 Sep 2010 10:28

Hi,

I habe a Firebird table with an integer field (myid) and an blob field (BLOB SUB_TYPE 1 SEGMENT SIZE 80 NOT NULL). In my delphi application I use a TIBCQuery with the following code:

Code: Select all

Query.Close;
Query.SQL.Text := 'insert into mytable (myid, mytxtfield) values (:myid, :mytxtfield)';
Query.ParamByName('myid').AsInteger := 7;
Query.ParamByName('mytxtfield').AsString := 'Test';
Query.ExecQuery;
This gives me this exception:

Code: Select all

EIBCError
Dynamic SQL Error
SQL error code = -303
feature is not supported
BLOB and array data types are not supported for move operation
This is set:
IBConnection.Options.EnableMemos := true;

How to solve this? Thank you!

AndreyZ

Post by AndreyZ » Thu 23 Sep 2010 12:03

Hello,

You should use the following code:

Code: Select all

Query.ParamByName('mytxtfield').DataType := ftBlob;
Query.ParamByName('mytxtfield').AsString := 'Test';
or this code:

Code: Select all

Query.ParamByName('mytxtfield').AsMemo := 'Test';

Post Reply