DBI + mysql

R

Raffaello Galli

HI

I am using DBI and I tried the following code with Oracle and Mysql to
read query metadata:


$sth = $dbi->prepare($statement);
$sth->execute();
for ( $t=1; $t <= $sth->{NUM_OF_FIELDS} ; $t++ ) {
push( @H, $sth->{NAME}->[$t-1] );
}


but with Mysql $sth->{NAME} gives the following error message :

"Can't set DBI::st=HASH(0x81052a4)->{NAME}: unrecognised attribute or
invalid value"

Did someone face this problem before ? Did someone solve it ?

Raffaello
 
G

Glenn Jackman

Raffaello Galli said:
$sth = $dbi->prepare($statement);
$sth->execute();
for ( $t=1; $t <= $sth->{NUM_OF_FIELDS} ; $t++ ) {
push( @H, $sth->{NAME}->[$t-1] );
}

but with Mysql $sth->{NAME} gives the following error message :

"Can't set DBI::st=HASH(0x81052a4)->{NAME}: unrecognised attribute or
invalid value"

Did someone face this problem before ? Did someone solve it ?

I haven't seen your error, but this is simpler:
my @H = @{ $sth->{NAME} };
 

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

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top