How to execute a sql*plus script from pl/sql block.

My script contains sql plus set commands. how to execute that script in a pl/sql block i.e. either anonymous ,procedure or function or trigger

Questions by st0025808

Showing Answers 1 - 6 of 6 Answers

Susil Kumar

  • Feb 20th, 2008
 

Let me reframe the question as follows:
          How to execute pl/sql block in sql*plus environment?

If I am on the right path, I'll be able to give the correct answer.

The first step, check whether you have permission to access procedures. To do that execute the following query.
 
              select * from session_privs;

Once you have made sure that you can. Type in sql*plus as:

                                     exec <scriptname>

*The script file contains the pl/sql block code.

  Was this answer useful?  Yes

hemant.agarwal03

  • Mar 17th, 2008
 

First you need to save your file in .sql format, suppose you create set.sql and saved it on c: drive then follow below command.

SQL> @C:SET.SQL and press ENTER

your script has been executed. :-)

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions