pb中sql语句用to_char查询出来数据,居然无法检索出数据,oracle数据库,这是什么原因?...

1 /*这样dw_modified总是无法检索出正确的结果*/
2 select nvl(max(to_char(SBLJL01,'000')),'000') 
3   into :is_recoder_old_sn 
4   from emra03 
5  where szybh01 = :as_pat_id
6    and Swdfl01 = :as_emr_code;    
7 
8 Integer li_ret
9 li_ret = dw_modified.retrieve(as_pat_id,as_emr_code,is_recoder_old_sn)
1 /*这样就没事,能得出结果*/
2 select max(SBLJL01)
3 into :is_recoder_old_sn 
4 from emra03 
5 where szybh01 = :as_pat_id
6 and Swdfl01 = :as_emr_code;    
7 
8 Integer li_ret
9 li_ret = dw_modified.retrieve(as_pat_id,as_emr_code,is_recoder_old_sn)
 1 /*这样也没问题*/
 2 Long ll_recoder_old_sn  
 3 select max(to_number(SBLJL01))
 4   into :ll_recoder_old_sn  
 5   from emra03 
 6  where szybh01 = :as_pat_id
 7    and Swdfl01 = :as_emr_code;
 8     
 9 is_recoder_old_sn = String(ll_recoder_old_sn,"000")
10 
11 Integer li_ret
12 li_ret = dw_modified.retrieve(as_pat_id,as_emr_code,is_recoder_old_sn)

可是两个select 语句的结果都是023,奇怪不?

转载于:https://www.cnblogs.com/szxiaofei14/p/3768380.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值