문제

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

도움이 되었습니까?

해결책

 #!/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
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top