SPUG:using DBI::fetchrow_array(); to load another array

Marc M. Adkins Marc.M.Adkins at Doorways.org
Mon Feb 10 16:06:58 CST 2003


Surprise, surprise.  Now why didn't I know this?  It's there plain as day in
the doc (which maybe I should have read or something).  So it's PostgreSQL,
not the DBI driver that is the culprit.

It turns out to be:

	UPDATE "my_table" SET "a" = 5;

per the PostgreSQL manual.  Not that I would ever do that...way too much
trouble...in the future I'll just use lower-case names like the manual
suggests.

And as I remember, in Microsoft Access it's:

	UPDATE [my_Table] SET [Alpha] = 5;

or something like that.  Though I'm probably wrong there as well.

Oh, the horror!  And SQL is like a standard, isn't it?  ;)

mma

> -----Original Message-----
> From: Peter Darley [mailto:pdarley at kinesis-cem.com]
> Sent: Monday, February 10, 2003 12:01 PM
> To: Marc.M.Adkins at Doorways.org
> Subject: RE: SPUG:using DBI::fetchrow_array(); to load another array
>
>
> Marc,
> 	I was under the impression that PostgreSQL just used lower
> case field names
> unless they were quoted.  I think that if you had a field name that was
> defined as 'UPPER' (as apposed to UPPER) it would be UPPER when returned
> from DBI.
> Thanks,
> Peter Darley
>
> -----Original Message-----
> From: spug-list-admin at mail.pm.org [mailto:spug-list-admin at mail.pm.org]On
> Behalf Of Marc M. Adkins
> Sent: Monday, February 10, 2003 11:58 AM
> To: spug-list at mail.pm.org
> Subject: RE: SPUG:using DBI::fetchrow_array(); to load another array
>
>
> > One note I'd add to this:
> >
> > The hash keys are case sensitive, so you have to pay attention to the
> > case of the field labels ... or do a 'select Blah as blah' in your
> > query.  This has tripped me up a couple times where one field name was
> > all caps when the rest of the table's fields were lower.
>
> This is particularly important with PostgreSQL.  The current pgSQL DBI
> driver (or the database itself, but I think it's the driver) forgets the
> case of the column names.  They all come back lowercase, which means you
> must either use lowercase when designing your database or handle the
> translation everywhere in your code.
>
> mma
>
> _____________________________________________________________
> Seattle Perl Users Group Mailing List
> POST TO: spug-list at mail.pm.org
> ACCOUNT CONFIG: http://mail.pm.org/mailman/listinfo/spug-list
> MEETINGS: 3rd Tuesdays, U-District, Seattle WA
> WEB PAGE: www.seattleperl.org
>
>
>




More information about the spug-list mailing list