Reputation: 169
I do a bulk insert.Is the below command correct??
sqlplus -U user_tr -P metro -S TUS234 -D TransportDB -SILENT -INPUTFILE rollout.txt -OUTPUTFILE sql.out
The input file cotains a bulk of insert statements.I want to execute those and the result must be in the output file.This was my attempt.
So far everything went well in the script,but I am unable to open the o/p file.
Error opening the o/p file
Is the command problem where the specification is wrong?
Upvotes: 0
Views: 1157
Reputation: 132580
I don't recognise the syntax you are using - see the SQL Plus docs. As far as I know there are no command line flags like -U, -P, -INPUT, -OUTPUT in SQL Plus.
You can start SQL Plus and run a script from the command line like this:
sqlplus -silent myusername/mypassword@mydatabase @myscript.txt
I think the syntax to write all output to a file is OS-dependent, but something like:
sqlplus -silent myusername/mypassword@mydatabase @myscript.txt > output.txt
Alternatively, you can add SQL Plus SPOOL commands inside the script.
Upvotes: 2