Subject | Re: [IBO] Assigning text to a binary blob field |
---|---|
Author | Helen Borrie |
Post date | 2006-12-20T06:30:06Z |
At 11:33 AM 20/12/2006, you wrote:
user data. User-defined subtypes should have negative numbers.
your IB_ColumnBlob to IB_ColumnMemo.
blobs. Assign the default property of the tmpStrList (its Strings
object) directly and you're done:
FIB_Insert.TIB_ColumnMemo(ParamByName('pUNMAPPED_DATA')).Assign(tmpStrList);
As a general tip, stay clear of the Text (and CommaText, etc.)
property of stringlists around SQL.
Helen
>Hi,Blob sub_type 2 is a system subtype. It should NEVER be applied to
>
>I inherited a database where they created a blob field as type 2.
user data. User-defined subtypes should have negative numbers.
>IYou can't typecast blobs in SQL. However, you could try subtyping
>have to live with it for the moment. I need to store an XML schema in
>the field. I am also doing this all in code, so do let me know if I
>need to type cast the the blob field
your IB_ColumnBlob to IB_ColumnMemo.
>I am using a TIB_Query. Here is the stub of the code.Almost. However, you don't use Assign to assign strings to
>
> FIB_Insert.SQL.Clear;
>
> FIB_Insert.SQL.Add('INSERT INTO VAC_EXTERNAL_JOB_BOARD ( REF_ID,
>JNUM, UNMAPPED_DATA, POSTED ) VALUES ( ');
> FIB_Insert.SQL.Add('1, :pJNUM, :pUNMAPPED_DATA, 0 ) ');
>
> FIB_Insert.Prepare;
> FIB_Insert.ParamByName('pJNUM').AsInteger := FVacTrackInfoRcrd.JNUM;
> FIB_Insert.ParamByName('pUNMAPPED_DATA').Assign(tmpStrList.Text);
>
> FIB_Insert.Execute;
>
>
>I guess what I would like to do is Create a TStringList object, layout
>the XML text, and use the assign method to save the text into the binary
>blob. Will that work?
blobs. Assign the default property of the tmpStrList (its Strings
object) directly and you're done:
FIB_Insert.TIB_ColumnMemo(ParamByName('pUNMAPPED_DATA')).Assign(tmpStrList);
As a general tip, stay clear of the Text (and CommaText, etc.)
property of stringlists around SQL.
Helen