prettify_message

NAME

prettify_message(): Outputs a prettified text message, one row per line in text

TYPE

Procedure

DESCRIPTION

This procedure returns a result set of a single column and of a dynamic number of rows, consisting of given text and titled by given header.

In essence, it breaks the given text to lines using the '\n' delimiter, and outputs each such line in its own row.

The help() system uses this routine internally.

SYNOPSIS

prettify_message(title TINYTEXT CHARSET utf8, msg MEDIUMTEXT CHARSET utf8)

Input:

  • title: header, displayed as name of column
  • msg: message to be displayed, possibly including line breaks (the '\n' character)

EXAMPLES

Prettify a message:

mysql> call prettify_message('success', 'Execution complete.\nPlease follow next instructions.\n\nThank you for testing!');
+----------------------------------+
| success                          |
+----------------------------------+
| Execution complete.              |
| Please follow next instructions. |
|                                  |
| Thank you for testing!           |
+----------------------------------+
4 rows in set (0.01 sec)

ENVIRONMENT

MySQL 5.1 or newer

SEE ALSO

get_num_tokens(), split_token(), tokenize()

AUTHOR

Shlomi Noach
 
common_schema documentation