01-20-10, 08:40 #1Registered User
- Join Date
- Jan 2010
Unanswered: how do retrive lob locator from procedure/function
Can i write a procedure to get lob locator of a lob column?
create table t1(i clob)@
insert into t1 values('sample')@
Now i want to get lob locator for this tuple.
The following procedure will return the value "sample".
Can i modify the OUT parameter to type to something else to return lob locator instead of actual lob value?
CREATE procedure sample_function(
OUT lob clob
READS SQL DATA
SELECT i INTO lob FROM t1;
I guess there is a way to get lob locator using EMBEDDED SQL by doing something like this.
SQL TYPE IS CLOB_LOCATOR lob;
select i into lob from t1 ;
return lob; ---syntax may be wrong, but i mean to say i am able to search in the net and finding ways through EMBEDDED SQL.
Can i do it using function/procedure?
Thanks in advance for the help.
01-21-10, 13:08 #2Registered User
- Join Date
- Jan 2007
- Jena, Germany
A LOB locator is used when transferring a LOB out of DB2 (or into it). So you can use a locator in your application to access the OUT parameter of the procedure. You don't have to change anything in the procedure for that.
Basically, you can completely ignore the concept of locators as long as you are working with LANGUAGE SQL stored procedures only.Knut Stolze
IBM DB2 Analytics Accelerator
IBM Germany Research & Development