Home » SQL & PL/SQL » SQL & PL/SQL » Can't figure out the simplest, two-line proc!
icon9.gif  Can't figure out the simplest, two-line proc! [message #305746] Tue, 11 March 2008 18:31 Go to next message
radalapsker@yahoo.com
Messages: 3
Registered: March 2008
Junior Member
Hello,

I have a proc that keeps giving me errors. I reduced it to 2 lines but still can't figure out the problem... can't be that hard but I just can't see what could possibly be wrong!

Package Specification

CREATE OR REPLACE PACKAGE TEST123 AS

    PROCEDURE TEST1(xcursor OUT SYS_REFCURSOR, xstring OUT VARCHAR2);
        
END TEST123;
/


Package Body

CREATE OR REPLACE PACKAGE BODY TEST123 AS
    
    PROCEDURE TEST1(xcursor OUT SYS_REFCURSOR, xstring OUT VARCHAR2)
    
    AS BEGIN
        open xcursor for SELECT 'one banana' as abc from dual; 
        xstring := 'yellow';       
    END TEST1;
         
END TEST123;
/


Error:

ORA-06550: line 1, column 29:
PLS-00103: Encountered the symbol ";" when expecting one of the following:

   . ( ) , * @ % & | = - + < / > at in is mod remainder not
   range rem => .. <an exponent (**)> <> or != or ~= >= <= <>
   and or like LIKE2_ LIKE4_ LIKEC_ as between from using ||
   indicator multiset member SUBMULTISET_

The symbol ", was inserted before ";" to continue.



Any help is much appreciated!
Re: Can't figure out the simplest, two-line proc! [message #305747 is a reply to message #305746] Tue, 11 March 2008 18:46 Go to previous messageGo to next message
Littlefoot
Messages: 21823
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
No problem on my 10g:
SQL> CREATE OR REPLACE PACKAGE Test123 AS
  2
  3      PROCEDURE TEST1(xcursor OUT SYS_REFCURSOR, xstring OUT VARCHAR2);
  4
  5  END Test123;
  6  /

Package created.

SQL>
SQL> CREATE OR REPLACE PACKAGE BODY Test123 AS
  2
  3      PROCEDURE TEST1(xcursor OUT SYS_REFCURSOR, xstring OUT VARCHAR2)
  4
  5      AS BEGIN
  6          OPEN xcursor FOR SELECT 'one banana' AS Abc FROM dual;
  7          xstring := 'yellow';
  8      END TEST1;
  9
 10  END Test123;
 11  /

Package body created.

SQL> select * From v$version;

Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod
PL/SQL Release 10.2.0.1.0 - Production
CORE    10.2.0.1.0      Production
TNS for 32-bit Windows: Version 10.2.0.1.0 - Production
NLSRTL Version 10.2.0.1.0 - Production

SQL>
Re: Can't figure out the simplest, two-line proc! [message #305839 is a reply to message #305747] Wed, 12 March 2008 03:08 Go to previous messageGo to next message
pablolee
Messages: 2882
Registered: May 2007
Location: Scotland
Senior Member
Works for me too (demo code would be identical to LittleFoot's so no point in posting it)
Re: Can't figure out the simplest, two-line proc! [message #305842 is a reply to message #305839] Wed, 12 March 2008 03:22 Go to previous messageGo to next message
Frank
Messages: 7901
Registered: March 2000
Senior Member
No errors on 10 XE either.
Please post your sqlplus session, so we can see exactly where it goes wrong.
By the looks of the mentioning of "line 1" it could be the call to the package instead of the package creation

[Edit: typo]

[Updated on: Wed, 12 March 2008 03:22]

Report message to a moderator

Re: Can't figure out the simplest, two-line proc! [message #305852 is a reply to message #305747] Wed, 12 March 2008 03:50 Go to previous messageGo to next message
Michel Cadot
Messages: 68733
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
It also works in 9.2(.0.6).

Regards
Michel
Re: Can't figure out the simplest, two-line proc! [message #305883 is a reply to message #305746] Wed, 12 March 2008 05:24 Go to previous message
S.Rajaram
Messages: 1027
Registered: October 2006
Location: United Kingdom
Senior Member
I am almost certain you are not creating this package using sql*plus client. Check this link
http://oradim.blogspot.com/2007/04/odpnet-tip-anonymous-plsql-and.html

If it is of no help to you then google it.

Regards

Raj
Previous Topic: Before Drop trigger
Next Topic: how many number of elements passed to in operator
Goto Forum:
  


Current Time: Sat Feb 08 13:16:18 CST 2025