Click here to Skip to main content
15,894,291 members
Please Sign up or sign in to vote.
2.33/5 (2 votes)
See more:
hi I created a procedure for select in oracle and it will work fine in the backend
itself .but when i call it in vb.net it will display an error message like this

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



my procedure is

create or replace procedure plp_myapp_select1(my_flag in varchar2, p_userid in user_master.user_id%type,userid_out out varchar2,p_panno in OTC_REGISTRAION.PANNUMBER%type,panid_out out sys_refcursor,company_out out varchar2)
is
v_id varchar2(40);
begin
if my_flag = 'username' then
select user_id into userid_out from user_master where user_id=p_userid;
dbms_output.put_line(v_id);
elsif my_flag = 'validatepan' then
open panid_out for select pannumber from OTC_REGISTRAION where pannumber =p_panno;
elsif my_flag = 'companyname' then
select companyname into company_out from OTC_INS_COMPANY;
end if;
end;


and in vb.net i am calling the procedure like this


cmd.Connection = cn
cmd.CommandType = Data.CommandType.StoredProcedure

cmd.CommandText = "plp_myapp_select1"
Dim Flag As New OracleParameter("my_flag", OracleDbType.Varchar2)
Flag.Direction = ParameterDirection.Input
Flag.Size = 50
Flag.Value = "username"
cmd.Parameters.Add(Flag)

  Dim qrySerial As New OracleParameter("p_userid", OracleDbType.Varchar2)
        qrySerial.Direction = ParameterDirection.Input
        qrySerial.Value = user_id.ToUpper
        cmd.Parameters.Add(qrySerial)
        Dim OutPut As New OracleParameter("userid_out", OracleDbType.Varchar2)
        OutPut.Direction = ParameterDirection.Output
        OutPut.Size = 400
        'cmd1.Parameters.Add(OutPut)
        cmd.Parameters.Add(OutPut)
       
        Dim result As Integer = cmd.ExecuteNonQuery()
        ada = New OracleDataAdapter(cmd)
        ada.Fill(ds)

what exactly wrong with my coding .if anyaone have ideas just give some inputs

What I have tried:

i tried to call this procedure from vb.net .in the back end it's working fine
Posted
Updated 30-Jan-17 20:20pm
v2

1 solution

-- First of all, try to format your question correctly so that people can understand what you have written.
-- In the Stored Procedure definition you have provided 6 parameters, out of which 3 are IN and 3 OUT parameters
-- In your code you have provided value to only 2 IN parameters

Check your code again and do the changes for parameters as required.

Hope, it helps :)
 
Share this answer
 
Comments
prabhakar78 31-Jan-17 2:41am    
hi i am using flag if the flag name is 'username' then i am going to pass user_id as
input and then receive the output so in that flag i pass only two prameters .in backend
it compiled properly.
CHill60 31-Jan-17 7:27am    
Just because something compiled does not mean it will work! At runtime you have called a procedure that the system knows nothing about until runtime and as Suvendu has said, you have not provided enough parameters. You need to pass in 3 input parameters and 3 output parameters according to the PL/SQL regardless of how you faff around with them afterwards

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