====================================================================
Function untuk membaca file blob
====================================================================
function of_fileread (string as_filename, ref blob ablb_data) return integer

integer        li_FileNo, li_Reads, li_Cnt
long        ll_FileLen
blob        lblb_Data

ll_FileLen = FileLength(as_FileName)

li_FileNo = FileOpen(as_FileName, StreamMode!, Read!)
If li_FileNo < 0 Then Return -1

// Determine the number of reads required to read the entire file
If ll_FileLen > 32765 Then
    If Mod(ll_FileLen, 32765) = 0 Then
        li_Reads = ll_FileLen / 32765
    Else
        li_Reads = (ll_FileLen / 32765) + 1
    End if
Else
    li_Reads = 1
End if

// Empty the blob argument
ablb_Data = lblb_Data

// Read the file and build the blob with data from the file
For li_Cnt = 1 to li_Reads
    If FileRead(li_FileNo, lblb_Data) = -1 Then
        Return -1
    Else
        ablb_Data = ablb_Data + lblb_Data
    End if
Next

FileClose(li_FileNo)

Return ll_FileLen

====================================================================
Cara Menampilkan
====================================================================
blob            imagedata
string            ls_filename


//The DataWindow determines the image type based on the
//filename extension
ls_filename = 'imagedata.jpg'

SELECTBLOB IMAGEDATA
INTO :imagedata
FROM IMAGE_DEMO
using sqlca;
 
of_filewrite ( ls_filename, imagedata )

dw_1.object.p_1.FileName = ls_filename

SELAMAT MENCOBA

Putu

Wadi Achmed wrote:

Tampungnya ke variable blob juga mas.
Misal:
Select blobcolumn
into :lbl_blobvariable
from tabel_blob
using transaction;

selanjutnya si lbl_blobvariable yang dimainkan. Dengan loop sampai puas.

Cheers,
Wadi

eko prayoga wrote:
> Dear all,
> langsung aja mau tanya. Gmn cara selectblob yg size nya lebih dr 32765 bytes.
>
> Regards,
> eko prayoga.
>
> ------------------------------------
>
> -----------------------------------------------
> IndoPB - Indonesia PB User Group
> http://groups.yahoo.com/group/indopbYahoo! Groups Links
>
>
>
>
>


No virus found in this incoming message. Checked by AVG - http://www.avg.com Version: 8.0.176 / Virus Database: 270.9.18/1848 - Release Date: 12/14/2008 12:28 PM

  

__._,_.___

-----------------------------------------------
IndoPB - Indonesia PB User Group
http://groups.yahoo.com/group/indopb




Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___

Kirim email ke