You can predefine variables using the iSQL*Plus DEFINE command.
DEFINE variable = value creates a user variable with the CHAR data type.
If you need to predefine a variable that includes spaces, you must enclose the value within single quotation marks when using the DEFINE command.
A defined variable is available for the session.
You can predefine user variables before executing a SELECT statement. iSQL*Plus provides the DEFINE command for defining and setting substitution variables:
SQL> define
DEFINE _SQLPLUS_RELEASE = "800060000" (CHAR)
DEFINE _EDITOR = "Notepad" (CHAR)
DEFINE _O_VERSION= "Oracle9i Enterprise Edition Release 9.2.0.1.0 – Production With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.1.0 - Production" (CHAR)
DEFINE _O_RELEASE = "902000100" (CHAR)
DEFINE _RC = "1" (CHAR)
SQL> define _RC
DEFINE _RC = "1" (CHAR)
SQL> DEFINE KUMAR=KD
SQL> DEFINE KUMAR
DEFINE KUMAR = "KD" (CHAR)
DEFINE variable = value creates a user variable with the CHAR data type.
If you need to predefine a variable that includes spaces, you must enclose the value within single quotation marks when using the DEFINE command.
A defined variable is available for the session.
You can predefine user variables before executing a SELECT statement. iSQL*Plus provides the DEFINE command for defining and setting substitution variables:
SQL> define
DEFINE _SQLPLUS_RELEASE = "800060000" (CHAR)
DEFINE _EDITOR = "Notepad" (CHAR)
DEFINE _O_VERSION= "Oracle9i Enterprise Edition Release 9.2.0.1.0 – Production With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.1.0 - Production" (CHAR)
DEFINE _O_RELEASE = "902000100" (CHAR)
DEFINE _RC = "1" (CHAR)
SQL> define _RC
DEFINE _RC = "1" (CHAR)
SQL> DEFINE KUMAR=KD
SQL> DEFINE KUMAR
DEFINE KUMAR = "KD" (CHAR)
A variable remains defined until you either:
- Use the UNDEFINE command to clear it
- Exit iSQL*Plus
No comments:
Post a Comment