I don't think you need the & in the line below.
v_test NUMBER := &loopcount;
Printable View
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
Quote:
Originally posted by alenz
Quote:
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?