Answer the question
In order to leave comments, you need to log in
Correct batch file configuration?
Good day!
In the process of "playing" with the database, you often have to restore the contents. To do this, I created two sql scripts - for creating tables and filling.
Therefore, there is a need to create a batch file that simplifies the work. You must enter a sequence of commands:
1. sqlplus login/password
2. @.\db_create.sql
3. @.\db_insert.sql
4. exit
So far, only the first two commands have been combined. The rest are either ignored or "forgotten".
There is an option to combine the contents of both scripts in one file and finally add exit, but this is somehow not entirely aesthetically pleasing, and besides, it will not hurt to find out such subtleties once again.
Thank you in advance for your response.
Answer the question
In order to leave comments, you need to log in
can sqlplus read stdin correctly? echo db_create.sql | sqlplus login/password
or sqlplus login/password < commands.txt where commands.txt are lines 2..4
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question