-
I don't think you need the & in the line below.
v_test NUMBER := &loopcount;
-
The will work. I have tested it
$cat myscript.sql
SET SERVEROUTPUT on
DEFINE loopcount = &1
DECLARE
v_test NUMBER := &loopcount;
BEGIN
DBMS_OUTPUT.PUT_LINE(v_test);
END;
Sanjay
Originally posted by alenz
Originally posted by Trina
Hi Alenz,
I want to thank you for your help. I tried your method and I'm not sure if I did it
correctly. It didn't work. My sql scripts are below. It didn't recognize the $.
ksh script:
i=1
sqlplus -s @myscript.sql $i
sql script:
SET SERVEROUTPUT on
DEFINE loopcount = $i
DECLARE
v_test NUMBER := &loopcount;
BEGIN
DBMS_OUTPUT.PUT_LINE(v_test);
END;
/
change
DEFINE loopcount = $i
to
DEFINE loopcount = &1
does this work?
OCP 8i
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|