Skip to Main Content
  • Questions
  • Executing .sql file in Pl/sql procedure

Breadcrumb

Question and Answer

Connor McDonald

Thanks for the question, Ajay.

Asked: January 09, 2017 - 11:20 am UTC

Last updated: January 09, 2017 - 11:49 am UTC

Version: 12.0

Viewed 10K+ times! This question is

You Asked

Hi ,

I am trying to execute a set of insert statements in a pl/sql block. However these insert scripts vary time to time. Hence i would like to save them in some location as .sql file and execute in pl/sql

So i would like to know if it is possible to call the script in plsql block? if so please give me an example

That would be helpful for me

Thanks
Ajay

and Chris said...

Not exactly. You can't run the files directly. But you can create a scheduler job of type SQL_SCRIPT that runs them through SQL*Plus.

You can find a worked example from Tim Hall at:

https://oracle-base.com/articles/12c/scheduler-enhancements-12cr1#sql-script

Rating

  (2 ratings)

Is this answer out of date? If it is, please let us know via a Comment

Comments

A reader, August 29, 2017 - 12:27 pm UTC


A reader, December 07, 2017 - 12:29 am UTC


More to Explore

Administration

Need more information on Administration? Check out the Administrators guide for the Oracle Database