On Tue, 26 Oct 2004, Bob Showalter wrote:
> Chris Devers wrote:
> > On Tue, 26 Oct 2004, Murphy, Ged (Bolton) wrote:
> >
> > > Going back a few years here, but does an SQL statement not have to
> > > end in a semi-colon as above?
> >
> > I think it depends on your SQL interpreter.
> >
> > The MySQL command line interface `mysql` expect semi-colons, as does
> > the `psql` tool for PostgreSQL. I seem to remember that Oracle's
> > `sqlplus` did as well, but I'm not sure about other database engines.
>
> Not technically true, at least for psql and SQL*Plus. For instance, in psql
> you can run a query without using a semicolon:
>
> select * from foo
> \g
MySQL supports this as well:
mysql> show tables
-> \g
Empty set (0.00 sec)
Etc.
I didn't mean that the end-token was literally a part of the statement,
but it is the conventional way to end a statement.
I'm not nearly as familiar with psql & sqlplus as I am with mysql, so
I'm happy to be corrected there.
In any case, the more immediate question is how the database driver for
MySQL expects things in Perl/DBI scripts. And for that, as near as I can
tell, it doesn't really matter if the semicolons are present as long as
statements are being issued one at a time.
--
Chris Devers
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>