batch mode separator

This is a discussion on batch mode separator within the MySQL Database forums, part of the Database Forums category; Hi, I know this has been asked many times before, but i havent seen it answered anywhere. i got software ...


Go Back   Usenet Forums > Database Forums > MySQL Database

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 07-06-2008
Jonathan Sion
 
Posts: n/a
Default batch mode separator

Hi,
I know this has been asked many times before, but i havent seen it
answered anywhere. i got software that generates sql scripts. in sql
server, you separate parts of the script with the GO keyword, which is
not really part of SQL and not supported here. how do i separate
between statements in mysql then? without proper separation the batch
will not run (i am simply pasting it to sqlyog and running it0

thanks!!
Reply With Quote
  #2 (permalink)  
Old 07-06-2008
Kees Nuyt
 
Posts: n/a
Default Re: batch mode separator

On Sun, 6 Jul 2008 10:58:53 -0700 (PDT), Jonathan Sion
<yoni@nobhillsoft.com> wrote:

>Hi,
>I know this has been asked many times before, but i havent seen it
>answered anywhere. i got software that generates sql scripts. in sql
>server, you separate parts of the script with the GO keyword, which is
>not really part of SQL and not supported here. how do i separate
>between statements in mysql then? without proper separation the batch
>will not run (i am simply pasting it to sqlyog and running it0
>
>thanks!!


GO (usually on a line on its own) is the same as ending
the last line of an SQL statement with a semicolon;

HTH

--
( Kees
)
c[_] Natives who beat drums to drive off evil spirits are
objects of scorn to smart Americans who blow horns to
break up traffic jams. (Mary Ellen Kelly) (#470)
Reply With Quote
  #3 (permalink)  
Old 07-07-2008
Willem Bogaerts
 
Posts: n/a
Default Re: batch mode separator

Jonathan Sion wrote:
> Hi,
> I know this has been asked many times before, but i havent seen it
> answered anywhere. i got software that generates sql scripts. in sql
> server, you separate parts of the script with the GO keyword, which is
> not really part of SQL and not supported here. how do i separate
> between statements in mysql then? without proper separation the batch
> will not run (i am simply pasting it to sqlyog and running it0
>
> thanks!!

Short question, long answer.

It depends on how you use your multi-statement script. Some ways of
passing SQL do not support multiple statements to be passed in one
string at all. Some do, but MySQL does not have the same notion of a
batch as SQL server. It does not really matter if you pass it in single
statements or in one batch. Specifically, all states and variables are
kept in a "connection" instead of a batch. So as long as you use the
same connection, you can query results, generated IDs etc. You can also
use this to separate things: You can do error logging (if you log to a
database) in a separate connection to prevent rollbacks rolling back the
error info as well.

For libraries that do support batches, you separate all the statements
with semicolons.

Best regatds,
--
Willem Bogaerts

Application smith
Kratz B.V.
http://www.kratz.nl/
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 05:59 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0