Emile
unread,Sep 18, 2012, 3:42:05 PM9/18/12You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
The table:
Create Table BPGR/ITEMPIC
( ItemNo Num Not Null,
Picture BLOB(1M) With Default Null,
Primary Key( ItemNo )
)
The RPGLE:
D pic s SQLTYPE(BLOB_FILE)
D out s SQLTYPE(BLOB_FILE)
D item s 5 0
C/Exec SQL
C+ Set Option Commit=*NONE, DatFmt=*ISO, Naming=*SYS
C/End-Exec
C eval item = 10002
C eval pic_fo = SQFRD
C eval pic_name = '/home/PDF/gb.pdf'
C eval pic_nl = %len(%trimr(pic_name))
C/EXEC SQL Insert Into BPGR/ITEMPIC Values (:item,:pic)
C/END-EXEC
C SQLCODE Ifne 0
C SQLCODE dsply
C Endif
C eval out_fo = SQFOVR
C eval out_name = '/home/PDF/gbout.pdf'
C eval out_nl = %len(%trimr(out_name))
C/EXEC SQL Select picture
C+ Into :out
C+ From BPGR/ITEMPIC
C+ Where itemno = :item
C/END-EXEC
C SQLCODE Ifne 0
C SQLCODE dsply
C Endif
C* OUT_DL now contains the length of the data that was written to the IFS.
C Eval *inlr = *on
C Return