in reply to Re: Re: DBI Long File names?
in thread DBI Long File names?

Placeholders and $dbi->quote don't work with table and field names. They only work for data elements.

For identifiers, each database has its own quoting mechanism. The ANSI standard is double quotes:

SELECT foo FROM "$bar"
SQL Server uses square brackets:
SELECT foo FROM [$bar]

New versions of DBI have the $dbi->quote_identifier method. It can be used the same as $dbi->quote

my $quoted_log = $dbi->quote_identifier($log) my $sql = "SELECT foo FROM $quoted_log";

This may be new enough that DBD::XBase does not support. Then you will have to find out what quoting mechanism it uses and use that.

Replies are listed 'Best First'.
Re: Re: Re: Re: DBI Long File names?
by talwyn (Monk) on Oct 02, 2003 at 15:07 UTC
    Thanks for the information. Unfortunately none of the methods of quoting worked for me. So ... I suppose this means that DBD::XBASE may be broken. I am going to go dive into that now and see if it has some weird quote mechanism or not.
Re: Re: Re: Re: DBI Long File names?
by talwyn (Monk) on Oct 06, 2003 at 18:52 UTC
    Neither quoting mechanism nor the quote_identifier method worked. I also attempted low-level access directly through ::XBase which resulted in an 'invalid argument' for long file names. Any one know of an alternative to DBD::XBASE or ::XBase to read/write .dbf files? Specifically Foxpro files?