Looks like you are doing at least two things wrong. (1) you are using
selectall_hashref wrong; see this doc snippet:
"selectall_hashref" NEW
$hash_ref = $dbh->selectall_hashref($statement, $key_field);
$hash_ref = $dbh->selectall_hashref($statement, $key_field, \%attr);
$hash_ref = $dbh->selectall_hashref($statement, $key_field, \%attr,
@bind_values);
This utility method combines the prepare, execute, and
fetchall_hashref entries elsewhere in this document into
a single call. It returns a reference to a hash
containing one entry for each row. The key for each row
entry is specified by $key_field. The value is a
reference to a hash returned by "fetchrow_hashref".
The "$statement" parameter can be a previously prepared
statement handle, in which case the "prepare" is
skipped. This is recommended if the statement is going
to be executed many times.
If any method except "fetchrow_hashref" fails, and the
RaiseError entry elsewhere in this document is not set,
"selectall_hashref" will return "undef". If
"fetchrow_hashref" fails and the RaiseError entry
elsewhere in this document is not set, then it will
return with whatever data it has fetched thus far.
$DBI::err should be checked to catch that.
You need at least two parameters to use selectall_hashref.
Second, selectall_hashref returns a hash ref but you deref it like an
array: @$hash_ref. There is a very serious logical flaw there.
On Wed, 9 Jan 2002, Rozengurtel, Daniel wrote:
> Hi All.
>
> Please people can you respond to my previous posting? Its a prod problem and
> i would really like to get going.
>
> Thanx a lot.
> Danny
>
>
> > -----Original Message-----
> > From: Rozengurtel, Daniel
> > Sent: Wednesday, January 09, 2002 9:52 AM
> > To: '[EMAIL PROTECTED]'
> > Cc: Rueth, Loretta F.
> > Subject: DBI Problem
> >
> > Hello friends,
> >
> > I have a problem with DBI.pm module running on Sun5.8. While using
> > selectall_hashref i get this strange error. I am 100% sure the table to
> > select from does exist. And that the same statement works on our dev
> > machine (which is Sun5.6) We also descovered that there is a diference in
> > Versions of DBI we are using. In production (the one that doesnt work:
> > DBI.pm,v 11.3 2001/08/24 23:33:40 timbo Exp) On the Development (the one
> > that works) --DBI.pm,v 10.34 2001/03/30 14:35:41 timbo Exp
> > Can anybody suggest what the problem is?
> > Thanx a lot people.
> >
> >
> > sub get_isid_fields{
> > my $statement="SELECT * from FT_T_ISID WHERE INSTR_ID='0001x660ng'";
> > my $hash_ref = $dbh->selectall_hashref($statement);
> > foreach my $rec(@$hash_ref)
> > {
> > print "$rec->{'INSTR_ID'} \n";
> > print "$rec->{'ID_CTXT_TYP'} \n";
> > }
> >
> > } #end sub
> >
> > ERROR:
> >
> > 2002:01:09 06:41:51 | LOG | Log File =>
> > /box/box408/rundir/logs/dan_test.pl.log.20020109.064151.18829
> > 2002:01:09 06:41:51 | INFO | Starting dan_test.pl
> > Use of uninitialized value in hash element at
> > /usr/local/lib/perl5/site_perl/5.6.1/sun4-solaris/DBI.pm line 1205.
> > Use of uninitialized value in concatenation (.) or string at
> > /usr/local/lib/perl5/site_perl/5.6.1/sun4-solaris/DBI.pm line 1208.
> > DBD::Oracle::db selectall_hashref failed: Field '' does not exist (not one
> > of ID_CTXT_TYP END_TMS ISS_ID LAST_CHG_USR_ID INST_MNEM FINSRL_TYP
> > INSTR_ID START_TMS LAST_CHG_TMS) at dan_test.pl line 44.
> > DBD::Oracle::db selectall_hashref failed: Field '' does not exist (not one
> > of ID_CTXT_TYP END_TMS ISS_ID LAST_CHG_USR_ID INST_MNEM FINSRL_TYP
> > INSTR_ID START_TMS LAST_CHG_TMS) at dan_test.pl line 44.
> >
> >
> _____________________________________________________________________
> IMPORTANT NOTICES:
> This message is intended only for the addressee. Please notify the
> sender by e-mail if you are not the intended recipient. If you are not the
> intended recipient, you may not copy, disclose, or distribute this message
> or its contents to any other person and any such actions may be unlawful.
>
> Banc of America Securities LLC("BAS") does not accept time
> sensitive, action-oriented messages or transaction orders, including orders
> to purchase or sell securities, via e-mail.
>
> BAS reserves the right to monitor and review the content of all
> messages sent to or from this e-mail address. Messages sent to or from this
> e-mail address may be stored on the BAS e-mail system.
>
>
>
- D
<[EMAIL PROTECTED]>