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?