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

Luiz Ribeiro Accepted Answer Pending Moderation
  1. Monday, 18 September 2017 18:04 PM UTC
  2. PowerBuilder
  3. # 1

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.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Friday, 15 September 2017 16:31 PM UTC
  2. PowerBuilder
  3. # 2

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
  1. Ramón San Félix Ramón
  2. Tuesday, 15 October 2024 06:45 AM UTC


That's how it works for me.

Has anyone managed to make an updateblob with dynamic SQL?
  1. Helpful
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.
We use cookies which are necessary for the proper functioning of our websites. We also use cookies to analyze our traffic, improve your experience and provide social media features. If you continue to use this site, you consent to our use of cookies.