Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 10.0.1 » SQL Anywhere Server - SQL Reference » SQL Statements

PREPARE TO COMMIT statement Next Page

PRINT statement [T-SQL]


Use this statement to return a message to the client, or display a message in the message window of the database server.

Syntax

PRINT format-string [, arg-list ]

Remarks

The PRINT statement returns a message to the client window if you are connected from an Open Client application or jConnect application. If you are connected from an embedded SQL or ODBC application, the message is displayed on the Server Messages window.

The format string can contain placeholders for the arguments in the optional argument list. These placeholders are of the form %nn!, where nn is an integer between 1 and 20.

Permissions

None.

Side effects

None.

See also
Standards and compatibility
Example

The following statement displays a message:

PRINT 'Display this message';

The following statement illustrates the use of placeholders in the PRINT statement:

DECLARE @var1 INT, @var2 INT
SELECT @var1 = 3, @var2 = 5
PRINT 'Variable 1 = %1!, Variable 2 = %2!', @var1, @var2