dbTalk Databases Forums  

Quit Doesn't Work

comp.databases.mysql comp.databases.mysql


Discuss Quit Doesn't Work in the comp.databases.mysql forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Joe Hesse
 
Posts: n/a

Default Quit Doesn't Work - 02-14-2011 , 07:47 AM






Hi,

If my SQL script file Test.sql contains the 3 lines:
SELECT * FROM Table1;
QUIT;
SELECT * FROM Table2;

and I run the script from a Mysql prompt like:
mysql> SOURCE Test.sql;

then the QUIT is treated as an error rather than a command.

Any suggestions?

Thanks,
Joe

Reply With Quote
  #2  
Old   
Luuk
 
Posts: n/a

Default Re: Quit Doesn't Work - 02-14-2011 , 08:08 AM






On 14-02-11 14:47, Joe Hesse wrote:
Quote:
Hi,

If my SQL script file Test.sql contains the 3 lines:
SELECT * FROM Table1;
QUIT;
SELECT * FROM Table2;

and I run the script from a Mysql prompt like:
mysql> SOURCE Test.sql;

then the QUIT is treated as an error rather than a command.

Any suggestions?

Thanks,
Joe

First, the semi-colon at the end of QUIT should be removed.
The semi-colon is only to end a SQL statement, and not an internal
statement for the client.

i.e. 'system echo TEST' will work, and do the system shell command 'echo
TEST'....


mysql <Test.sql
will end the client on the line containing the 'QUIT'


--
Luuk

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.