

On UNIX operating systems, it is set to the value of the UNIX environment variable, EDITOR, if it exists, otherwise it is set to Ed.
#DEFINE DATUM WINDOWS#
Specifies the default editor used by the EDIT command.ĭuring SQL*Plus installation on Windows operating systems, it is set to Notepad. _DATE enables time values to be included in your SQL*Plus prompt. You can re-enable the default dynamic date behavior with: The _DATE value can be UNDEFINED, or set to a fixed string with an explicit DEFINE _DATE. This is especially true when the current date format contains a "seconds" component.Ī DEFINE (with no arguments) or dereference using &_DATE will give the current date. Users using _DATE in TTITLEs will almost certainly want to use an ampersand: &_DATE, so that each page of the report has exactly the same timestamp. For long reports with _DATE in the TTITLE or with multiple references to &_DATE, different times may be displayed for each occurrence of the variable. If it is used without an ampersand prefix, it will be re-evaluated for each page. If it is used with an ampersand than the value will be set to the time when the TTITLE command is executed. If _DATE is dynamic and is used in TTITLE it will have all the normal variable semantics. The current date is the default and is formatted using the value of NLS_DATE_FORMAT.īecause _DATE can be used as a normal substitution variable, users may put it in TTITLE. Privilege level of the current connection.įull release number of installed SQL*Plus component.Ĭontains the connection identifier as supplied by the user to make a connection where it is available.Ĭontains either the current date as a dynamic variable, or a fixed string. Specifies the editor used by the EDIT command.Ĭurrent version of the installed Oracle Database.įull release number of the installed Oracle Database.

Table 12-3 Variables Predefined at SQL*Plus Installation Variable NameĬonnection identifier used to make connection, where available.Ĭurrent date, or a user defined fixed string. To list the definition of DEPARTMENT_ID, enter To assign the CHAR value 20 to the variable DEPARTMENT_ID, type:Įven though you enter the number 20, SQL*Plus assigns a CHAR value to DEPARTMENT_ID consisting of two characters, 2 and 0. If you execute a command containing a reference to &POS, SQL*Plus substitutes the value MANAGER for &POS and will not prompt you for a POS value. To assign the value MANAGER to the variable POS, type:

Some variables are predefined when SQL*Plus starts.

If a value supplied for a defined variable matches a variable name, then the contents of the matching variable are used instead of the supplied value. You should avoid defining variables with names that may be identical to values that you will pass to them, as unexpected results can occur. If the value of a defined variable extends over multiple lines (using the SQL*Plus command continuation character), SQL*Plus replaces each continuation character and carriage return with a space. SQL*Plus will not prompt you for the value of variable in this session until you UNDEFINE variable. Whenever you run a stored query or script, SQL*Plus substitutes the value of variable for each substitution variable referencing variable (in the form & variable or & variable). Reference the variable in the NEW_VALUE or OLD_VALUE clause of a COLUMN command and then reference the column in a SELECT command Enter DEFINE with no clauses to list the values and types of all substitution variables.ĭefined variables retain their values until you:Įnter a new DEFINE command referencing the variableĮnter an UNDEFINE command referencing the variableĮnter an ACCEPT command referencing the variable Enclose text in single quotes if it contains punctuation or blanks.ĭefines (names) a substitution variable and assigns it a CHAR value.Įnter DEFINE followed by variable to list the value and type of variable. Represents the CHAR value you wish to assign to variable. Represents the user or predefined variable whose value you wish to assign or list. Specifies a user or predefined variable and assigns a CHAR value to it, or lists the value and variable type of a single variable or all variables.
