1. Yuri Denshchik
  2. PowerBuilder
  3. Friday, 15 September 2017

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

Luiz Ribeiro Accepted Answer Pending Moderation
0
Votes
Undo

Hi Yuri.
I guess this is not possible because the SELECTBLOB/UPDATEBLOB statements is not SQL, but a Powerscript construct.
Regards,
Luiz

Comment
There are no comments made yet.
  1. Monday, 18 September 2017
  2. PowerBuilder
  3. # 1
Chris Pollach Accepted Answer Pending Moderation
0
Votes
Undo

HI Yuri;

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

 

Blob   lblb_data

String  ls_SQL = "SELECTBLOB   INTO   :lblb_data   FROM    

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

EXECUTE Immediate   :ls_sql  Using   ;

 

HTH

Regards ... Chris

 

 

Comment
Does not work, 



ORA-00900: invalid SQL statement

  1. Yuri Denshchik
  2. Friday, 15 September 2017
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;

  1. Yuri Denshchik
  2. Friday, 15 September 2017
There are no comments made yet.
  1. Friday, 15 September 2017
  2. PowerBuilder
  3. # 2
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.