Blob variable for UPDATEBLOB cannot be empty ???

kvw 2003-10-15 05:52:37
用Powerbuilder 7.0.3,后台是Oracle 8.1.7,
表ww结构如下:
id varchar2(100) primary key;
content blob null;

出错语句为:
blob v_detail
v_detail =blob(mle_1.text)
updateblob ww set content=:v_detail where id='1';
mle_1.text有内容时更新成功,但mle_1.text中没有内容就出错。
这样我如何才能将某一行的blob字段在powerbuilder中值为空??
...全文
486 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
zzutligang 2003-10-16
  • 打赏
  • 举报
回复
updateblob不允许设置一个为null的blob变量,处理办法当然是避免blob变量为null了。
kvw 2003-10-16
  • 打赏
  • 举报
回复
谢谢各位
我跟踪了一下:
updateblob ww set content=:v_detail where id='1' and :v_detail is not null;
无论mle_1.text中是否有数据,v_detail都不是空值。

后来,我这样处理
v_detail =blob(mle_1.text)
if isnull(mle_1.text) or mle_1.text='' then
update law set content=null where id=:v_id;
else
updateblob law set content=:v_detail where id=:v_id;
end if
结果是正确的
dongquestion 2003-10-15
  • 打赏
  • 举报
回复
blob v_detail
v_detail =blob(mle_1.text)
updateblob ww set content=:v_detail where id='1' and :v_detail is not null;
地狱余烬 2003-10-15
  • 打赏
  • 举报
回复

当 mle_1.text中没有内容时(即:if mle_1.text ="" then ),你可以写:setnull(mle_1.text) 或者 mle_1.text = space(2)

应该就不错了
double22822 2003-10-15
  • 打赏
  • 举报
回复

setnull(变量名)//置空null,not empty
变量名 = ''//置空。
if (mle_1.text) = '' or isnull(mle_1.text) then
return
else
操作
end if
kvw 2003-10-15
  • 打赏
  • 举报
回复
出错的提示为:
Blob variable for UPDATEBLOB cannot be empty

这是什么原因?请高人帮忙

1,075

社区成员

发帖
与我相关
我的任务
社区描述
PowerBuilder 相关问题讨论
社区管理员
  • 基础类社区
  • WorldMobile
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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