#!/usr/bin/ksh
echo "create table temp_a" > emptab.sql
echo "(" >> emptab.sql
echo "subscriber_no int" >> emptab.sql
echo ");" >> emptab.sql #no commit
echo "/" >> emptab.sql #add /
sqlplus -s user/passC@db << eof
@emptab.sql
exit
eof
why table is not created using SQLLDR in shell script?
-
02-10-2022 - |
Question
Below is the script I use:a
#!/usr/bin/ksh
echo "create table temp_a" > emptab.sql
echo "(" >> emptab.sql
echo "subscriber_no int" >> emptab.sql
echo "); commit" >> emptab.sql
sqlplus -s user/passC@db << eof
@emptab.sql
exit
eof
After executing this script I don't get any printing or error. After executing the script I check if table exists by using for example "select * from temp_a", but I get an exception that table does not exist.
Please advise what is the error in my script.
Thanks in advance
Solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow