On Mon, Mar 04, 2002 at 08:50:45AM -0800, Jeff Zucker wrote:
> Tim Bunce wrote:
> > 
> > On Sun, Mar 03, 2002 at 12:41:54PM -0800, Jeff Zucker wrote:
> > >
> > >  $dbh->do(q/ CREATE TABLE x ( OOg INT, "BOOg" CHAR ) /);
> > >
> > >  $sth=$dbh->prepare(q/ SELECT  boog  FROM x /); #4 NO SUCH COLUMN
> > >  $sth=$dbh->prepare(q/ SELECT  BOOg  FROM x /); #5 NO SUCH COLUMN
> > 
> >
> > I think maybe #5 would work for a system where
> >     SQL_IDENTIFIER_CASE = SQL_IC_MIXED
> > I'm not sure. And you could argue that #4 would work as well
> 
> Hmm, I just checked the SQL92 standard and if I'm reading it correctly
> the situation is ugly.  Section 5.2.13 appears to say that a regular
> identifier and a delimited identifier are equivalent if the *upper case*
> version of the regular identifier compares *in a case sensitive manor*
> to the delimited identifier.

Got a URL?

> So this would be the way it should work
> according to the standard
> 
>    $dbh->do(q/ CREATE TABLE x ( "BOOG" CHAR ) /);
>    $sth=$dbh->prepare(q/ SELECT  BooG  FROM x /);  # OK
>    $sth=$dbh->prepare(q/ SELECT  boog  FROM x /);  # OK
> 
>    $dbh->do(q/ CREATE TABLE x ( "BooG" CHAR ) /);
>    $sth=$dbh->prepare(q/ SELECT  BOOG  FROM x /);  # NO SUCH COLUMN
>    $sth=$dbh->prepare(q/ SELECT  BooG  FROM x /);  # NO SUCH COLUMN
>    $sth=$dbh->prepare(q/ SELECT  boog  FROM x /);  # NO SUCH COLUMN
> 
> That's a little too wierd for me.

That matches Oracle, ie SQL_IDENTIFIER_CASE = SQL_IC_UPPER.

> It would mean that only delimited
> identifiers that are all upper case can be compared to regular
> identifiers.  Unless it seems a gross violation, I think I will keep the
> behaviour that regular identifiers are never equivalent to delimited
> identifiers. -- if it's quoted then you must use quotes to refer to it.

That's a little too wierd for me :)

Why not go the SQL_IDENTIFIER_CASE = SQL_IC_MIXED route and say
that BooG == "BooG". That's fairly natural and obvious and I think
it would cause least problems in the long run. And wouldn't that
also suit DBD::CSV users?

Tim.

Reply via email to