Thanks for the follow up.
The loop is for Periods 1-12, I simply want to run the same script 12 times for different periods of the month. The periods were originally formatted in 01,02, etc.
The password 'userpass' was just an easier place to enter the credentials from our TEST and PROD environments, I could have placed on the sqlplus line as easy.
Since the sql generates a large file, 10gig I didn't want to look at the spooling of data on the terminal and the only way to stop the output was passing in the file sqlcode.sql
for i in `seq 1 12`;
sqlplus table1/$userpass@Mytable <<EOF
same error... sorry I originally pulled out the path info in the script... there are 13 lines of code.
/test.sh: line 14: syntax error: unexpected end of file