windycoolboy 2003-10-17 04:23:47
能不能把PBL文件存入到SQL数据库中!
...全文
39 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
qqjj7758 2003-10-18
  • 打赏
  • 举报
回复
TEXT IMAGE
只是要UPDATEBLOB而不是INSERTBLOB
joyouth88 2003-10-17
  • 打赏
  • 举报
回复
integer li_filenum,li_loops,li_counter
long ll_filelen,ll_butes_read,ll_new_pos
blob lb_our_blob,lb_tot_b,lb_temp
setnull(lb_tot_b)
ll_filelen = fileLength(ls_filepath)
li_filenum = fileopen(ls_filepath,streammode!,read!,lockread!)
if ll_filelen > 32765 then
li_loops = ((ll_filelen - 1)/ 32765) + 1
else
li_loops = 1
end if

for li_counter = 1 to li_loops
ll_butes_read = fileRead(li_filenum,lb_our_blob)
if li_counter=1 then
lb_tot_b = lb_our_blob
else
lb_tot_b = lb_tot_b +lb_our_blob
end if
ll_new_pos = ll_new_pos + ll_butes_read
fileseek(li_filenum,ll_new_pos,frombeginning!)

next
fileclose(li_filenum)
return lb_tot_b
//函数结束,然后用updateblob保存进数据库
//导出成文件,先用getfilesavename函数
另一个函数
integer li_loops,li_counter,li_filenum,li_rtn
long ll_filelen
ll_filelen = len(lb_content)
if ll_filelen = 0 then
messagebox('提示信息',"源文件不存在!")
return 0
end if
if fileexists(ls_path) then
li_rtn = messagebox('提示信息',"目标文件已存在,是否覆盖?",question!,Yesno!,1)
if li_rtn = 1 then
filedelete(ls_path)
else
return 0
end if
end if
if fileexists(ls_path) then
messagebox('提示信息',"目标文件无法删除,请手工删除后再执行此程序!")
return 0
end if
if ll_filelen > 32765 then
li_loops = ((ll_filelen - 1)/ 32765) + 1
else
li_loops = 1
end if

li_filenum = fileopen(ls_path,streammode!,write!,shared!,append!)
for li_counter = 1 to li_loops
filewrite(li_filenum,blobmid(lb_content,32765 * (li_counter - 1) + 1,32765))
next
fileclose(li_filenum)
messagebox('提示信息',"文件保存成功!")
return 1
//保存函数
windycoolboy 2003-10-17
  • 打赏
  • 举报
回复
workhand(我是醒着的.....)

具体一点行不,我用存储图片的方法存储是不成功的
joyouth88 2003-10-17
  • 打赏
  • 举报
回复
JPEG Processing Error
Not a JPRG file: starts with 0*48*44
workhand 2003-10-17
  • 打赏
  • 举报
回复
hehe ,干什么的都有啊,支持
klbt 2003-10-17
  • 打赏
  • 举报
回复
可以考虑用iamge数据类型

752

社区成员

发帖
与我相关
我的任务
社区描述
PowerBuilder 数据库相关
社区管理员
  • 数据库相关社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧