Library /sys$common/syshlp/SQL$HELP72.HLB  —  PRINT
    Displays a message in interactive SQL.

1  –  Environment

    You can use the PRINT statement in interactive SQL.

2  –  Format

  (B)0PRINT qwqwq> <literal> qqwqqwqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqwqwqq>  
         x mq> <variable> qj  mq> AS <name> qwqqqqqqqqqqqqqqqqqqqqqqwj x     
         x                                   mq> edit-using-clause qj  x
         mqqqqqqqqqqqqqqqqqqqqqqqq , <qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj    
                                                            

  (B)0edit-using-clause =                  
                                       
  qq> EDIT USING qwq> edit-string qqqwq>   
                  mq> <domain-name> qj     

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
Close Help