denzil_cactus has asked for the wisdom of the Perl Monks concerning the following question:

Hello Monks!
I am getting this kind of problem while working with oracle database
my select query is
select distinct top_no from top WHERE rownum < 5 $sth = $oDbh->prepare($query); $sth->execute(); while ( my $rowUpper = $sth->fetchrow_hashref) { my $query = "select file.* where top_no = '". $rowUpper->{top_no}."'" +; <> Here its not working since it is printing TOP_NO i.e. in caps } Printed with the Data::Dumper and it is printing this $VAR1 = [ { 'TOP_NO' => '072B03' } ];
so my question is why it is happenning even though I am using the field in small
(May be its because of Oracle's internal structure)
Please advise how can I fix it? I need to have in small caps only
  • Comment on Field name appearing in caps which falis other query(Perl with Oracle)
  • Download Code

Replies are listed 'Best First'.
Re: Field name appearing in caps which falis other query(Perl with Oracle)
by lamp (Chaplain) on Mar 24, 2009 at 07:00 UTC
    Set the DBI attribute 'FetchHashKeyName' to 'NAME_lc' for getting the field name in lower case. For eg:
    #For getting the lower case $dbh->{FetchHashKeyName} = 'NAME_lc';

    #For getting the upper case $dbh->{FetchHashKeyName} = 'NAME_uc';
    For more information, please go through FetchHashKeyName
Re: Field name appearing in caps which falis other query(Perl with Oracle)
by holli (Abbot) on Mar 24, 2009 at 07:04 UTC
    try
    $sth->fetchrow_hashref('NAME_lc');


    holli

    When you're up to your ass in alligators, it's difficult to remember that your original purpose was to drain the swamp.
      Thanks lamp and holli it Works now