Dynamically retrieve data from Blob column

1
0
-1

Is there a solution to retrieve blob dynamically. The table and column name is known only at runtime. 

It appears that datawindow has blobtable column that actually retrieves blob data, but there is no method to assign it to Blob variable.

The blob data I need to get is a binary data, not image.

Thanks,

Yuri

Question Tags: 

Answers

Chris Pollach answered Dynamically retrieve data from Blob column

1
0
-1

HI Yuri;

  I have not used this approach personally, but I would recommend trying the following ....

 

Blob   lblb_data

String  ls_SQL = "SELECTBLOB <col>  INTO   :lblb_data   FROM  <TableName>   <where>

// Parse in Column, Table, and Where (optional) information into ls_SQL

EXECUTE Immediate   :ls_sql  Using   <YourTrans> ;

 

HTH

Regards ... Chris

 

 

Yuri Denshchik's picture

Does not work, 

ORA-00900: invalid SQL statement

Yuri Denshchik's picture

I think I found the way to do it.

string ls_sql
blob lbl

ls_sql = "SELECT BLOB_COLUMN FROM TBL WHERE ..."
DECLARE my_cursor DYNAMIC CURSOR FOR SQLSA;
PREPARE SQLSA FROM :ls_sql;
OPEN DYNAMIC my_cursor;
FETCH my_cursor INTO :lbl;
CLOSE my_cursor;