> Empty? I presume you mean undef, so
>
> return join '.', map { defined $_ ? qq{"$_"} : () } @_;
yes - didn't know you could do that - guessed it would return an undef
for that element rather than skip it.
> > This assumes that q{"} is the quotation mark and q{.} is used to join
> > identifiers, which is true for most systems but might not be. For
> > example Microsoft Access permits the use of [] to quote identifiers.
>
> But does it still allow standard double quotes?
Access does, but since ODBC has a GetInfo field for it I guess some
drivers rely on having the correct character. I guess things get more
restrictive if using ADO + OLEDB and ODBC isn't doing any intermediate
work for us.
> And I was just refering to the default implementation, drivers
> would be free to define their own.
So DBD's override the default method rather than setting the attribute -
sounds Ok.
> > The QuotedIdentifiers(boolean) attribute is required for the situation
> > where the database might have quoted identifiers switched off (as in
> > JDBC and MS-SQL) and could cause a sytax error.
>
> Is there an ODBC equivalent to that, or would ODBC just set
> SQL_IDENTIFIER_QUOTE_CHAR to blank in that case?
Don't know - I'll run some tests.
I suppose as long as the DBD knows that quoted identifiers are not in
use it would account for this in the overrided method.
> > The reason for IdentifierColumns is to allow the DBD or user the
> > override the default of columns 0,1,2 (catalog,schema,table) when
> > building the identifier.
>
> Is there an ODBC equivalent to that?
Doubt it.
Say I'm running Access and I want a list of tables (but not catalog
names) I need a nifty regexp to parse out the table name from the
quoted, dotted identifier returnd by $dbh->tables(). Instead I just set
IdentifierColumns = [2].
> > Finally, since identifiers like "myfile".""."mytable" are likely to
> > cause an error, I modifed tables() to omit undefined columns.
>
> I'd like to see documented somewhere what the correct syntax would
> be for a table with a catalog name but no schema name.
So would I. I can only speak from experience. The above example does
cause an error with MS-Access.
A few tests reveal:
Access returns only "catalog" and "table" via ODBC / ADO-ODBC
Access returns only "table" via ADO-OLEDB
MS-SQL Server returns all three
ASA returns only "schema" and "table" via ODBC / ADO-ODBC / ASAny
--
Simon Oliver