Oracle 5.0 Reference Manual page 216

Table of Contents

Advertisement

Here is a simple multiple-line statement:
mysql>
SELECT
->
USER()
->
,
->
CURRENT_DATE;
+---------------+--------------+
| USER()
| CURRENT_DATE |
+---------------+--------------+
| jon@localhost | 2005-07-11
+---------------+--------------+
In this example, notice how the prompt changes from
multiple-line query. This is how
waiting for the rest. The prompt is your friend, because it provides valuable feedback. If you use that
feedback, you can always be aware of what
If you decide you do not want to execute a command that you are in the process of entering, cancel it
by typing \c:
mysql>
SELECT
->
USER()
->
\c
mysql>
Here, too, notice the prompt. It switches back to
indicate that
is ready for a new command.
mysql
The following table shows each of the prompts you may see and summarizes what they mean about
the state that
is in.
mysql
Prompt
Meaning
Ready for new command.
mysql>
Waiting for next line of multiple-line command.
->
Waiting for next line, waiting for completion of a string that began with a single quote ("'").
'>
Waiting for next line, waiting for completion of a string that began with a double quote (""").
">
Waiting for next line, waiting for completion of an identifier that began with a backtick ("`").
`>
Waiting for next line, waiting for completion of a comment that began with /*.
/*>
In the MySQL 5.0 series, the
Multiple-line statements commonly occur by accident when you intend to issue a command on a single
line, but forget the terminating semicolon. In this case,
mysql>
SELECT USER()
->
If this happens to you (you think you've entered a statement but the only response is a
most likely
is waiting for the semicolon. If you don't notice what the prompt is telling you, you
mysql
might sit there for a while before realizing what you need to do. Enter a semicolon to complete the
statement, and
mysql
mysql>
SELECT USER()
->
;
+---------------+
| USER()
|
+---------------+
| jon@localhost |
+---------------+
The
and
prompts occur during string collection (another way of saying that MySQL is waiting for
'>
">
completion of a string). In MySQL, you can write strings surrounded by either "'" or """ characters (for
Entering Queries
|
indicates that it has not yet seen a complete statement and is
mysql
mysql
prompt was implemented in MySQL 5.0.6.
/*>
executes it:
196
to
after you enter the first line of a
mysql>
->
is waiting for.
after you type \c, providing feedback to
mysql>
waits for more input:
mysql
prompt),
->

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mysql 5.0

Table of Contents