Automatically: No Filereadex Updateblob
Automatically: No Filereadex Updateblob
Automatically: No Filereadex Updateblob
Q1: is there any way to store image already in Hard disk to BLOB field in table (automatically)
A1: NO (not automatically). However, you could use the FileReadEx ( ) method
and UpdateBlob PowerBuilder command to accomplish this in PowerScript code.
Q2: can i do vice versa of the previous point??
A2: Yes, by using the SelectBlob and FileWriteEx ( ) PowerBuilder commands to accomplish this in
PowerScript code.
HTH
Regards ... Chris
A1
No (not automatically). However I could use ..........
could i make script that for each row in table that i store the path (loop) ...
blob pdf_blob
for i = 1 to rowcount()
ls_path = dw_1.object.pdf_path[i]
li_fnum = FileOpen(ls_path , StreamMode!)
ll_bytes = FileReadEx(li_fnum, pdf_blob)
updateblob table1 set ole_image = :pdf_blob
WHERE ..........
next
thus it can be done automatically - or there are some thing wrong?
Q3
If i use data pipeline to copy table that contain Blob to other table(either in the same DB or in
different DB)
is Blob column will be in the new table with data or with no data (images)
Q4
if for now i use column as Blob and enter data on it(images)
later can i modify it to be Blob with filestreaming without need to modify any code in app
Regards
try to create a picture object and put the image inside this, like example:
maybe this can help you, first you might have to create a temp file from
the blob.
This script is not mine, just can't remeber whre I got it, (probably here)
//start Script
//Obtain Image from DB to be used later
//ll_max = dw_wallpapers.GetItemNumber(dw_wallpapers.RowCount(), 2)
// SelectBlob imagen
// into :lblob_imagen
// from imagenes
// Where imagen_ind = :ll_max;
//
// If SQLCA.SQLCode <> 0 then
// messagebox("","Error al recuperar la imagen")
// return
// End if
//
// FileDelete(is_tempfilename + ls_extension)
//
// ll_aux = FileOpen(is_tempfilename + ls_extension, StreamMode!,
Write!, LockWrite!, Replace!)
//
// if ll_aux < 1 then
// messagebox("","Error al crear archivo temporal")
// return
// End if
//
// if FileWriteEx(ll_aux, lblob_imagen) = -1 then
// messagebox("","Error al escribir el archivo")
// return
// End if
//
// FileClose(ll_aux)
//
// p_preview.PictureName = is_tempfilename + ls_extension // You can sub
this line to fit your needs in you app...
//End Script
A N escribi�:
> I have a table of students
>
> Students
>(
> studentid number(10) not null <pk>,
> studentname varchar2(50) not null,
> ...,
> studentpic blob not null //Stores jpeg/bmp images of students
>)
>
> My requirement is to show all columns including picture in a datawindow so
> that it has picture, studentid, studentname. How do I achieve this?
>
Happy Coding!
(2).-----------------------------------------------------------
ll_BLen = Len(ablb_Data)