Search code examples
oracle-databaseplsqloracleformsoracle-fusion-middleware

Wrong number or types of arguments error oracle forms


I created procedure under Program Units Oracle Forms

Code:

PROCEDURE VALIDATION_TEST
    (p_mid we_group_hof_k.mstatusid%TYPE,  
     p_status we_group_hof_k.cardstatus%TYPE
                       ) is
begin
  insert into test
  select mstatusid, cardstatus
   from we_group_hof_k
   where p_mid = 1
   and p_status = 'A';
end;

This procedure complies successfully. I put this line on When-Button-Pressed Trigger "TEST" Button

VALIDATION_TEST;

When I try to compile "TEST" Button then I am getting following error:

wrong number or types of arguments in call to 'VALIDATION_TEST'

I am using oracle forms 11g.

How to solve this problem?


Solution

  • You have defined your procedure with two parameters. Your call of that procedure passes zero parameters. So you solve this by passing two parameters when you call the procedure.

    Or maybe by removing the parameters from the procedure's signature. Because quite frankly your code doesn't make a lot of sense. The WHERE clause tests the parameters against hardcoded values. So either you select all the records in we_group_hof_k - if the passed arguments are 1 and 'A' - otherwise none.

    Perhaps this is what you need?

    PROCEDURE VALIDATION_TEST
        (p_mid we_group_hof_k.mstatusid%TYPE,  
         p_status we_group_hof_k.cardstatus%TYPE
                           ) is
    begin
      insert into test
      select mstatusid, cardstatus
       from we_group_hof_k
       where mstatusid = p_mid 
       and cardstatus = p_status;
    end;
    

    Then you would call your procedure like this:

    VALIDATION_TEST(1, 'A');
    

    Although, as this procedure is called from Oracle Forms probably you need to pass in items from a Forms block. But only you know that for sure.