On 2003-10-14 17:04:03 +0100, Gary Stainburn wrote:
> On Tuesday 14 Oct 2003 4:39 pm, Waldemar ??urowski wrote:
> > > my $sth=$dbh->prepare('select * from vins;') || die "cannot select:
[fails]
> > Remove ';' from your query and it should work fine.
> >
> > It seems it is a little bug in XBase, that it connect ';' character to
> > table name.
> 
> I've found that the semi-colon's okay left it provided I leave a space first, 
> which means I can still use the same syntax as with DBD::Pg

DBD::Pg shouldn't need a semicolon, either. $dbh->prepare expects a
single SQL-statement without any statement-separator (semicolon, slash,
or whatever). Some databases allow several statements and/or will ignore
a superfluous statement-separator at the end, but this is not portable.

Just omit the semicolon and it will work with any database.

        hp

-- 
   _  | Peter J. Holzer      | Wien ist gef�hrlich.
|_|_) | Sysadmin WSR / LUGA  | Weil hier lebende Menschen oft
| |   | [EMAIL PROTECTED]        | zu Wienern werden.
__/   | http://www.hjp.at/   |  -- Michael Frank

Attachment: pgp00000.pgp
Description: PGP signature

Reply via email to