?
Solved

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

Posted on 2004-04-27
4
Medium Priority
?
332 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 750 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

When it comes to protecting Oracle Database servers and systems, there are a ton of myths out there. Here are the most common.
A company’s centralized system that manages user data, security, and distributed resources is often a focus of criminal attention. Active Directory (AD) is no exception. In truth, it’s even more likely to be targeted due to the number of companies …
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…

743 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