select info
from system.help
where upper(topic)=upper('&1')
/
Back to top of file
-------------------------------------------------------------------------------How can one disable SQL*Plus prompting?
If you run a script that contains "&" symbols SQL*Plus thinks that you want to p
rompt the user for a value. To turn this off:
SET ESCAPE ON
SET ESCAPE "\"
SELECT 'You \& me' FROM DUAL;
or
SET DEFINE ?
SELECT 'You & me' FROM DUAL;
Note: You can disable substitution variable prompting altogether by issuing the
SET SCAN OFF commmand.
Back to top of file
-------------------------------------------------------------------------------How can I trap errors in SQL*Plus?
Use the "WHENEVER OSERROR ..." to trap operating system errors and the "WHENEVER
SQLERROR ..." command to trap SQL and PL/SQL errors. Eg:
SQL> WHENEVER OSERROR EXIT 9
SQL> WHENEVER SQLERROR EXIT SQL.SQLCODE
Back to top of file
-------------------------------------------------------------------------------How does one trace SQL statement execution?
Run the PLUSTRCE.SQL script from the SYS database user. This script is located t
he in $ORACLE_HOME/sqlplus/admin.
Create a PLAN_TABLE using the UTLXPLAN.SQL script. This script is in $ORACLE_HOM
E/rdbms/admin.
Use the "SET AUTOTRACE ON" command to trace SQL execution. This will print the r
esult of your query, an explain plan and high level trace information. Look at t
his example:
SQL> set autotrace on
SQL> select * from dual;
D
X
Execution Plan
---------------------------------------------------------0
SELECT STATEMENT Optimizer=CHOOSE
1
0 TABLE ACCESS (FULL) OF 'DUAL'
Statistics