Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Do I have to run catproc?

Status
Not open for further replies.

raygg

Technical User
Jun 14, 2000
397
US
I installed an 817 EE on NT40 w/sp6. I am a dba but do not know plsql well so I was trying to practise with the following in sqlplus and got this response:
SQL> create procedure my_first_proc is
2 greetings varchar2(20);
3 begin
4 greetings is 'Hello World';
5 dbms_output.put_line(greetings);
6 end my_first_proc;
7 /

Warning: Procedure created with compilation errors.

SQL> set serveroutput on;
SQL> execute my_first_proc;
BEGIN my_first_proc; END;

*
ERROR at line 1:
ORA-06550: line 1, column 7:
PLS-00905: object MTS10.MY_FIRST_PROC is invalid
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored


SQL> begin
2 my_first_proc;
3 end;
4 /
my_first_proc;
*
ERROR at line 2:
ORA-06550: line 2, column 2:
PLS-00905: object MTS10.MY_FIRST_PROC is invalid
ORA-06550: line 2, column 2:
PL/SQL: Statement ignored

what is necessary to do?

 
When you get a compilation error, use the command

show errors

to see what is wrong. In this case you will get output indicating that there is a syntax error in the line which tries to assign a value to the variable "greetings". Replace the error line with "greetings := 'Hello World';" and everything should work fine.

SQL> show errors;
Errors for PROCEDURE MY_FIRST_PROC:

LINE/COL ERROR
-------- -----------------------------------------------------------------
4/13 PLS-00103: Encountered the symbol "Hello World" when expecting
one of the following:
:= . ( @ % ;
The symbol ":= was inserted before "Hello World" to continue.
 
Thank you - sometimes it just takes another set of eyes. The book I copied it from had it right.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top