Running sql from dos
First of all, there can be problems if there are multiple tnsnames.ora files on a computer. The tnsping command can use one tnsnames.ora file while the sqlplus command can use another. This can cause a Service Name Not Provided error if one of the tnsnames.ora files is missing an entry.
Here is what I use:
sqlplus acpg/acpg@dev143 @c:\tempo.sql
From the SQL*PLUS
To run a command file as you start SQL*Plus, use one of the following four options:
Follow the SQLPLUS command with your username, a slash, your password, a space, @, and the name of the file:
SQLPLUS SCOTT/TIGER @SALES
SQL*Plus starts and runs the command file.
Follow the SQLPLUS command and your username with a space, @, and the name of the file:
SQLPLUS SCOTT @SALES
SQL*Plus prompts you for your password, starts, and runs the command file.
Include your username as the first line of the file. Follow the SQLPLUS command with @ and the filename. SQL*Plus prompts for your password, starts, and runs the file.
Include your username, a slash (/), and your password as the first line of the file. Follow the SQLPLUS command with @ and the filename. SQL*Plus starts and runs the file.
Here is what I use:
sqlplus acpg/acpg@dev143 @c:\tempo.sql
From the SQL*PLUS
To run a command file as you start SQL*Plus, use one of the following four options:
Follow the SQLPLUS command with your username, a slash, your password, a space, @, and the name of the file:
SQLPLUS SCOTT/TIGER @SALES
SQL*Plus starts and runs the command file.
Follow the SQLPLUS command and your username with a space, @, and the name of the file:
SQLPLUS SCOTT @SALES
SQL*Plus prompts you for your password, starts, and runs the command file.
Include your username as the first line of the file. Follow the SQLPLUS command with @ and the filename. SQL*Plus prompts for your password, starts, and runs the file.
Include your username, a slash (/), and your password as the first line of the file. Follow the SQLPLUS command with @ and the filename. SQL*Plus starts and runs the file.

0 Comments:
Post a Comment
<< Home