The old storry: BLOBs

Andi

Member
Hello,

I want to execute the following sql-command:
'UPDATE BinDataTable SET MyBinData = :pBinData'
MyBinData is a BLOB-Field.
Can I set the value of pBinData without a TLOBLocator?? Any possibility?

Thanks

[This message has been edited by Andi (edited 19 August 2003).]
 
No. You need a TLOBLocator for this:

update BinDataTable
set MyBinData = empty_blob()
returning MyBinData into :pBinData

After executing this you can write the BLOB data through a TLOBLocator that was associated with the :pBinData variable through SetComplexVariable.

In the upcoming 4.0 release you can also use a Temporary BLOB and write the data before the update:

update BinDataTable
set MyBinData = :pBinData

You still need a TLOBLocator though.

------------------
Marco Kalter
Allround Automations
 
> In the upcoming 4.0 release you
> can also use a Temporary BLOB and
> write the data before the update:

Thats great! Thank you!
 
Therefore the 3.4.6 documentation (.DOC format) that uses a SELECT ... FOR UPDATE statement is wrong? I get an "TLOBLocator invalid handle" using the SELECT FOR UPDATE, while the UPDATE syntax in this topic works.

------------------
LDS
 
The "select for update" example should be correct. It returns an initialized and updatable LOB Locator, which you can subsequently use to write data to.

------------------
Marco Kalter
Allround Automations
 
Back
Top