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,奇怪不?

  • 相关阅读:
    常用的汇编指令与技巧
    汇编调用c函数为什么要设置栈
    lp2356
    String函数的总结
    2019-5-22训练
    STL——substr
    STL 反转函数 (reverse() )
    2019-5-15训练——深搜
    高精度加法
    八皇后题解
  • 原文地址:https://www.cnblogs.com/szxiaofei14/p/3768380.html
Copyright © 2011-2022 走看看