Re: Some semicolon oddities
Date: Sat, 26 Sep 2015 09:53:31 +0200
Message-ID: <56064ef4$0$23820$e4fe514c_at_news.xs4all.nl>
On 25-09-15 22:05, Stefan Ram wrote:
> When one enters »USE« into the client, no semicolon is needed:
>
> USE S
>
> . But when the USE is preceded by other commands on the same
> line, it /does/ need a semicolon:
>
> DROP SCHEMA D; CREATE SCHEMA D; USE D;
>
> . I did not read this in the manual (is it in the manual at all?),
> but observed it from the behavior of the client.
>
> Now, one might say, »Ok, then I will /always/ add a semicolon,
> since I do not want to learn detailed rules about when it is
> needed.«, but sometimes a semicolon is not allowed as in
>
> SOURCE C:\example.txt
>
> , where a final semicolon would be treated as part of the
> filepath IIRC.
>
> So, when entering client commands, sometimes we must add a
> semicolon, sometimes we may not, and sometimes both choices
> are possible.
>
you need to type:
SOURCE C:\\example.txt
Because '\' is the escape character.....
mysql> source c:\temp\example.sql ;
Outfile disabled.
ERROR:
Unknown command '\e'.
ERROR:
Failed to open file 'c:emp\example.sql', error: 2
mysql>
mysql> source c:\\temp\\example.sql
+---------+------+------------+
| user_id | name | birth_date |
+---------+------+------------+
..........
Received on Sat Sep 26 2015 - 09:53:31 CEST