Why 'wrong number of parameters' error in this call to a stored procedure?

A stored procedure exists that inserts a new record and returns the newly generated record ID. This stored procedure is called from a WinForms application but at the ExecuteNonQuery time an exception is thrown indicating that the wrong number of parameters
has been supplied. If I take out the one parameter that is marked as ParameterDirection.Output then the ExecuteNonQuery does not throw an exception.
CREATE PROCEDURE [dbo].[API_InsertIntoManu]
@Name nvarchar(50),
@Description nvarchar(2000)
AS
SET NOCOUNT ON
INSERT INTO Manu (
[Name],
[Description]
VALUES (
@Name,
@Description
SELECT SCOPE_IDENTITY() As InsertedID
END
GO
The C# code that calls the above SP looks like this:
using (SqlConnection conn = new SqlConnection( "<snipped>" ))
using (SqlCommand cmd = new SqlCommand( "[dbo].[API_InsertIntoManu]", conn ))
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add( Name, SqlDbType.NVarChar, 50 ).Value = "some name";
cmd.Parameters.Add( Title, SqlDbType.NVarChar, 200 ).Value = "some title";
// This parameter is supposed to receive the new row's ID but instead triggers a 'wrong number of args' exception.
cmd.Parameters.Add( "InsertedID",SqlDbType.Int ).Direction = ParameterDirection.Output;
conn.Open();
// This is where the exception gets thrown.
cmd.ExecuteNonQuery();
iReturn = (int)cmd.Parameters[InsertedID].Value;
Richard Lewis Haggard

In you sp the size of Title var is 2000 and not 200, correct this:
cmd.Parameters.Add( "@Title", SqlDbType.NVarChar, 200 ).Value
Fouad Roumieh

Similar Messages

  • Wrong number of parameters error

    We are using jpub and sqlj in Solaris to generate Java Classes for our app.
    We also have a set of .sql scripts which in effect clone a schema.
    When we run jpub/sqlj against packages in the original schema, everything is fine, but against the clone, while jpub creates sqlj code which is identical to that from the first schema, sqlj complains (when on-line checking is turned on):
    A: "JDBC: reports more than one return value for <function name>" and advises that we update our driver;
    B:"Did not find <func name> with <n> arguments. found <func name> with <n + a bunch> of arguments" and tells us to check the call.
    We have no idea what might be causing this, and when we turn off the on-line checking for sqlj, everything appears to work fine.
    Any ideas/suggestions ?

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by SQLJ Development ([email protected]):
    Mmmh. This may be a bug in the way SQLJ resolves functions/stored procedures. Could you send me your infile/.sql/.sqlj files so that I can reproduce your problem? Thanks!
    In the meantime, if everything works at runtime, you may have to ignore the errors and do your final compile offline.<HR></BLOCKQUOTE>
    I haven't forgotten. We've got a lot of code, and will try to boil down to an illustrative example when we can.
    At the moment, an off-line compile seems to work - though you might want to check my other post today :-)
    null

  • PLS-00306: wrong number or types of arguments in call to existing stored pr

    hi , I'm using an existing stored procedure in my C code.
    The stored procedure in question has been compiled and is proven to work without any errors. However, when I use the same in my C code, its failing with the above error.
    The Store procedure definition looks like :
    CREATE OR REPLACE FUNCTION SP(
    srq_id integer ,
    unid IN SPkg.arr_parmid,
    parm_typ IN SPkg.arr_parm_typ,
    parm_lbl IN SPkg.arr_parm_lbl,
    parm_vlu IN SPkg.arr_parm_vlu,
    commit_flag INTEGER DEFAULT 1,
    vlu_hint IN SPkg.arr_vlu_hint,
    create_flag INTEGER DEFAULT 0)
    RETURN INTEGER
    Type definitions
    TYPE arr_parm_typ IS TABLE OF char INDEX BY BINARY_INTEGER;
    TYPE arr_parmid IS TABLE OF tbl_parm.UNID%TYPE INDEX BY BINARY_INTEGER;
    TYPE arr_parm_lbl IS TABLE OF tbl_parm.PARM_LBL%TYPE INDEX BY BINARY_INTEGER;
    TYPE arr_parm_vlu IS TABLE OF tbl_parm.PARM_VLU%TYPE INDEX BY BINARY_INTEGER;
    TYPE arr_vlu_hint IS TABLE OF tbl_parm.VLU_HINT%TYPE INDEX BY BINARY_INTEGER;
    My C code looks like :
    typedef struct param
    char lbl[30][81];
    char vlu[30][256];
    char typ[30];
    ub8 seq_no[30];
    char vlu_hint[30];
    }PARAM;
    ub8 srqid;
    int commit_flag;
    int create_flag;
    PARAM p_array;
    The way I invoke the stored procedure:
    char command[250] = "begin :retval := SSP_srq_parm_all(:srq_id,:unid,:parm_typ,:parm_lbl,:parm_vlu,:commit_flag,:vlu_hint,:create_flag); end;";
    OCIStmtPrepare2((OCISvcCtx *)svchp, (OCIStmt **)&(stmthp),
                        (OCIError *)errhp, (OraText *)command,
                        (ub4)strlen((char*)command), (OraText *)NULL, (ub4)0,
                        OCI_NTV_SYNTAX, OCI_DEFAULT);
    //..... calls to OCIBindByName & OCIBindArrayOfStruct here..........
    status= OCIStmtExecute(svchp, stmthp,errhp, (ub4)1, (ub4) 0,(CONST OCISnapshot *) NULL,(OCISnapshot *) NULL, OCI_DEFAULT);
    OCIStmtExecute() fails with the above error.
    Please let me know if you need to know how the 'bind' calls look like. I dint paste them right away because the code chunk is pretty big.
    Can someone please help?

    hi , I'm using an existing stored procedure in my C code.
    The stored procedure in question has been compiled and is proven to work without any errors. However, when I use the same in my C code, its failing with the above error.
    The Store procedure definition looks like :
    CREATE OR REPLACE FUNCTION SP(
    srq_id integer ,
    unid IN SPkg.arr_parmid,
    parm_typ IN SPkg.arr_parm_typ,
    parm_lbl IN SPkg.arr_parm_lbl,
    parm_vlu IN SPkg.arr_parm_vlu,
    commit_flag INTEGER DEFAULT 1,
    vlu_hint IN SPkg.arr_vlu_hint,
    create_flag INTEGER DEFAULT 0)
    RETURN INTEGER
    Type definitions
    TYPE arr_parm_typ IS TABLE OF char INDEX BY BINARY_INTEGER;
    TYPE arr_parmid IS TABLE OF tbl_parm.UNID%TYPE INDEX BY BINARY_INTEGER;
    TYPE arr_parm_lbl IS TABLE OF tbl_parm.PARM_LBL%TYPE INDEX BY BINARY_INTEGER;
    TYPE arr_parm_vlu IS TABLE OF tbl_parm.PARM_VLU%TYPE INDEX BY BINARY_INTEGER;
    TYPE arr_vlu_hint IS TABLE OF tbl_parm.VLU_HINT%TYPE INDEX BY BINARY_INTEGER;
    My C code looks like :
    typedef struct param
    char lbl[30][81];
    char vlu[30][256];
    char typ[30];
    ub8 seq_no[30];
    char vlu_hint[30];
    }PARAM;
    ub8 srqid;
    int commit_flag;
    int create_flag;
    PARAM p_array;
    The way I invoke the stored procedure:
    char command[250] = "begin :retval := SSP_srq_parm_all(:srq_id,:unid,:parm_typ,:parm_lbl,:parm_vlu,:commit_flag,:vlu_hint,:create_flag); end;";
    OCIStmtPrepare2((OCISvcCtx *)svchp, (OCIStmt **)&(stmthp),
                        (OCIError *)errhp, (OraText *)command,
                        (ub4)strlen((char*)command), (OraText *)NULL, (ub4)0,
                        OCI_NTV_SYNTAX, OCI_DEFAULT);
    //..... calls to OCIBindByName & OCIBindArrayOfStruct here..........
    status= OCIStmtExecute(svchp, stmthp,errhp, (ub4)1, (ub4) 0,(CONST OCISnapshot *) NULL,(OCISnapshot *) NULL, OCI_DEFAULT);
    OCIStmtExecute() fails with the above error.
    Please let me know if you need to know how the 'bind' calls look like. I dint paste them right away because the code chunk is pretty big.
    Can someone please help?

  • Wrong number or types of arguments in call to 'P_RETRIEVE_OPPTY_ORDER_STATU

    I have been strucK at a point in invoking the procedure which has a boolean parameter which when called from java program get error saying that "wrong number or types of arguments in call to 'P_RETRIEVE_OPPTY_ORDER_STATUS'". the procedure is given below along with the calling java code , and the Errors.
    If i change the parameter data type to VARCHAR2 (the parameter hilighted in red) in the in the procedure and invoke it with the same method it works fine, even if i change the "callableStatement.setBoolean(1, true); to callableStatement.setInt(1, 1); it works fine.When i call it with setting the boolean to the procedure from my java i get a error. Im really confused whether is this a issue with oracle? or with java code.
    Please can any body suggest me any kind of solution! to over come this scenario.
    ///// java code
    public void testThePackage() throws ClassNotFoundException { Connection connection = null; connection = (Connection) getConnection(); CallableStatement callableStatement = null; try { callableStatement = connection .prepareCall("{call L_test.p_retrieve_oppty_order_status(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)}"); callableStatement.setBoolean(1, true); // callableStatement.setString(1, "YES"); // callableStatement.setInt(1, 1); // callableStatement.setLong(1, 1L); callableStatement.setString(2, "SFA"); callableStatement.setString(3, "123421"); callableStatement.setLong(4, 1L); callableStatement.setLong(5, 123L); callableStatement.setLong(6, 345L); callableStatement.setInt(7, 10); callableStatement.setInt(8, 2435); callableStatement.setInt(9, 5675); callableStatement.registerOutParameter(10, Types.NUMERIC); // on_return_status callableStatement.registerOutParameter(11, Types.VARCHAR); // os_duns_no callableStatement.registerOutParameter(12, Types.VARCHAR); // os_hq_duns_no callableStatement.registerOutParameter(13, Types.NUMERIC); // on_approval_id callableStatement.registerOutParameter(14, Types.NUMERIC); // on_approval_amt callableStatement.registerOutParameter(15, Types.VARCHAR); // os_message callableStatement.registerOutParameter(16, Types.VARCHAR); // os_approval_cd callableStatement.registerOutParameter(17, Types.VARCHAR); // os_security_term_cd callableStatement.registerOutParameter(18, Types.VARCHAR); // action // code callableStatement.registerOutParameter(19, Types.VARCHAR); // action // message // txt callableStatement.execute(); connection.commit(); } catch (SQLException e) { System.out.println(e.getMessage()); } } [/code] /////procedure  CREATE OR REPLACE PACKAGE BODY cust.L_test IS  PROCEDURE p_retrieve_oppty_order_status          (isNonAttilaAttempt boolean          , is_system_cd VARCHAR2          , is_order_id VARCHAR2          , in_oppty_id NUMBER          , in_company_id VARCHAR2          , in_acct_id NUMBER          ,in_local_rev NUMBER          ,in_switched_rev NUMBER          ,in_dedicated_rev NUMBER          , on_return_status  OUT NUMBER          , os_duns_no OUT VARCHAR2          , os_hq_duns_no OUT VARCHAR2          , on_approval_id OUT NUMBER          , on_credit_balance OUT NUMBER            , os_message OUT VARCHAR2      , os_approval_cd OUT VARCHAR2      , os_security_term_cd OUT VARCHAR2      ,os_action_cd  OUT VARCHAR2      ,os_action_txt_msg OUT VARCHAR2) IS      io_return l_cdt_util.return_data_t;            action_cd VARCHAR2(20):= NULL;      flag boolean:=false;  BEGIN  if isNonAttilaAttempt =[color=red]true[/color]  then --'YES'  true  flag:=true;  end if;  insert into example (id,data,deleted) values(1,'Test','YES');        END p_retrieve_oppty_order_status;    END cust.L_test;      CREATE OR REPLACE PACKAGE BODY cust.L_test IS PROCEDURE p_retrieve_oppty_order_status         (isNonAttilaAttempt boolean         , is_system_cd VARCHAR2         , is_order_id VARCHAR2         , in_oppty_id NUMBER         , in_company_id VARCHAR2         , in_acct_id NUMBER         ,in_local_rev NUMBER         ,in_switched_rev NUMBER         ,in_dedicated_rev NUMBER         , on_return_status  OUT NUMBER         , os_duns_no OUT VARCHAR2         , os_hq_duns_no OUT VARCHAR2         , on_approval_id OUT NUMBER         , on_credit_balance OUT NUMBER         , os_message OUT VARCHAR2     , os_approval_cd OUT VARCHAR2     , os_security_term_cd OUT VARCHAR2     ,os_action_cd  OUT VARCHAR2     ,os_action_txt_msg OUT VARCHAR2) IS     io_return l_cdt_util.return_data_t;        action_cd VARCHAR2(20):= NULL;     flag boolean:=false; BEGIN if isNonAttilaAttempt =[color=red]true[/color]  then --'YES'  true flag:=true; end if; insert into example (id,data,deleted) values(1,'Test','YES');       END p_retrieve_oppty_order_status; END cust.L_test;    /////error ORA-06550: line 1, column 7:  wrong number or types of arguments in call to 'P_RETRIEVE_OPPTY_ORDER_STATUS'  line 1, column 7:  PL/SQL: Statement ignored                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    Hi YoungWinston,
    I realy appriciate your comments on the standard of the code , i also accept procedure and code may not be readable,
    but the problem is not because of bloated call its just beacause of the Boolean parameter being passed throught the java code, and where as the SQL/PL does not allow BOOLEAN as paramater, please refer the below link for justification.
    what am expecting is , is there any solution to this problem (not a work arround solution).
    Please provide me with some sort of solution/hints or suggestions in achieving this solution,
    I would realy your effort
    Thanks
    ud
    http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28370/datatypes.htm#CJACJGBG
    Predefined PL/SQL BOOLEAN Data Type
    The BOOLEAN data type stores logical values, which you can use in logical operations. The logical values are the Boolean values TRUE and FALSE and the value NULL.
    The syntax for specifying an BOOLEAN data item is:
    BOOLEAN
    SQL has no data type equivalent to BOOLEAN; therefore you cannot use BOOLEAN variables or parameters in the following:
    SQL statements
    Built-in SQL functions (such as TO_CHAR)
    PL/SQL functions invoked from SQL statements
    You cannot insert the value TRUE or FALSE into a database column. You cannot retrieve the value of a database column into a BOOLEAN variable.
    To represent BOOLEAN values in output, use IF-THEN or CASE constructs to translate BOOLEAN values into another type (for example, 0 or 1, 'Y' or 'N', 'true' or 'false').

  • PLS-00306: wrong number or types of arguments in call to 'START_COMMAND'

    I've got a package pkgrun with several procedures and when I compile the package I get the message:
    Warning: execution completed with warning
    PACKAGE BODY pkgrun Compiled.
    44/7           PLS-00306: wrong number or types of arguments in call to 'START_COMMAND'The procedure start_block in pkgrun with line 44:
    PROCEDURE start_block (id_run_v           IN NUMBER,
                             id_block_v         IN NUMBER)
      IS
        CURSOR c_blockcommand(id_block_v NUMBER) IS
          SELECT c.id, c.command, c.returntype, c.testtype, c.testvalue
          FROM command c
          WHERE c.id_block = id_block_v
          ORDER BY c.run_sequence;
      BEGIN
        FOR r_blockcommand IN c_blockcommand(id_block_v) LOOP
          start_command(r_blockcommand.testtype, r_blockcommand.command, r_blockcommand.testvalue, r_blockcommand.id, id_run_v, r_blockcommand.returntype);
        END LOOP;
      END start_block;The procedure start_command in pkgrun:
    PROCEDURE start_command (testtype_v       IN VARCHAR2,
                               command_v        IN VARCHAR2,
                               testvalue_v      IN VARCHAR2,
                               id_command_v     IN NUMBER,
                               id_run_v         IN NUMBER,
                               returntype_v     IN VARCHAR2)
      IS
        testresult_v            VARCHAR2(100);
        testresult_number_v     NUMBER;
        testresult_cursor_v     REF CURSOR;
        number_rows             NUMBER;
      BEGIN
        IF testtype_v = '' THEN
          EXECUTE IMMEDIATE command_v;
        ELSE
          IF retruntype_v = 'NUMBER' THEN
            EXECUTE IMMEDIATE command_v
            INTO testresult_number_v;
            test_result_v := to_char(testresult_number_v);
          ELSIF returntype_v = 'CURSOR' THEN
            EXECUTE IMMEDIATE command_v
            INTO testresult_curor_v;
            number_rows := testresult_cursor_v%ROWCOUNT;
            test_result_v := to_char(number_rows);
          ELSE
            EXECUTE IMMEDIATE command_v
            INTO testresult_v;
          END IF;
          testresult_v := to_char(testresult_v);
          test_value(testtype_v, testvalue_v, testresult_v, id_command_v, id_run_v);
        END IF;
      END start_command;I hope someone can help me.

    describe command;
    Name                           Null     Type                                                                                                                                                                                         
    ID                             NOT NULL NUMBER                                                                                                                                                                                       
    ID_BLOCK                       NOT NULL NUMBER                                                                                                                                                                                       
    COMMAND                                 VARCHAR2(500)                                                                                                                                                                                
    RETURNTYPE                              VARCHAR2(100)                                                                                                                                                                                
    TESTTYPE                                VARCHAR2(100)                                                                                                                                                                                
    TESTVALUE                               VARCHAR2(100)                                                                                                                                                                                
    ENABLED                                 VARCHAR2(100)                                                                                                                                                                                
    RUN_SEQUENCE                            NUMBER                                                                                                                                                                                       
    8 rows selected

  • Exception has occurred during data insertion ... Wrong number of parameters

    I am using an ADO dataflow source and an ADO dataflow destination to move data from a table on an IBM iSeries DB2 database to another IBM iSeries DB2 database on another machine.  The connection managers for source and destination both use .Net Providers\Odbc
    Data Provider with the Data Source Specification being ODBC connections specified on the Windows Server 2008 r2 machine hosting bids.  All the test connections work...so far so good.
    Issue is when I execute the control flow task the rows get picked up from the source DB2 database no problem but it fails on the insert to the destination DB2 table...The progress tab specifies the exceptions...
    [ADO NET Destination [601]] Error: An exception has occurred during data insertion, the message returned from the provider is: ERROR [07002] [IBM][System i Access ODBC Driver]Wrong number of parameters.
    [SSIS.Pipeline] Error: SSIS Error Code DTS_E_PROCESSINPUTFAILED.  The ProcessInput method on component "ADO NET Destination" (601) failed with error code 0xC020844B while processing input "ADO NET Destination Input" (604). The identified
    component returned an error from the ProcessInput method. The error is specific to the component, but the error is fatal and will cause the Data Flow task to stop running.  There may be error messages posted before this with more information about the
    failure.
    I put a data viewer on the data flow connection and the records I expect are  getting picked up and look ok. I checked to make sure the source and destination tables have the same number of columns in their record layout and identical data
    types and they look fine.
    Could someone kindly tell me whats going wrong?  Does the error message indicate that some of the columns are getting dropped from the dataset before the insert?
    Thanks much in advance for any help, Roscoe

    Hi Roscoe,
    Glad to hear that you have found the root cause. So, the issue occurs because numeric values with no decimal cannot be inserted into the Decimal data type column in the DB2 table. In SSIS, data type Decimal of DB2 database is mapped to data type DT_NUMERIC.
    To address the issue, you can do a data conversion for the column in question to define its precision and scale such as DT_NUMERIC(9,2) by using the Data Conversion Transformation before the ADO NET Destination.
    Regards,
    Mike Yin
    If you have any feedback on our support, please click
    here
    Mike Yin
    TechNet Community Support

  • Wrong number of parameters exception when using PreparedStatement

    Hi,
    I'm getting Wrong number of parameters exception when using a prepared statement. It's very weird. The code is:
    sqlstmt="update blah1 set blah2=? where blah3=?";
    myps = Conn.prepareStatement(sqlstmt);
    myps.setString(1, p1);
    myps.setInt(2, p2);
    myps.executeUpdate(sqlstmt);
    The error is:
    SQLException: [IBM][CLI Driver] CLI0100E Wrong number of parameters. SQLSTATE=07001:07001
    Could someone please help? Thanks
    Mahdad

    Hi and thanks for the reply.
    Actually this is the try block...
    The variable's defintions are correct.
    PreparedStatement myps;
    try {
    sqlstmt="update blah1 set blah2=? where blah3=?";
    myps = Conn.prepareStatement(sqlstmt);
    myps.setString(1, blah4);
    myps.setInt(2, blah5);
    myps.executeUpdate(sqlstmt);
    catch (SQLException e) {
    System.out.println("SQLException: " + e.getMessage() + ":" + e.getSQLState());
    blah6++;

  • Error PLS-00306: wrong number or types of arguments in call to

    I am getting the following Error when calling stored Procedure, I have tried with Last Parameter PRESULT and WITHOUT IT, it fails in both the instance.
    =======================================================================
    "System.Data.OracleClient.OracleException: ORA-06550: line 1, column 7:
    PLS-00306: wrong number or types of arguments in call to 'UPDATECOTRACKING'
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored
    =======================================================================
    signature of Stored Procedure is as follow
    (pmaster_key IN sca_costtrackinglog.master_key%type,
         pdoc_master_key IN sca_costtrackinglog.master_key%type,     
    pfrenumber IN sca_costtrackinglog.fre_number%type,     
    pnotice1 IN sca_costtrackinglog.notice1%type,
    pnotice2 IN sca_costtrackinglog.notice2%type,
    padditreceived IN sca_costtrackinglog.additreceived%type,
    pfreanticipate IN sca_costtrackinglog.freanticipate%type,
    pdateofnot IN sca_costtrackinglog.dateofnot%type,
    pdateofmeeting IN sca_costtrackinglog.dateofmeeting%type,
    psenttocontractor IN sca_costtrackinglog.senttocontractor%type,
    pcouforexecution IN sca_costtrackinglog.couforexecution%type,
    pcomments IN sca_costtrackinglog.comments%type,
    pcreateby IN sca_costtrackinglog.createby%type,
    peditby IN sca_costtrackinglog.editby%type,
         presult OUT number) is
    This is the Trace of Parameters from actual Call, that fails with above error.
    Parameter Name : PMASTER_KEY(Input),Type(AnsiString) Size(26), Value = 000328JYA30008HSWBCK01NYC
    Parameter Name : pdoc_master_key(Input),Type(AnsiString) Size(26), Value = 310657KLF30025HSWBCK01NYC
    Parameter Name : PFRENUMBER(Input),Type(AnsiString) Size(12), Value = 00015
    Parameter Name : PNOTICE1(Input),Type(DateTime) Size(1), Value = 3/25/2010
    Parameter Name : PNOTICE2(Input),Type(DateTime) Size(1), Value =
    Parameter Name : PADDITRECEIVED(Input),Type(DateTime) Size(1), Value =
    Parameter Name : PFREANTICIPATE(Input),Type(DateTime) Size(1), Value =
    Parameter Name : PDATEOFNOT(Input),Type(DateTime) Size(1), Value =
    Parameter Name : PDATEOFMEETING(Input),Type(DateTime) Size(1), Value =
    Parameter Name : PSENTTOCONTRACTOR(Input),Type(DateTime) Size(1), Value =
    Parameter Name : pcouforexecution(Input),Type(DateTime) Size(1), Value =
    Parameter Name : pcomments(Input),Type(AnsiString) Size(250), Value =
    Parameter Name : PCREATEBY(Input),Type(AnsiString) Size(50), Value = NYCSCA\tmpns2
    Parameter Name : PEDITBY(Input),Type(AnsiString) Size(50), Value = NYCSCA\tmpns2
    +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    Below is the trace from Data.OracleClient.OracleCommandBuilder.DeriveParameters(Cmd)
    Parameter Name : PMASTER_KEY(Input),Type(AnsiString) Size(2000), Value =
    Parameter Name : PDOC_MASTER_KEY(Input),Type(AnsiString) Size(2000), Value =
    Parameter Name : PFRENUMBER(Input),Type(AnsiString) Size(2000), Value =
    Parameter Name : PNOTICE1(Input),Type(DateTime) Size(0), Value =
    Parameter Name : PNOTICE2(Input),Type(DateTime) Size(0), Value =
    Parameter Name : PADDITRECEIVED(Input),Type(DateTime) Size(0), Value =
    Parameter Name : PFREANTICIPATE(Input),Type(DateTime) Size(0), Value =
    Parameter Name : PDATEOFNOT(Input),Type(DateTime) Size(0), Value =
    Parameter Name : PDATEOFMEETING(Input),Type(DateTime) Size(0), Value =
    Parameter Name : PSENTTOCONTRACTOR(Input),Type(DateTime) Size(0), Value =
    Parameter Name : PCOUFOREXECUTION(Input),Type(DateTime) Size(0), Value =
    Parameter Name : PCOMMENTS(Input),Type(AnsiString) Size(2000), Value =
    Parameter Name : PCREATEBY(Input),Type(AnsiString) Size(2000), Value =
    Parameter Name : PEDITBY(Input),Type(AnsiString) Size(2000), Value =
    Parameter Name : PRESULT(Output),Type(VarNumeric) Size(0), Value =
    ******************************************************************************************************************

    In the Oracle database, the body of the package FWA_PRI API, the procedure ValidatePri declares P_PriREc as being :
    PAYMENT_REQUEST_IMPORT%ROWTYPE
    As you can see above, the DoPri Procedure expects a type p_PriRec as its second argument.
    Therefore in my procedure I do the following:
    create or replace procedure spMatchPayment is
    BEGIN
    DECLARE
           CURSOR StageCurs IS SELECT * FROM PAYMENT_REQUEST_IMPORT;
                  p_payment_req_import PAYMENT_REQUEST_IMPORT%ROWTYPE;
                  BEGIN
                       OPEN StageCurs();
                            LOOP
                                FETCH StageCurs INTO P_payment_req_import;
                                EXIT WHEN StageCurs%NOTFOUND;
                                fwa_pri.DoPri(NULL, fwa_pri.DoPri('M',P_PriRec => p_payment_req_import);                           
                             END LOOP;
                        CLOSE StageCurs;
                   END;
    end spMatchPayment;
    Now, when I am trying to compile I am getting the Compilation errors for PROCEDURE IMPACT.SPMATCHPAYMENT
    Error: PLS-00306: wrong number or types of arguments in call to 'DOPRI'
    Line: 16
    Text: fwa_pri.DoPri(NULL,P_PriRec => p_payment_req_import);
    I don't see what's wrong on my code......HELP!!

  • Error 306, wrong number or types of argument in call to ADD_OBJECT_ARG

    Hello all,
    I am trying to install Webutil to Forms 9i, but when compiling the webutil.pll, I am getting the compilation error 306, wrong number or types of argument in call to ADD_OBJECT_ARG(args, a0, 'java/lang/Object').
    The problems are in the body of Package Jave_System when some methods of JNI are called.
    What is JNI and how i can fix this problem?

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Instructor:
    The procedure most likely requires an argument when executed.
    To specify the argument in forms, you need to go to BLOCK property QUERY DATA SOURCE ARGUMENTS and if performing DML...use INSERT PROCEDURE ARGUMENTS, UPDATE PROCEDURE ARGUMENTS, and DELETE PROCEDURE ARGUMENTS.
    Hope this helps.<HR></BLOCKQUOTE>
    thanks, I will check it out !
    null

  • WHILE expression giving Error 306, wrong number or types of args in call to

    WHILE expression giving Error 306, wrong number or types of args in call to '='
    declare
         block_id block;
         item_id item;     
    begin
         block_id := find_block(:system.cursor_block);
         item_id := find_item(:system.cursor_item);
         message('Current Block: ' || :system.cursor_block || '  Current Item: ' || :system.cursor_item);
         next_block;
         while find_block(:system.cursor_block) = block_id
         loop
              message('Current Block: ' || :system.cursor_block || '  Current Item: ' || :system.cursor_item);
              next_block;
         end loop;
    exception
         when others then
         message(sqlerrm);
    end;I don't see what the problem is?
    Gus

    other than that there are logical errors in this
    u hav to use here != with the while loop.
    Again loop willl never return to first block.It will stuck at last block and will show error.
    For ur question u can use as
    declare
         --block_id block;
         --item_id item;     
         vc_first_block varchar2(65);
    begin
         vc_first_block := :system.cursor_block;
         --block_id := find_block(:system.cursor_block);
         --item_id := find_item(:system.cursor_item);
         message('Current Block: ' || :system.cursor_block || ' Current Item: ' || :system.cursor_item);
         next_block;
         while :system.cursor_block != vc_first_block
         loop
    Message was edited by:
    jeneesh

  • Form Builder. Error 306 wrong number or types of arguments in call to populate_table

    Hi ! I'm trying to build a simple form based on a procedure.
    the error that i get:
    error 306 - wrong number or types of arguments in call to populate_table
    When I use the Data block
    wizard, I specify the procedure with a ref cursor argument. the procedure code:
    open ind_prof for select i.nome, i.idade, p.nome
    from individuo i, individuo_profissao ip, profissao p
    where i.cod_individuo=ip.cod_individuo
    and ip.cod_profissao=p.cod_profissao;
    The error that i get 'points' to this procedure. I checked the cursor type, the record
    type and everything seems ok.
    I'm using a ref cursor to query.
    I have the same proble either using a procedure or a function.
    There is another method to load the data into the block. That procedure is called
    automatically and it has a table of the same record type as the ref cursor as an
    argument. What code should I write on it ?
    what should I write in both of them ?
    Thanks !

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Instructor:
    The procedure most likely requires an argument when executed.
    To specify the argument in forms, you need to go to BLOCK property QUERY DATA SOURCE ARGUMENTS and if performing DML...use INSERT PROCEDURE ARGUMENTS, UPDATE PROCEDURE ARGUMENTS, and DELETE PROCEDURE ARGUMENTS.
    Hope this helps.<HR></BLOCKQUOTE>
    thanks, I will check it out !
    null

  • Wrong number of parameters

    Whats wrong with this code?
         public void updateProduct(String id, String name, String description, String cost){
              Connection conn = null;
              DataSourceManager dataSource = new DataSourceManager();
              conn = dataSource.getConnection();
              PreparedStatement stmt;
              try {
                   String updateString = "UPDATE PRODUCT SET PRODUCT_NAME = ?, DESCRIPTION = ?, COST = ? WHERE PRODUCT_ID LIKE ?";
                   stmt = conn.prepareStatement(updateString);
                   stmt.setString(1, name);
                   stmt.setString(2, description);
                   stmt.setDouble(3, Double.parseDouble(cost));
                   stmt.setString(4, id);
                   stmt.executeUpdate(updateString);
                   conn.commit();
              } catch (SQLException sqle) {
                   sqle.printStackTrace();
    I get:
    COM.ibm.db2.jdbc.DB2Exception: [IBM][CLI Driver] CLI0100E Wrong number of parameters. SQLSTATE=07001
         at COM.ibm.db2.jdbc.app.SQLExceptionGenerator.throw_SQLException(SQLExceptionGenerator.java:256)
         at COM.ibm.db2.jdbc.app.SQLExceptionGenerator.throw_SQLException(SQLExceptionGenerator.java:193)
         at COM.ibm.db2.jdbc.app.SQLExceptionGenerator.check_return_code(SQLExceptionGenerator.java:444)
         at COM.ibm.db2.jdbc.app.DB2Statement.execute2(DB2Statement.java:435)
         at COM.ibm.db2.jdbc.app.DB2Statement.executeUpdate(DB2Statement.java:381)
         at com.ibm.ejs.cm.cache.CachedStatement.executeUpdate(CachedStatement.java:132)
         at com.ibm.ejs.cm.proxy.StatementProxy.executeUpdate(StatementProxy.java:190)
         at com.bright.coffeeplease.persistence.ProductPersister.updateProduct(ProductPersister.java:114)
         at com.bright.coffeeplease.product.UpdateProductServlet.doGet(UpdateProductServlet.java:24)
         at com.bright.coffeeplease.product.UpdateProductServlet.doPost(UpdateProductServlet.java:12)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.ibm.servlet.engine.webapp.StrictServletInstance.doService(ServletManager.java:827)
         at com.ibm.servlet.engine.webapp.StrictLifecycleServlet._service(StrictLifecycleServlet.java:159)
         at com.ibm.servlet.engine.webapp.IdleServletState.service(StrictLifecycleServlet.java:286)
         at com.ibm.servlet.engine.webapp.StrictLifecycleServlet.service(StrictLifecycleServlet.java:106)
         at com.ibm.servlet.engine.webapp.ServletInstance.service(ServletManager.java:472)
         at com.ibm.servlet.engine.webapp.ValidServletReferenceState.dispatch(ServletManager.java:1012)
         at com.ibm.servlet.engine.webapp.ServletInstanceReference.dispatch(ServletManager.java:913)
         at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:403)
         at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:227)
         at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:98)
         at com.ibm.servlet.engine.webapp.InvokerServlet.service(InvokerServlet.java:267)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.ibm.servlet.engine.webapp.StrictServletInstance.doService(ServletManager.java:827)
         at com.ibm.servlet.engine.webapp.StrictLifecycleServlet._service(StrictLifecycleServlet.java:159)
         at com.ibm.servlet.engine.webapp.IdleServletState.service(StrictLifecycleServlet.java:286)
         at com.ibm.servlet.engine.webapp.StrictLifecycleServlet.service(StrictLifecycleServlet.java:106)
         at com.ibm.servlet.engine.webapp.ServletInstance.service(ServletManager.java:472)
         at com.ibm.servlet.engine.webapp.ValidServletReferenceState.dispatch(ServletManager.java:1012)
         at com.ibm.servlet.engine.webapp.ServletInstanceReference.dispatch(ServletManager.java:913)
         at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:403)
         at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:227)
         at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:98)
         at com.ibm.servlet.engine.srt.WebAppInvoker.doForward(WebAppInvoker.java:67)
         at com.ibm.servlet.engine.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java:123)
         at com.ibm.servlet.engine.invocation.CachedInvocation.handleInvocation(CachedInvocation.java:67)
         at com.ibm.servlet.engine.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java:122)
         at com.ibm.servlet.engine.oselistener.OSEListenerDispatcher.service(OSEListener.java:315)
         at com.ibm.servlet.engine.http11.HttpConnection.handleRequest(HttpConnection.java:60)
         at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:313)
         at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:242)
         at com.ibm.ws.util.CachedThread.run(ThreadPool.java:122)

    You don't want to call
    stmt.executeUpdate(updateString)
    You just want to call executeUpdate() - the prepared statement already knows what you're trying to do.
    Hope this helps.
    Incidentally, did you really mean "... WHERE PRODUCT_ID LIKE ?" rather than "... WHERE PRODUCT_ID = ?"

  • PLSQL Concurrent error: wrong number or types of arguments in call

    Hi there,
    I've defined a PLSQL Concurrent with 2 parameters:
    10) DELIVERABLE_ID using valueset 10/Number (A 10 digit positive number field with no validation)
    20) STATUS using valueset 10 Characters (10 Characters free text with no validation)
    My request run into error, with parameter values DELIVERABLE_ID = 105367,STATUS=New
    Cause: FDPSTP failed due to ORA-06550: line 1, column 7:
    PLS-00306: wrong number or types of arguments in call to 'EBOARD_WF_START'
    ORA-06550: line 1, column 7:
    But I ran the the same PLSQL from toad
    ADB_PA_BC_WF.EBOARD_WF_START (105367,'New');
    I dont have any error, it completed successfully.
    Any clue what gone wrong?

    You need to define package / procedure with RETCODE and ERRBUF arguments to call as concurrent program.
    procedure my_cp
    ( errbuf out varchar2,
    retcode out varchar2,
    p_arg1 in varchar2,
    p_arg2 in varchar2
    Regards,
    Gareth

  • PLS-00306: wrong number or types of arguments in call to . Error Help

    I have create a algorithm which The member function at the end, returns xc and yc.
    ERROR at line 9:
    ORA-06550: line 9, column 63:
    PLS-00306: wrong number or types of arguments in call to 'o'
    ORA-06550: line 9, column 2:
    PL/SQL: Statement ignored

    Guess your function has: RETURN NUMBER
    If so, the statement RETURN 'True' will give you exactly that error.
    Also:
    Return xc;
    Return yc;
    does not work as intended. The function will end by returning xc. (If it ever makes it that far)

  • PLS-00306: wrong number or types of arguments in call to 'ENQUEUE'

    Hi All,
    I am trying to create a Queue and En-queue a message but I am getting error while en-queue a message as,
    "*ERROR at line 10:*
    *ORA-06550: line 10, column 3:*
    *PLS-00306: wrong number or types of arguments in call to 'ENQUEUE'*
    *ORA-06550: line 10, column 3:*
    *PL/SQL: Statement ignored*"
    I am using oracle 11g R2. Below is the script, user mthiiora1 has AQ ADMIN privilege,
    CREATE TYPE mthiiora1.mt_ora1_q_type1 AS OBJECT (message_id NUMBER,
    message_text VARCHAR2(4000));
    BEGIN
    -- Creating Queue Table
    DBMS_AQADM.CREATE_QUEUE_TABLE (queue_table => 'mt_ora1_q_type1_t1',
    queue_payload_type => 'mthiiora1.mt_ora1_q_type1');
    -- Creating Queue
    DBMS_AQADM.create_queue (queue_name => 'mt_ora1_que1',
    queue_table => 'mt_ora1_q_type1_t1');
    -- Starting Queue
    DBMS_AQADM.start_queue (queue_name => 'mt_ora1_que1',
    enqueue    => TRUE);
    END;
    DECLARE
    laq_queue_options         DBMS_AQ.ENQUEUE_OPTIONS_T;
    laq_message_properties    DBMS_AQ.MESSAGE_PROPERTIES_T;
    laq_message_id            RAW(32);
    laq_message               mthiiora1.mt_ora1_q_type1;
    BEGIN
    laq_message := mthiiora1.mt_ora1_q_type1(1, 'Message 1');
    DBMS_AQ.enqueue ( queue_name          => 'mt_ora1_que1',
    enqueue_options     => laq_queue_options,
    message_properties  => laq_message_properties,
    pay_load            => laq_message,
    msgid               => laq_message_id);
    COMMIT;
    END;
    Could you anyone please help me to resolve this issue?

    hi orawiss,
    Thank you. I went through this link before i post the question in this fourm. But the parameters of DBMS_AQ.enqueue is same as my code. But why am I still getting the error message?

Maybe you are looking for

  • My iPad is not working

    All of a suddun my iPad stop working a week before. This include unable to start and charge the battery. I tried using different Apple power cords and charger. But still it is not working. What can I do to regain my iPad function? Please help. Thanks

  • I message not working

    My I message and face time Is not working help?

  • Resave and reedit forms on Adobe Reader

    I have created a pdf FORM in Adobe Professional for my dad to use with Adobe Reader (or at least not Professional). He can surely use the fields and input information onto the form and save it, but he cannot go back into the form and edit or resave (

  • Text to text machine translation

    Hi, I'm looking for a VI that can translate an entered string to an equivalent value in a list of strings and display this equivalent string E.g. If I type in "a" it would display "Alpha" and if I type in b it would display "Beta" and so on. Thanks

  • BUG: Last Image of Large Number Being Moved fails

    This has happened several times in organizing some folders.  Moving over 100 images at a time, it seems that one image near the end fails - I get the screen that Lightroom can't move the image right now.  It's always just one image.  I can move it on