in reply to Re: MySQL UPDATE in PERL
in thread MySQL UPDATE in PERL

That's quite legal. Most SQL implementations use the semi-colon to delimit multiple SQL statments on a single line. The following should work just fine on most SQL implementations.

$dbh->do('update bar set attr=val;delete from baz;');

They are also required when using most native user interfaces as those don't have a line-continuation character. Consider:

SELECT * FROM tab1, tab2 WHERE tab1.x = tab2.y ORDER BY tab1.x desc; <-- this tells the interface you're ready to pro +cess
That's alot nicer to read than one long sting. However, DBI's prepare adds the semi-colon if you don't.

Then you have those crazy Sybase folks that want you to type 'go' instead of a semi-colon. . . sheeesh! At least Microsoft did one thing right when they assimilated that code!

Replies are listed 'Best First'.
Re: Re: Re: MySQL UPDATE in PERL
by mpeppler (Vicar) on Mar 06, 2003 at 01:18 UTC
    Err - AFAIK the semicolon is NOT legal when sending a request via DBI. The semicolon (or "go", for Sybase isql users) is used in the interactive query tool to tell it that you're ready to send the SQL query that you just typed.

    Michael