Home » Infrastructure » Windows » how to fix PLS-00306 (2 merged) (oracle 10g,vs2005,windows 7)
icon4.gif  how to fix PLS-00306 (2 merged) [message #561879] Thu, 26 July 2012 01:13 Go to next message
shanavassb
Messages: 1
Registered: July 2012
Junior Member
how to fix :PLS-00306

my procedure code is

create or replace procedure search1 (bn in bill.billno%type)
as
s bill.sno%type;
d bill.description%type;
q bill.qty%type;
p bill.price%type;
u bill.unit%type;
a bill.amount%type;
t bill.total%type;
TYPE stab IS REF CURSOR;
st stab;
begin
open st for select sno,description,qty,unit,price,amount,total from bill where billno=bn order by sno asc;
loop
fetch st into s,d,q,u,p,a,t;
exit when st%notfound;
insert into search values(s,'d',q,'u',p,a,t);
commit;
end loop;
close st;
end;
/

my c# code is

string oradb = "Data Source=shamim-pc;User ID=alsafa;Password=alsafa;Unicode=True";
OracleConnection conn = new OracleConnection(oradb);
conn.Open();

OracleCommand cmd = new OracleCommand("search1",conn);
cmd.CommandType = CommandType.StoredProcedure;


OracleParameter b = new OracleParameter("b", OracleType.Number, 8);
b.Direction = ParameterDirection.Input;
b.Value = textBox14.Text;
cmd.Parameters.Add(b);

cmd.ExecuteNonQuery();
Re: how to fix PLS-00306 [message #561883 is a reply to message #561879] Thu, 26 July 2012 01:24 Go to previous messageGo to next message
Michel Cadot
Messages: 68625
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Welcome to the forum, Please read OraFAQ Forum Guide and How to use [code] tags and make your code easier to read.
Make sure that lines of code do not exceed 80 characters when you format.
Indent the code, use code tags and align the columns in result.
Use the "Preview Message" button to verify.
Also always post your Oracle version, with 4 decimals.

And always the complete error message, we don't know all of them by heart.

Quote:
PLS-00306: wrong number or types of arguments in call to 'string'

Cause: This error occurs when the named subprogram call cannot be matched to any declaration for that subprogram name. The subprogram name might be misspelled, a parameter might have the wrong datatype, the declaration might be faulty, or the declaration might be placed incorrectly in the block structure. For example, this error occurs if the built-in square root function SQRT is called with a misspelled name or with a parameter of the wrong datatype.

Action: Check the spelling and declaration of the subprogram name. Also confirm that its call is correct, its parameters are of the right datatype, and, if it is not a built-in function, that its declaration is placed correctly in the block structure.


The problem is more a C# one than a PL/SQL one, I move the topic to the appropriate forum.

Regards
Michel
Re: how to fix PLS-00306 [message #562119 is a reply to message #561879] Sat, 28 July 2012 11:37 Go to previous message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
Please read and follow the forum guidelines, to enable us to help you:

http://www.orafaq.com/forum/t/88153/0/

post CREATE TABLE BUY & CREATE TABLE CBUY statements
Previous Topic: Stuck at configuration process
Next Topic: Oracle 11g Installation process window 2008 Server R2 64 Bit.
Goto Forum:
  


Current Time: Fri Mar 29 04:26:53 CDT 2024