On this page

ECHO

Core command

Prints a single-quoted message, with ${name} variable values.

Syntax

ECHO '<message>'

Arguments

ArgumentRequiredValuesDefault
'<message>'YesOne single-quoted string; '' is an apostrophe, ${name} a variable valueNone

Examples

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

Example session

LET country_code = 'FRA';
ECHO 'Starting country check';
ECHO 'Country ${country_code}; step 2 -- loading';
ECHO 'It''s done';
ECHO 'Write $${country_code} to use the variable';
Starting country check
Country FRA; step 2 -- loading
It's done
Write ${country_code} to use the variable
Illustrative output: the values come from the WORLD sample and the practice connections of the how-to on QA and production copies of WORLD, and the layout from this release; it was not captured from a BroadSQL run, and your timings will differ.

Details

The message

The message is exactly one single-quoted string, at the prompt or in a Script. Inside it:

  • '' prints one apostrophe;
  • ${name} prints the value of a scripting variable (NULL for a NULL value);
  • $${name} prints the text ${name} unchanged;
  • spaces, line breaks, ; and -- are printed as written.

An undefined variable makes the statement fail, and nothing is printed. Control characters coming from variable values are shown as ?.

Why the quotes

The quotes are required: without them, an apostrophe or -- in the text would change where the Script statement ends.

Output

ECHO output is never hidden by OUTPUT QUIET and is written to the activity log. It is the recommended way to print messages from a Script; PRINT is unchanged.

Used in these how-tos

Last modified in release 5.5.0.

Found something wrong or unclear on this page? , with the page address.