Solved

How to invoke sql script from procedure in PL/SQL?

Posted on 2004-04-27
4
331 Views
Last Modified: 2012-06-27
Hi,

I want to invoke a sql script from the procedure which i am creating from another sql script main.sql.
Typically my code would look like
create procedure x
begin
       some code.........
       run a.sql
       some code....

end;

I tried using
sql_stmt := '@a.sql'
execute immediate sql_stmt;

but it didn't worked.

Thanks in advance,
Smita
0
Comment
Question by:smita_kulkarni
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 23

Accepted Solution

by:
rama_krishna580 earned 250 total points
ID: 10930241
Hi look at this..

step.1 : Calling prime_menu.sql from this below.sql file.

ALTER SESSION SET NLS_DATE_FORMAT = 'DD-MON-YY HH24:MI:SS';

@@bye.sql;


Step.2.

clear;
set line 2;
set buffer 1000;
set line 1000;
set trimout off;
clear screen;
set heading off
col aday format a38
col atime format a15
show user
select '  '||to_char(sysdate,'hh12:mm A.M.') atime,
'  '||to_char(sysdate,'Day Month dd,yyyy') aday ,
' Day of Year:'||to_char(sysdate,'DDD') from dual;
prompt
prompt
set trims on;
set heading on;
clear col;

prompt  ========================================================
prompt  =                                                      =
prompt  =          BYE    Thank you for using the System       =
prompt  =                                                      =
PROMPT  ========================================================


Note: use step.1, and 2 in seperate .sql files and try these steps...

best of luck..

R.K

0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Azure Functions is a solution for easily running small pieces of code, or "functions," in the cloud. This article shows how to create one of these functions to write directly to Azure Table Storage.
This post contains step-by-step instructions for setting up alerting in Percona Monitoring and Management (PMM) using Grafana.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…

696 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question