Hi Knarayan,
thanks for your assistance but it didn't work. My OS is HP and I used
kornshell script. It didn't work. It kept saying DEFINE and DECLARE not found.
Below is my kornshell script.

userid=apple
export i=1

$ORACLE_SQLPLUS -s $apple/$apple < set serverout on;

DEFINE loopcount = $i

declare
v_test number := &loopcount;
begin
dbms_output.put_line(v_test);
end;
/