1. Gzim Ramizi
  2. PowerBuilder
  3. Wednesday, 29 August 2018 10:12 AM UTC

Dear all

I use the large binary database blob object in a datawindow to show pictures for each row, which works very well.

Now, it is required to allow an upload/replace for earch row and I ask myself, if there is a "simple" PowerBuilder-way how to do it, without using the awkward way (FileOpen, FileRead, FileClose, insert into, Re-Retrieve the DataWindow)?

I couldn't find an example with database blob object. There are just some examples with picture control (and selectblob).

Could someone give me a recommandation?

 

TIA

 

p.s.: I haven't followed the pb community for over 10 years. I even couldn't find the old news-groups anymore :(

Accepted Answer
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Wednesday, 29 August 2018 12:03 PM UTC
  2. PowerBuilder
  3. # Permalink

Hi Gizm;

   The process & commands you describe are still the way to do Blob processing in PB2017/2018.

   I have also been able to use various DB utlities as well to load/update Blob data as an alternative.

HTH

Regards ... Chris

Comment
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Wednesday, 29 August 2018 20:43 PM UTC
  2. PowerBuilder
  3. # 1

Hi Shenn;

   Yes, I had forgotten about that. Thanks for jogging my memory! I think that that feature was added in the PB 11.5.x timeframe. Needed more coffee before answering this one. Duh!

Regards ... Chris

Comment
  1. Chris Pollach @Appeon
  2. Thursday, 30 August 2018 12:55 PM UTC
BTW: what I was discussing with Sybase was the ability to pipe blob data to flat files and vise versa, pipe flat files into blob columns. That enhancement is what never developed.
  1. Helpful
There are no comments made yet.
Shenn Sellers Accepted Answer Pending Moderation
  1. Wednesday, 29 August 2018 16:17 PM UTC
  2. PowerBuilder
  3. # 2

Regarding PipeLine Objects and Blobs...

 

 

Attachments (3)
Comment
There are no comments made yet.
Gzim Ramizi Accepted Answer Pending Moderation
  1. Wednesday, 29 August 2018 12:18 PM UTC
  2. PowerBuilder
  3. # 3

Thx Chris. Nice to see you've still been faithful to powerbuilder :-)

Comment
  1. Chris Pollach @Appeon
  2. Wednesday, 29 August 2018 12:42 PM UTC
Thanks ... Nice to see you back in the PB forum! Long time no hear.
  1. Helpful
There are no comments made yet.
Gzim Ramizi Accepted Answer Pending Moderation
  1. Wednesday, 29 August 2018 12:06 PM UTC
  2. PowerBuilder
  3. # 4

The idea is to insert/replace the image in a blob column (database). Yes, you are right, the FileOpen, FileRead is ok, but I would like to have/do smth like

long ll_bytes

integer li_filenum

blob lbl_blob

 

li_filenum = FileOpen(...)

ll_bytes = FileReadEx(li_filenum, lbl_blob)

 

dw_control.object.datawindow.blob_column[row] = lbl_blob;

Or

dw_control.SetItemBlob(Row, "blob_column", blob)

 

Currently, I use embedded statements with "updateblob" and "insert". Then I do a re-retrieve of the dw_control just to show up the image (but this makes the whole update/save mechanism quite ugly).

 

 

Regards

Comment
  1. Shenn Sellers
  2. Wednesday, 29 August 2018 16:14 PM UTC
The PipeLine object has been able to handle Blobs for quite some time. See my response below as I can't add images to this comment.
  1. Helpful
  1. Gzim Ramizi
  2. Thursday, 30 August 2018 07:38 AM UTC
@Chris Polach: where is the place to open such a ticket?
  1. Helpful
  1. Chris Pollach @Appeon
  2. Thursday, 30 August 2018 12:57 PM UTC
  1. Helpful
There are no comments made yet.
Kevin Ridley Accepted Answer Pending Moderation
  1. Wednesday, 29 August 2018 11:20 AM UTC
  2. PowerBuilder
  3. # 5

Are you planning to select an image file to replace it off the file system?  As far as I know there's no simple way to do it without the standard FileOpen, FilereadEx, then UpdateBlob.  Unless you already have the blob in another picture control or something, you still need to fill the blob you are going to put in the db.

 

KR

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.
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.