|
Re: How to compile a PL/SQL code in Oracle 7.3 SQL prompt? [message #36599 is a reply to message #36597] |
Wed, 05 December 2001 22:57   |
Rob Baillie
Messages: 33 Registered: November 2001
|
Member |
|
|
An example with every command...? Wow that'd take some time... instead I'll just give you a quick overview...
Compiling and running code in PL/SQL is simple...
try this example, type it straight into SQL-Plus
CREATE OR REPLACE PROCEDURE p_test
BEGIN
DBMS_OUTPUT.ENABLE;
DBMS_OUTPUT.PUT_LINE('Hello World');
END;
/
You should get...
Warning: Procedure created with compilation errors.
so, type
show error
and you should get:
LINE/COL ERROR
-------- -----------------------------------------------------------------
2/1 PLS-00103: Encountered the symbol "BEGIN" when expecting one of
the following:
( ; is with as compress compiled wrapped
type
ed
and change the first line to
CREATE OR REPLACE PROCEDURE p_test IS
save and exit
type
/
You should get
Procedure created.
You can now run it with
exec p_test
Hurrah!
If you don't want to type your procedures into SQL Plus (like most sane people) you can use any old text editor, then run the code (I.E. attempt to compile the procedure / trigger / whatever) with
@drive:directory_structurefile_name
Any more questions... read the manual:
Yep, I know they're Oracle 8, but for most things they should be perfectly alright...
http://otn.oracle.com/doc/server.804/a53717/toc.htm
http://otn.oracle.com/doc/server.804/a53717/ch7.htm#@
http://otn.oracle.com/doc/server.804/a58241/toc.htm
----------------------------------------------------------------------
|
|
|
|