ECHO

Core command

Prints a message, at the prompt or in a Script. The message is exactly one single-quoted string: '' prints an apostrophe, ${name} prints a SQL scripting variable's value, $${ prints ${. Never hidden by OUTPUT QUIET.

Arguments

'<message>' (mandatory) one single-quoted string

Examples

ECHO 'Loading customers';
ECHO 'Customer ${customer_id} has ${order_count} orders';
ECHO 'It''s done';
ECHO 'Write $${name} to use a variable';

Notes

Prints a message: ECHO '<message>', at the prompt or in a Script.

The message is exactly one single-quoted string. Inside it, '' prints one apostrophe, ${name} prints the value of a SQL scripting variable (NULL for a NULL value) and $${name} prints the text ${name} unchanged. Spaces, line breaks, ; and -- inside the quotes are printed as written. An undefined variable makes the statement fail and nothing is printed.

The quotes are required: without them, an apostrophe or -- in the text would change where the Script statement ends. ECHO output is never hidden by OUTPUT QUIET and is written to the activity log. Control characters coming from variable values are shown as ?. ECHO is the recommended way to print messages from a Script; PRINT is unchanged.

See Printing messages in the SQL scripting guide.

Last modified in release 5.3.3.