Displays a message in interactive SQL.
1 – Environment
You can use the PRINT statement in interactive SQL.
2 – Format
(B)0[m[1;4mPRINT[m[1m qwqwq> <literal> qqwqqwqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqwqwqq> [m [1m x mq> <variable>[m [1mqj[m [1mmq> [1;4mAS[m[1m <name>[m [1mqwqqqqqqqqqqqqqqqqqqqqqqwj x[m [1m [m [1mx[m [1mmq> edit-using-clause qj[m [1mx[m [1m mqqqqqqqqqqqqqqqqqqqqqqqq , <qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj [m [1m [m [1m [m (B)0[m[1medit-using-clause = [m [1m [m [1mqq>[m [1;4mEDIT[m[1m [1;4mUSING[m[1m qwq> edit-string qqqwq> [m [1m [m [1m mq> <domain-name> qj [m
3 – Arguments
3.1 – AS name
Changes the name displayed in the print statement header. By default literal values have a blank header name and variables use their name as a header. If the header must include spaces or lowercase characters then use SET QUOTING RULES or SET DIALECT to enable delimited identifiers
3.2 – EDIT_USING
Syntax options: EDIT USING edit-string|EDIT USING domain-name Assigns an edit string for use when formatting the variable or literal value. If a domain name is specified then the EDIT STRING from the domain is used. This clause is only permitted for interactive SQL.
3.3 – literal
Specifies the values you want displayed to the user during execution of the command procedure. Enclose the character literals in single quotation marks.
3.4 – variable
Prints the contents of the specified variable.
4 – Examples
Example 1: Displaying a literal from a command procedure The following PRINT statement in a command procedure displays 'Creating trigger definitions for the database' during the execution of the command procedure: SQL> -- Trigger definition statements are next. SQL> PRINT 'Creating trigger definitions for the database'; SQL> CREATE TRIGGER EMPLOYEE_ID_CASCADE_DELETE . . . Example 2: Displaying a variable The following PRINT statement displays the definition of a variable: SQL> DECLARE :X CHAR(10); SQL> BEGIN cont> SET :X = 'Active'; cont> END; SQL> PRINT :X; X Active