Oh I will have to type a lot now ...
Any way you have answered my questions many times so I will do it for you as a good friend.
I had an example which I did for my orgn. previously where I had to calculate incentive for each branches numbering from 400 and 450 and It included generating individual reports (branchwise seperate files creation) for each branch there it was not possible to take from to values from sqlscript itself. However you have to accept the values from sqlscript using &varname
Now I have a sqlscript as follows (mike.sql)
accept branch
spool &branch rem-- creates a file for branch
Select branch_cd, proposal_no, flat_rate*amount from
prop_mst where period >= <date> and period >= <date1>
and branch_cd = &branch;
spool off
exit
The above program you will have to call from a shell script
suppose mike.com (I will give raw format of script as I dont have it right now)
i = 400
while (i < 451) # Please use proper syntax as per unix
sqlplus -s @ /dpir/flt1/mike.sql i #may require username
i = i + 1
the above com file will pass value e.g. 400 to mike.sql and mike.sql will generate output file 400.lst
remember dont forget exit in sql you have come out of oracle for next value.
thus it will create 400 to 450 i.e. 50 o/p files which you can send to 50 states in US (I hope my count is correct there are 30 in India.)
I hope this will clarify certain things even though it may not be totally correct.
Amol
amolsonaikar@yahoo.com
[sig][/sig]