Hello members,
I get an unexpected "end of file" error while trying to execute the following piece of code in the bash / ksh shell. I'm assuming the problem is with using the "execute immediate statement"
Code:
#! /bin/bash
tname="table"
for i in *
do
sqlstr="create table $tname$i as select account_no, balance from records_all"
sqlplus username/password@db_name<<EOF
execute immediate $sqlstr;
EOF
ksh Error:
+ tname=table
try.ksh[7]: syntax error at line 10 : `<<' unmatched
bash Error:
tname=table
try.sh: syntax error at line 15: `end of file' unexpected
Appreciate your guidance with the correct syntax.
kris