sql – 错误“ORA-00932:不一致的数据类型:预期 – 在Join语句中得到BLOB”

前端之家收集整理的这篇文章主要介绍了sql – 错误“ORA-00932:不一致的数据类型:预期 – 在Join语句中得到BLOB”前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我在下面的存储过程中执行有问题.
我收到ORA-00932的错误:数据类型不一致:预期 – 添加时得到BLOB
FM.FAXFILE_BLOB列在下面存储过程.FAXFILE_BLOB是一个blob字段.如果我删除这个字段一切正常.我不知道为什么会这样.请帮助….
CREATE OR REPLACE Procedure HCADMIN.Proc_GetFaxDetailsByDate
         ( 
           FromDate varchar2 default null,ToDate varchar2 default null,FaxNo varchar2 default null,ClaimNo varchar2 default null,NspCode varchar2 default null,PolicyNo varchar2 default null,HEGICNo varchar2 default null,cur_faxdetails OUT SYS_REFCURSOR
           )
        IS
       BEGIN
      OPEN cur_faxdetails For

      Select distinct
       FM.RECORDNO_NUM,FM.CLAIMNO_VAR,FM.FAXNO_VAR,FM.FAXSTATUS_VAR,FM.FAXTYPE_VAR,FM.USERNAME_VAR,FM.HEGIC_NO_VAR,FM.RESEND_NO_NUM,FM.RESNDCOUNT_NUM,TO_date(FM.TIMESTAMP_DTE,'dd/MM/yyyy') as "TIMESTAMP_DTE",FR.RECIPIENTFAXNO_VAR,FM.FAXFILE_BLOB

       From TPA_FAXMASTER FM Left  join TPA_FAXRECIPIENT FR on                                      FM.RECORDNO_NUM=FR.RECORDNO_NUM 
 WHERE 
      NVL(FM.FAXNO_VAR,'0')=NVL(FaxNo,NVL(FM.FAXNO_VAR,'0')) And
      NVL(FR.RECIPIENTFAXNO_VAR,NVL(FR.RECIPIENTFAXNO_VAR,'0')) And          
      NVL(FM.CLAIMNO_VAR,'0')=NVL(ClaimNo,NVL(FM.CLAIMNO_VAR,'0')) And  
      NVL(FM.NSPID_VAR,'0')=NVL(NspCode,NVL(FM.NSPID_VAR,'0')) And
      NVL(FM.POLICYNO_VAR,'0')=NVL(PolicyNo,NVL(FM.POLICYNO_VAR,'0')) And  
      NVL(FM.HEGIC_NO_VAR,'0')=NVL(HEGICNo,NVL(FM.HEGIC_NO_VAR,'0')) And    
      (NVL(TO_date(FM.TIMESTAMP_DTE,'dd/MM/yyy'),To_Date('09/09/9999','dd/MM/yyyy')) 
      BETWEEN NVL (TO_date(FromDate,'dd/MM/yyyy'),NVL(TO_date(FM.TIMESTAMP_DTE,'dd/MM/yyyy')))
      AND  NVL (TO_date(ToDate,'dd/MM/yyyy'))));
EXCEPTION
 WHEN NO_DATA_FOUND THEN
   Null;
 WHEN OTHERS THEN
   -- Consider logging the error and then re-raise
   RAISE;
 END;
 /

解决方法

如果select_list包含LOB列,则不能指定 DISTINCT.

尝试使用标量子查询获取BLOB字段.

原文链接:https://www.f2er.com/mssql/78807.html

猜你在找的MsSQL相关文章