[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2428
  • Last Modified:

Saving images on powerbuilder 10

Dear Experts.
I need to save and retrieve images from the database to an aplication. I was able to do it with a datawindow and the OleDatabaseBlob. But i am only able to save images from the datawindow (run preview.... insert row..... double click on the ole blob.... it opens (paint) .... paste from.... and updte image ) then the images are shown in the datawindow. But how can i do the same from a script? Also i try with the SelectBlob and i get a error : not a JPEG file....
Can you help me please ? where can i read about OLE to understand what i am doing?
Thank you very much.
0
joaquiniglesias
Asked:
joaquiniglesias
1 Solution
 
diasroshanCommented:
Hi,

selectblob is what u need to use,
u can check the help for 'SelectBlob' and 'UpdateBlob'

'SelectBlob' PB Help Example...
Blob  Emp_id_pic

SELECTBLOB Emp_pic

        INTO  :Emp_id_pic

        FROM Employee

        WHERE Employee.Emp_Num = 100

        USING Emp_tran ;

p_1.SetPicture(Emp_id_pic)


'UpdateBlob' PB Help Example...
int   fh

blob  Emp_id_pic

fh = FileOpen("c:\emp_100.bmp", StreamMode!)

IF fh <> -1 THEN

        FileRead(fh, emp_id_pic)

        FileClose(fh)

        UPDATEBLOB Employee SET emp_pic = :Emp_id_pic

        WHERE Emp_num = 100

        USING Emp_tran ;

END IF

IF Emptran.SQLNRows > 0 THEN

        COMMIT USING Emp_tran ;

END IF


please post here the exact error u get with using SelectBlob...

Cheers,
Rosh
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now