On Fri, Jan 16, 2004 at 01:47:19PM +0100, H.Merijn Brand wrote:
> On Fri 16 Jan 2004 13:05, Tim Bunce <[EMAIL PROTECTED]> wrote:
> > On Fri, Jan 16, 2004 at 12:35:18PM +0100, H.Merijn Brand wrote:
> > > I don't know if this is DBI or DBD::Oracle's fault, but it is _very_ annoying!
> > >
> > > Given that I have to write perl scripts that work on different type of
> > > databases, and that we chose to only use lowercase table and field names, and
> > > given the fact the Oracle is so stupid to return uppercase everywhere, I
> > > thankfully use the FetchHashKeyName => "NAME_lc" attribute
> >
> > FetchHashKeyName
> > ^^^^^^^^^ - it only affects fetching hashes (e.g. fetchrow_hashref).
>
> Could that be extended to *every* {NAME} ?
No. Sorry. Even if I liked the idea all drivers would have to be changed.
> I've got an awful lot of scripts already that _used_to_ work on `normal'
> databases, and I somehow hoped that with the introduction of NAME_lc and
> NAME_uc and FetchHachKeyName NAME would just be aliased to whatever you put
> there.
Nope. You might not agree right now but it doesn't seem too hard
to search and replace {NAME} with {NAME_xx}. Even in a lot of scripts.
> > > my @name = @{$sth->{NAME}};
> >
> > > lep a5:/tmp 119 > perl dbi.pl
> > > NAME: PARM C_USR WAARDE OMSCHR
> > >
> > > D'uh!!!!!
> > >
> > > Do you understand why I *hate* Oracle?
> >
> > You asked for $sth->{NAME} so you got what Oracle returned.
>
> Which is wrong to start with. I created the table with lower case letters and
> I want to keep it that way, but that is not your fault. Oracle--
Oracle is following the international standards. If you want lowercase
names you could put double quotes around the names when you create them.
(Though you'll probably find that causes problems elsewhere.)
Tim.