Click here to Skip to main content
15,891,204 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear all

I have written one store procedure in oracle as follows
SQL
CREATE OR REPLACE PACKAGE ESUPPORT.DEPARTMENT AS
           TYPE  CURSOR_TYPE IS REF CURSOR;
          PROCEDURE GET_EMPS (O_RESULT_SET OUT CURSOR_TYPE);
        END;
/
CREATE OR REPLACE PACKAGE BODY ESUPPORT.DEPARTMENT AS
PROCEDURE GET_EMPS (O_RESULT_SET OUT CURSOR_TYPE)
AS
          BEGIN
             OPEN O_RESULT_SET FOR
             SELECT * FROM ESUPPORTV_HR_EMP_DATA_FINAL ;
           END;
END;
/



While I am trying to execute it, in toad for oracle
It shows below error:

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

   := . ( @ % ;
The symbol ":=" was substituted for "DEPARTMENT" to continue.


Can anybody help me??

Thank you in advance.

[edit]SHOUTING removed - OriginalGriff[/edit]
Posted
Updated 22-Oct-13 21:06pm
v3
Comments
OriginalGriff 23-Oct-13 3:06am    
DON'T SHOUT. Using all capitals is considered shouting on the internet, and rude (using all lower case is considered childish). Use proper capitalisation if you want to be taken seriously.
Richard MacCutchan 23-Oct-13 3:22am    
Remove the period in ESUPPORT.DEPARTMENT and replace with a valid character.
Mahesh Devikar 23-Oct-13 3:57am    
Yes its a schema name but when i was trying to ommit it, it wont allow me.

i have tried to create another package using different name but when i save it it will automatically takes schema name with it.

Please guide.

1 solution

The schemaname should not be a part of the package definition. So if ESUPPORT is the schemaname it should be omitted.
That was not correct.
The schemaname is necessary when creating a package in the schema of an other user
SQL
CREATE OR REPLACE PACKAGE DEPARTMENT ...
 
Share this answer
 
v2
Comments
Mahesh Devikar 23-Oct-13 3:56am    
Yes its a schema name but when i was trying to ommit it, it wont allow me.

i have tried to create another package using different name but when i save it it will automatically takes schema name with it.

Please guide.
Jörgen Andersson 23-Oct-13 6:35am    
Is ESUPPORT the correct schemaname?
And do you have permissions to create packages on it?

If ESUPPORT is not a correct schemaname or if you are not having permissions on it, the parser will try to create a package with the name ESUPPORT instead, and then the .DEPARTMENT is wrong.
Mahesh Devikar 23-Oct-13 22:54pm    
Yes,ESUPPORT is correct Schema name & i have permission to create package on it.

I have compiled Package it shows no error

but when i execute it in Toad it shows above error.

Can you once again confirm me execution syntax in Toad.
Jörgen Andersson 24-Oct-13 2:02am    
Then I have misunderstood your problem. Can you please update your question with how you call your stored procedure, as that is where the error happens.

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