In a Multiple-line query, what is the significance of the change of MySQL prompt after the first line?

MySQLMySQLi Database

After writing the first line of multiple-line queries, MySQL changes promptly from ‘mysql>’ to ‘→’. It is significant because with the help of it we got an indication that MySQL has not seen a complete statement yet and is waiting for the rest. Consider the example below,

mysql> Select *
    -> from
    -> stock_item;

We know that after writing the first line i.e. ‘Select *’ Mysql changes its prompts which means that yet the state has not been completed. After the semicolon, MySQL considers the statement completed and throws the output.

raja
Published on 22-Feb-2018 05:29:51
Advertisements