Win32::OCBC problem

R

Regent

Hi, friends

I'm getting lots of "Use of uninitialized value in array element at C:/Perl/lib/Win32/ODBC.pm line 256."
It seems that each matching row in the database returns this line.

Here's how I typically use Win32::ODBC

#!C:/Perl/bin/Perl -wT
use strict;

# <snip>

my $myDb= new Win32::ODBC("$DSN");
if (! $myDb)
{
print STDERR "error connecting to $DSN";
Win32::ODBC::DumpError();
die;
}
else
{
$myDb->Sql("SELECT * FROM courses WHERE coursename = '$query'");
my (@fields) = $myDb->FieldNames();

while ($myDb->FetchRow())
{
my (%values) = $myDb->DataHash();
print $values{'coursename'};
}
$myDb->Close();
}


Thanks for any help!
Regent
(e-mail address removed)
 
M

Matt Garrish

Regent said:
Hi, friends

I'm getting lots of "Use of uninitialized value in array element at
C:/Perl/lib/Win32/ODBC.pm line 256."
It seems that each matching row in the database returns this line.

Use DBI::ODBC. Upgrade your Win32::ODBC module. I'm not sure what answer
you're looking for? It's just a warning that an uninitialized variable is
being used at that spot. My guess would be that you're retrieving null
values and that's what causes the warning in the module, but that's only a
guess (I have no idea what version of Win32::ODBC you're using, nor would I
be inclined to check if I'm right were you to tell me... : )

Matt
 
R

Regent

------------------------
C:/Perl/lib/Win32/ODBC.pm line 256."

Use DBI::ODBC. Upgrade your Win32::ODBC module. I'm not sure what answer

I'm using the latest version of Win32::ODBC (970228).
you're looking for? It's just a warning that an uninitialized variable is
being used at that spot. My guess would be that you're retrieving null

Earlier I suspected that the error msg could be caused by null values, so I stuffed all rows, but the msgs are still there :-(
values and that's what causes the warning in the module, but that's only a
guess (I have no idea what version of Win32::ODBC you're using, nor would I
be inclined to check if I'm right were you to tell me... : )

Well thanks anyway :)
 
M

Matt Garrish

Regent said:
Earlier I suspected that the error msg could be caused by null values, so
I stuffed all rows, but the msgs are still there :-(
I can't reproduce your problem using the code you provided. The only time I
get the warning is if I try and print a null value from the database. Are
you sure that the warning in the ODBC module is coming from that section of
your code?

Matt
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,142
Latest member
DewittMill
Top