0

我正在调用 ColdFusion2016 中用 Oracle 11g 编写的过程。从昨天开始我一直在调试失败,不胜感激。我不知道这个错误是由我的 oracle 程序还是 Coldfusion 引起的,所以我通过调用我的 oracle sql 开发人员的程序进行了一些测试:

variable x refcursor;
variable y varchar2(200);
variable z varchar2(200);
exec um_check_alloc_bene_loadv2(v_session_id => 1, v_summary => :y, v_continue => :z, cv_1 => :x );
print x;
print y;
print z;

这给我一些结果。所以,我的假设是错误一定是由于 ColdFusion 调用造成的。但我看不出我的电话有什么问题:

        <cfstoredproc procedure="um_check_alloc_bene_loadV2" datasource="#Trim(TESTDB)#">
          <cfprocparam type="in" cfsqltype="cf_SQL_INTEGER" variable="session_id" value="#Trim(max_session_id)#" MAXLENGTH="4">
          <cfprocparam type="out" cfsqltype="CF_SQL_VARCHAR" variable="summary" value="">
          <cfprocparam type="out" cfsqltype="CF_SQL_VARCHAR" variable="continue" value="">
        <cfprocresult name="errors" resultset="1">
        </cfstoredproc>

该过程的开头如下所示:

create or replace PROCEDURE um_check_alloc_bene_loadV2 (
  v_session_id IN     NUMBER DEFAULT NULL,
  v_summary       OUT VARCHAR2                                /* DEFAULT ' '*/
                          ,
  v_continue      OUT VARCHAR2                                /* DEFAULT ' '*/
                          ,
  cv_1         IN OUT SYS_REFCURSOR)
AS
  v_rowcount   NUMBER (10, 0);
  v_errorcount NUMBER (5, 0);
BEGIN
  -- clean errors
  UPDATE um_allocation_beneficiary_ldV2
     SET errors = ' '
   WHERE session_id = v_session_id;

当我从我的 ColdFusion 调用这个过程时,我得到了这个我无法弄清楚的错误:

Error Executing Database Query.
[Macromedia][Oracle JDBC Driver][Oracle]ORA-06550: line 1, column 7: PLS-00306: wrong number or types of arguments in call to 
'UM_CHECK_ALLOC_BENE_LOADV2' ORA-06550: line 1, column 7: PL/SQL: Statement 
ignored
........................................
138 :             <cfprocparam type="out" cfsqltype="CF_SQL_VARCHAR" 
variable="summary" value="">
139 :             <cfprocparam type="out" cfsqltype="CF_SQL_VARCHAR" 
variable="continue" value="">
140 :           <cfprocresult name="errors" resultset="1">
141 :           </cfstoredproc>
142 :           <table align="center" width="90%">

SQLSTATE      HY000
DATASOURCE    TESTDB
VENDORERRORCODE   6550
SQL   {call um_check_alloc_bene_loadV2( (param 1) , (param 2) , (param 3) )}
Resources:
4

1 回答 1

2

您的过程需要四个参数,如下所示,但您只传递了三个参数。谢谢。

PROCEDURE um_check_alloc_bene_loadV2 (
  v_session_id ,   
  v_summary    ,   
  v_continue   ,   
  cv_1         )
于 2018-03-12T20:08:52.430 回答