10

{"ORA-06550: PLS-00306: 调用 '**' 时 错误 ORA-06550:

{"ORA-06550: 第 1 行, 第 7 列: PLS-00306: 调用 'PROC_GETDATA' 时参数个数或类型错误 ORA-06550: 第 1 行, 第 7 列: PL/SQL: Statement ignored "}
这是我的程序调用代码
'''
''' 获取数据的万能存储过程,查询返回结果集的存储过程调用
''' Author:Jones.Vale
''' Datetime:20160127
'''
''' 存储过程名
''' 传入的参数数组,第一列为参数名,第二列为参数值
'''
'''
Public Function ExecStoredProcData(ByVal strProcName As String, ByVal objHashtable As Hashtable) As DataSet
Dim mydt As New DataSet
Dim myCommand As OracleCommand
Dim objOracleParameter As IDictionaryEnumerator = objHashtable.GetEnumerator()
Dim iii As Integer
iii = 30
myCommand = myORACLEConnection.CreateCommand
While objOracleParameter.MoveNext()
Dim tempValue As String = TypeName(objOracleParameter.Value)
Dim myParameter As New OracleParameter '定义一个参数

        If tempValue = "Date" Then
            myParameter.DbType = DbType.Date   '赋参数类型  
        ElseIf tempValue = "Integer" Then
            myParameter.DbType = DbType.Int32    '赋参数类型  
        ElseIf tempValue = "Double" Or tempValue = "Float" Or tempValue = "NUMBER" Then
            myParameter.DbType = DbType.Double    '赋参数类型  
        Else
            myParameter.DbType = DbType.String  '赋参数类型 
        End If
        myParameter.ParameterName = objOracleParameter.Key
        myParameter.Value = objOracleParameter.Value
        myCommand.Parameters.Add(myParameter) '加入参数列表 
    End While
    myCommand.CommandText = strProcName
    myCommand.CommandType = CommandType.StoredProcedure 
    Dim dataAdapter As New OracleDataAdapter
    dataAdapter.SelectCommand() = myCommand
    dataAdapter.Fill(mydt)
    Return mydt
End Function

以下是在plSQL中执行测试结果没有任何问题。

存储过程代码:
CREATE OR REPLACE PROCEDURE PROC_GetData
(
v_dateTime date,
v_tiger number,
p_cur out SYS_REFCURSOR---游标返回
)
as
v_sql varchar2(2000) := ' ';
begin
if v_tiger = 2 then
v_sql :='select t.branchno,sum(t.reportloss)/10000 as RV from bhresvfee.t_resv_claim_bhsys t
where t.insuranceclass like (''7%'') and casestate<>''9'' group by t.branchno order by t.branchno';
end if;
OPEN p_cur FOR v_sql;

end PROC_GetData;

高手请指点一下这个问题是什么引起的。怎么处理才有效,谢谢!

查看全部
JonesVale
JonesVale
2016/01/28 06:41
  • 存储过程
  • oracle
  • net
  • 点赞
  • 收藏
  • 回答
    私信

3个回复