Powerbuilder,select into的问题,下面看详细

陶小淘 2013-07-30 04:47:12
datetime dt_date
select discharge_date_time into :dt_date from A where A.iD='1002';

上面的sql查询出来是空值,为什么dt_date=1900-1-1
有什么办法控制它 如果是空值就提示么?
...全文
336 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
kenshu 2013-08-01
  • 打赏
  • 举报
回复
引用 楼主 sayyouneedme 的回复:
datetime dt_date select discharge_date_time into :dt_date from A where A.iD='1002'; 上面的sql查询出来是空值,为什么dt_date=1900-1-1 有什么办法控制它 如果是空值就提示么?
if sqlca.sqlcode = 0 then //成功 else //找不到值,或其它原因,比如网线断了。 setnull(dt_date) end if
zhangyangziwo 2013-07-31
  • 打赏
  • 举报
回复
楼主想提示什么呀? datetime dt_date 日期类型的变量,没得值,就默认1900-01-01吧,总不能等于空字符串吧 想提示的话,提前先判断一下吧 select count(1) into :ll_count from A where A.iD='1002' and discharge_date_time is null;
fengxiaohan211 2013-07-31
  • 打赏
  • 举报
回复
select discharge_date_time from A where A.iD='1002' 在数据库是什么结果啊

1,110

社区成员

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

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