Re: Some semicolon oddities

From: Jerry Stuckle <jstucklex_at_attglobal.net>
Date: Sat, 26 Sep 2015 09:17:34 -0400
Message-ID: <mu65pk$1q3$1_at_dont-email.me>


On 9/26/2015 3:53 AM, Luuk wrote:
> 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.....
>
>

Or just use '/' instead. Works in both Windows and Linux.

mysql> source c:/temp/example.sql
+---------+------+------------+
| user_id | name | birth_date |
+---------+------+------------+

<snip>

-- 
==================
Remove the "x" from my email address
Jerry Stuckle
jstucklex_at_attglobal.net
==================
Received on Sat Sep 26 2015 - 15:17:34 CEST

Original text of this message