Tim Bunce wrote:

> On Wed, Oct 24, 2001 at 09:01:26AM +0100, Simon Oliver wrote:
> > Tim Bunce wrote:
> > > Yes, yes. I agree and I plan to add something along these lines very soon.
> > >
> > > (From your previous message you seemed to want to add *class* attributes
> > > and that's what would need a strong case as it doesn't fit with the DBI's
> > > approach to life.)
> >
> > I guess that's because I'm a little confused/ignorant of how attributes
> > are implemented in DBI.pm and the DBD's.
> >
> > This is something I've been after for some time.  If you show how to
> > implement the new attributes I will write a patch and accompanying
> > documentation.
>
> Thanks.
>
> There's probably no need for both attributes and a method call.
> Just a method call (that can be subclassed) should suffice.
>
> Something like
>
>         sub quote_identifier {
>             shift;
>             return join '.', map { qq{"$_"} } @_;
>         }
>
> would be enough to both quote single names and add dots for multiple names.
>
> Right?

Won't deal with:

CREATE TABLE """utter/beast"""."He said, ""What?""" ( ... )

This is valid SQL, unfortunately, if your database accepts delimited identifiers
in the first place.  SQL-92 mandates this.  Basically, just as you need
$dbh->quote to double up embedded quotes in parameter names, so you need to use
something rather similar to deal with the quote characters embedded inside the
name.  In the examples, the owner of the table is "utter/beast" (where the double
quotes are part of the owner name (schema name, whatever); the table name is 'He
said, "What?"' where the single quotes are not part of the name.

It is hairy dealing with such stuff...

--
Jonathan Leffler ([EMAIL PROTECTED], [EMAIL PROTECTED])
Guardian of DBD::Informix 1.00.PC1 -- see http://www.cpan.org/
#include <disclaimer.h>


Reply via email to