Click here to Skip to main content
15,914,375 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have below code for Import a file ,but on line
C#
int recordsInserted = o_Cls_OracleConnect.CallStoredProcedure("IMP_PKG.BANKMSTIMP");
                  o_Cls_OracleConnect.Dispose();


it gives me below exception

ORA-06550: line 1, column 7:
PLS-00306: wrong number or types of arguments in call to 'BANKMSTIMP'
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored


C#
if (imp_module == "m_impbankmaster")
{
    //Call Procedure
    try
    {
        s_dsnstr = o_Cls_Utility.utl_fnGetDSNStr(SessionCheck.s_sessiondpid);
        OracleConnect o_Cls_OracleConnect = new OracleConnect(s_dsnstr);
        o_Cls_OracleConnect.CallStoredProcedure_PreInit();
        o_Cls_OracleConnect.CallStoredProcedure_Varchar2_AddParameters("Par2", parameter2);
        o_Cls_OracleConnect.CallStoredProcedure_Varchar2_AddParameters("Par3", parameter3);
        o_Cls_OracleConnect.CallStoredProcedure_Varchar2_AddParameters("Par4", parameter4);
        int recordsInserted = o_Cls_OracleConnect.CallStoredProcedure("IMP_PKG.BANKMSTIMP");
        o_Cls_OracleConnect.Dispose();
    }
    catch (Exception ex)
    {
        throw ex;
    }
}


Below is Store Procedure.
VB
Case 8  'Bank Master
          Par2 = aArr(1)  'Path
          Par3 = aArr(2)  'File Name
          Par4 = aArr(3)  'User Id
          conn.Open dsn 'Establishing Connection with Server
          conn.BeginTrans
          On Error GoTo ErrTrap:
          SQL = " Begin " & _
                " imp_pkg.BankMstImp('" & Par2 & "','" & Par3 & "','" & Par4 & "'); " & _
                " End; "
          conn.Execute SQL
          conn.CommitTrans
          Label1.Caption = "Bank Master Import - CD10 has completed."


Below is Store Procedure.
SQL
CREATE OR REPLACE PROCEDURE imp_pkg.BankMstImp(cPath VARCHAR2,cFilename VARCHAR2,cUserName VARCHAR2) AS
Posted
Updated 7-Oct-13 1:22am
v7
Comments
Richard MacCutchan 7-Oct-13 4:10am    
What are the parameters required by the stored procedure?
Member 9410081 7-Oct-13 6:35am    
I have posted the store procedure.
Azee 7-Oct-13 4:16am    
Can you post your Store Procedure as well?
Member 9410081 7-Oct-13 6:35am    
I have posted the store procedure.
Member 9410081 7-Oct-13 4:23am    
I have posted the store procedure.

1 solution

I think I know what your problem is.
The parameterarray is zerobased but your first parameter (index 0) is missing.
So try using:
VB
Par2 = aArr(0)  'Path
Par3 = aArr(1)  'File Name
Par4 = aArr(2)  'User Id
 
Share this answer
 
Comments
Member 9410081 8-Oct-13 6:31am    
Thanks.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900