SQL Plus: Difference between revisions

Content deleted Content added
m Command types: <source lang="psql">
Line 150:
SQL*Plus-internal variables, accessible within an SQL*Plus session, include:
 
* user variables, displayable with the <code>DEFINE</code> command and referenceable with one or two cases of a prefixed character (default prefixes: '&' and '&&'). TheseOracle variablesCorporation arecalls calledthese variables "substitution variables". andProgrammers can beuse usedthem anywhere in a SQL or PL /SQL statement or in SQL *Plus commands. They can be populated by a literal using <code>DEFINE</code> or from the database using the <code>column</code> command.
** predefined variables, prefixed with an underscore ('_')<ref>
{{cite book
Line 230:
}}
</ref>
 
=== Error trapping ===
The <code>WHENEVER</code> command specifies an action to perform in the event of the system detecting an SQL error<ref>
{{cite web
| url = https://docs.oracle.com/cd/B19306_01/server.102/b14357/ch12052.htm
| title = SQL*Plus User's Guide and Reference
| last1 = Watt
| first1 = Simon
| website = Oracle Help Center
| series = Oracle Database Online Documentation, 10g Release 2 (10.2) / Administration
| publisher = Oracle
| page = 74
| access-date = 2015-11-04
| quote = WHENEVER SQLERROR [...] [d]irects SQL*Plus to perform the specified action as soon as it detects a SQL command or PL/SQL block error (but after printing the error message).
}}
</ref>
or an operating-system error<ref>
{{cite web
| url = https://docs.oracle.com/cd/B19306_01/server.102/b14357/ch12051.htm
| title = SQL*Plus User's Guide and Reference
| last1 = Watt
| first1 = Simon
| website = Oracle Help Center
| series = Oracle Database Online Documentation, 10g Release 2 (10.2) / Administration
| publisher = Oracle
| page = 73
| access-date = 2015-11-04
| quote = WHENEVER OSERROR [...] [d]irects SQL*Plus to perform the specified action as soon as an operating system error is detected.
}}
</ref>
while running a subsequent SQL*Plus command.
 
== Supplementary software ==