Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Call PL/SQL Procedure (not stored) from SQLPLUS

242480Mar 4 2012 — edited Mar 4 2012
Hello,
the following code creates a stored procedure and allows to call the procedure from SQLPLUS using EXEC.
CREATE or REPLACE PROCEDURE welcome IS
BEGIN 
    dbms_output.put_line('Welcome user ' || user);
END;
/
exec welcome;
I would like to do the same without storing the procedure. The procedure should be defined in an PL/SQL-Script and called in a SQLPLUS loop. On the one hand I do not have the privileges to create stored procdures. On the other hand I want to use put_line in the loop. Without passing control to SQLPLUS (e.g. the loop-master) all output is kept in the buffer and no information are shown during processing the data.

Regards, Rainer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 1 2012
Added on Mar 4 2012
17 comments
2,092 views