Home » SQL & PL/SQL » SQL & PL/SQL » Why PLS-00306 error? (Oracle 9i)
Why PLS-00306 error? [message #318689] Wed, 07 May 2008 10:16 Go to next message
VEDDETA
Messages: 54
Registered: May 2008
Member
 

 CREATE OR REPLACE PROCEDURE TEST
        ( p_id employee.employee_id%type,
		  p_cnt OUT number)
  IS
  BEGIN
         
          SELECT COUNT (*) INTO p_cnt  
          FROM  employee A where A.employee_id= p_id;
  
 END TEST;
 /

Procedure created.

SQL> execute test(18);
BEGIN test(18); END;

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

SQL>  SELECT COUNT (*)  
          FROM  employee A where A.employee_id=18;

  COUNT(*)
----------
        54





Can anyone tell whats wrong there?
Re: Why PLS-00306 error? [message #318690 is a reply to message #318689] Wed, 07 May 2008 10:26 Go to previous messageGo to next message
Michel Cadot
Messages: 64106
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Test has 2 parameters, you called it with only one.

Regards
Michel
Re: Why PLS-00306 error? [message #318691 is a reply to message #318689] Wed, 07 May 2008 10:31 Go to previous messageGo to next message
VEDDETA
Messages: 54
Registered: May 2008
Member
Thanks Michel. How to execute it?
Whats the syntax to execute?
Re: Why PLS-00306 error? [message #318693 is a reply to message #318691] Wed, 07 May 2008 10:49 Go to previous messageGo to next message
Michel Cadot
Messages: 64106
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
var cnt number
exec test (18, :cnt)

Regards
Michel
Re: Why PLS-00306 error? [message #318741 is a reply to message #318693] Wed, 07 May 2008 16:39 Go to previous messageGo to next message
Littlefoot
Messages: 20892
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
To save your breath (because, I guess your next question would be "How can I display the result?"):
PRINT cnt
Re: Why PLS-00306 error? [message #318907 is a reply to message #318689] Thu, 08 May 2008 07:30 Go to previous message
VEDDETA
Messages: 54
Registered: May 2008
Member
Thanks to Michel and Littlefoot...
Thanks for being so helpful!!!!!
Previous Topic: Procedure not returning value due to a select statement
Next Topic: Need help in SQL query using rownum
Goto Forum:
  


Current Time: Mon Dec 05 03:04:41 CST 2016

Total time taken to generate the page: 0.09721 seconds