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} ?
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.
> > 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--
> If you wanted lowercase names you'd use $sth->{NAME_lc}.
Any idea how many scripts I will have to change just because the customers
decided to switch database?
> (And if you wanted FetchHashKeyName to influence that
> you'd use $sth->{ $sth->{FetchHashKeyName} })
I want to be able to do this generically on login. My connect is centralized,
and I set the options for the database at this point. All scripts use this
centralized login method, so setting defaults like this is OK
> Tim.
--
H.Merijn Brand Amsterdam Perl Mongers (http://amsterdam.pm.org/)
using perl-5.6.1, 5.8.0 & 633 on HP-UX 10.20 & 11.00, AIX 4.2, AIX 4.3,
WinNT 4, Win2K pro & WinCE 2.11 often with Tk800.024 &/| DBD-Unify
ftp://ftp.funet.fi/pub/languages/perl/CPAN/authors/id/H/HM/HMBRAND/