zoukankan      html  css  js  c++  java
  • 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,奇怪不?

  • 相关阅读:
    python 上传下载文件
    post方式加载iframe
    js 实现打印功能
    python 判断数据类型
    web样式无法正常显示
    C# 调用python
    PDF转换成Txt
    js预览PDF的插件(亲测支持IE9,火狐,等等)
    文件下载
    asp.net网站发布到服务器GET的技能
  • 原文地址:https://www.cnblogs.com/szxiaofei14/p/3768380.html
Copyright © 2011-2022 走看看