Home » SQL & PL/SQL » SQL & PL/SQL » How to call another sql script within the sql script
How to call another sql script within the sql script [message #227497] Wed, 28 March 2007 07:16 Go to next message
lokeshg82
Messages: 23
Registered: February 2007
Location: chennai
Junior Member
hi,

here i have a sql script,inside the script i want to call another sql script,

for example see the below sql script,

DECLARE
data varchar2(20);
variable1 NUMBER;
HandleN varchar(20);
BEGIN
data:='&1';
select BI_ACCOUNTID into variable1 from pb_bill_info where PBBTN=data;
do.pl('BI_ACCOUNTID');
do.pl('------------');
do.pl(variable1);
select pbhandlenamelower INTO HandleN from pb_handle where pbhandleid in(select max(pbhandleid)
from pb_handle where ha_customerentityid in (select acct_customerentityid from account
where acct_accountid =variable1)) AND pbmainhandleflag=1 ;
do.pl('==============================') ;
do.pl('Handle Name: ' || HandleN ) ;
do.pl('==============================') ;
EXCEPTION
WHEN OTHERS THEN
do.pl('No rows selected');
END;
/

inside the script i want to call '@account' sql script(if i give '@account' in sql promt,it will ask account number)

thanks in advance,
Re: How to call another sql script within the sql script [message #227499 is a reply to message #227497] Wed, 28 March 2007 07:20 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10672
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator

http://www.orafaq.com/forum/m/174015/42800/?srch=#msg_173971

PS:
Yours is not an sql script. It is pl/sql

[Updated on: Wed, 28 March 2007 07:20]

Report message to a moderator

Re: How to call another sql script within the sql script [message #227509 is a reply to message #227499] Wed, 28 March 2007 07:40 Go to previous messageGo to next message
lokeshg82
Messages: 23
Registered: February 2007
Location: chennai
Junior Member
hi,

im getting this error while try to open pl/sql file

SP2-0310: unable to open file "/account.sql"

actually inside the sql script im giving the code like this '@/accunt/account.sql'

pls guide me.
Re: How to call another sql script within the sql script [message #227512 is a reply to message #227509] Wed, 28 March 2007 07:47 Go to previous messageGo to next message
tahpush
Messages: 961
Registered: August 2006
Location: Stockholm/Sweden
Senior Member

And we start all over again http://www.orafaq.com/forum/t/77309/91729/

Good Luck Mahesh Smile
Re: How to call another sql script within the sql script [message #227522 is a reply to message #227512] Wed, 28 March 2007 08:15 Go to previous message
lokeshg82
Messages: 23
Registered: February 2007
Location: chennai
Junior Member
hi,

ya,ya,,im started again Razz

here i want to call an sql script within in the PL/SQL script.

see my code below,

vi myscript.sql
"myscript.sql" 23 lines, 730 characters
set serveroutput on
DECLARE
data varchar2(20);
variable1 NUMBER;
HandleN varchar(20);
BEGIN
data:='&1';
select BI_ACCOUNTID into variable1 from pb_bill_info where PBBTN=data;
do.pl('BI_ACCOUNTID');
do.pl('------------');
do.pl(variable1);
select pbhandlenamelower INTO HandleN from pb_handle where pbhandleid in(select max(pbhandleid)
from pb_handle where ha_customerentityid in (select acct_customerentityid from account
where acct_accountid =variable1)) AND pbmainhandleflag=1 ;
do.pl('==============================') ;
do.pl('Handle Name: ' || HandleN ) ;
do.pl('==============================') ;
@/handle/handle.sql
EXCEPTION
WHEN OTHERS THEN
do.pl('No rows selected');
END;

pls correct me where i made mistake.
Previous Topic: Please kindly help in decode count
Next Topic: working with delimited data in oracle
Goto Forum:
  


Current Time: Mon Dec 05 20:59:20 CST 2016

Total time taken to generate the page: 0.18864 seconds