string ls_path, ls_file, ls_emp_cd
blob lb_image, lb_temp
long ll_filelen, ll_ret
integer li_loop, i, li_file
ll_ret = dw_1.getrow()
if ll_ret = 0 then return
ls_emp_cd = dw_1.getitemstring(ll_ret, 'as_emp_cd')
selectblob
empnp_pic
into
:lb_image
from
inse98t1
where
empno = :ls_emp_cd
using sqlca;
IF SQLCA.SQLCode = -1 THEN
MessageBox("SQL error", SQLCA.SQLErrText)
END IF
ll_filelen = len(lb_image)
if ll_filelen > 32765 then
if mod(ll_filelen,32765) = 0 then
li_loop = ll_filelen / 32765
else
li_loop = (ll_filelen/32765) + 1
end if
else
li_loop = 1
end if
GetFileSaveName ( "선택", ls_path, ls_file, "JPG","JPG Files, *.JPG")
li_file = FileOpen(ls_path, StreamMode!, Write!, Shared!, Append!)
for i = 1 to li_loop
if i = li_loop then
lb_temp = BlobMid(lb_image, (i - 1) * 32765 + 1)
else
lb_temp = BlobMid(lb_image, (i - 1) * 32765 + 1,32765)
end if
FileWrite(li_file, lb_temp)
next
Fileclose(li_file)
'PowerBuilder > Tip!' 카테고리의 다른 글
DataWindow 이벤트 호출 방법 (0) | 2018.03.06 |
---|---|
string 변환 (0) | 2018.01.09 |
[파워빌더] 이미지 DB에 저장하기 (0) | 2017.10.17 |
DataWindow에서 중북 코드 체크 (0) | 2017.04.21 |
윈도우 open 이벤트에 작성하는 초기화 관련 (0) | 2015.09.16 |