in reply to MySQL UPDATE in PERL

Also wondering if you got an unintended semicolon in there ???
<snippet> WHERE rs = $rs_number;"); ^^^ </snippet>
You got any error message checking going on?

Replies are listed 'Best First'.
Re: Re: MySQL UPDATE in PERL
by Cabrion (Friar) on Feb 25, 2003 at 03:24 UTC
    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!

      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