1. Yuri Denshchik
  2. PowerBuilder
  3. Friday, 15 September 2017 16:10 PM UTC

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

Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Friday, 15 September 2017 16:31 PM UTC
  2. PowerBuilder
  3. # 1

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
  1. Yuri Denshchik
  2. Friday, 15 September 2017 18:13 PM UTC
Does not work, 



ORA-00900: invalid SQL statement

  1. Helpful
  1. Yuri Denshchik
  2. Friday, 15 September 2017 18:43 PM UTC
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. Helpful 1
There are no comments made yet.
Luiz Ribeiro Accepted Answer Pending Moderation
  1. Monday, 18 September 2017 18:04 PM UTC
  2. PowerBuilder
  3. # 2

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.
  • Page :
  • 1


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