Attribute Parameter Problem with bind_param( )

P

pnstarr

Hi everybody,

I've got a script that works perfectly when called from the command
prompt. It collects data from online databases, processes it, and
prints. I'm trying to use it in a web site, where the input is from an
html form. But not all the data I want is printed into the newly
created html page and the error log says that there is an attribute
parameter problem in one of the methods called in the script.

Here is the error from the error log:

[error] [client 127.0.0.1] DBI::st=HASH(0x89628a4)->bind_param(...):
attribute parameter '12' is not a hash ref at
/home/pns7/src/ensembl/modules//Bio/EnsEMBL/DBSQL/SliceAdaptor.pm line
246.

Here is the SliceAdaptor.pm code line:

246 $sth->bind_param(1, "$seq_region_name", SQL_VARCHAR);

And bind_param( ) evidently has the following definitions according to
O'Reilly's Programming the Perl DBI:
bind_param($p_num, $bind_value)
bind_param($p_num, $bind_value, \%attr)
bind_param($p_num, $bind_value, $bind_type)

SQL_VARCHAR does have the value '12' and is not a hash reference, but
why does this matter since SQL_VARCHAR is a bind_type variable?
Moreover, why does the method fail here but work when the script is run
from the command prompt?

Can somebody please help? Thanks,
Peter
 
P

Paul Lalli

I've got a script that works perfectly when called from the command
prompt. It collects data from online databases, processes it, and
prints. I'm trying to use it in a web site, where the input is from an
html form. But not all the data I want is printed into the newly
created html page and the error log says that there is an attribute
parameter problem in one of the methods called in the script.

Here is the error from the error log:

[error] [client 127.0.0.1] DBI::st=HASH(0x89628a4)->bind_param(...):
attribute parameter '12' is not a hash ref at
/home/pns7/src/ensembl/modules//Bio/EnsEMBL/DBSQL/SliceAdaptor.pm line
246.

Here is the SliceAdaptor.pm code line:

246 $sth->bind_param(1, "$seq_region_name", SQL_VARCHAR);

Please read:
perldoc -q quoting

And bind_param( ) evidently has the following definitions according to
O'Reilly's Programming the Perl DBI:
bind_param($p_num, $bind_value)
bind_param($p_num, $bind_value, \%attr)
bind_param($p_num, $bind_value, $bind_type)

SQL_VARCHAR does have the value '12' and is not a hash reference, but
why does this matter since SQL_VARCHAR is a bind_type variable?
Moreover, why does the method fail here but work when the script is run
from the command prompt?

How confident are you that your command-line and web environments are
identical? Try printing the value of $DBI::VERSION in your script, and
seeing if you get the same results in both environments. Then try
$DBD::Foo::VERSION (where 'Foo' is your driver module).

Out of curiousity, why are you providing that value to bind_param in
the first place? What benefit is it giving you?

Paul Lalli
 
X

xhoster

Hi everybody,

I've got a script that works perfectly when called from the command
prompt. It collects data from online databases, processes it, and
prints. I'm trying to use it in a web site, where the input is from an
html form. But not all the data I want is printed into the newly
created html page and the error log says that there is an attribute
parameter problem in one of the methods called in the script.

Here is the error from the error log:

[error] [client 127.0.0.1] DBI::st=HASH(0x89628a4)->bind_param(...):
attribute parameter '12' is not a hash ref at
/home/pns7/src/ensembl/modules//Bio/EnsEMBL/DBSQL/SliceAdaptor.pm line
246.

Here is the SliceAdaptor.pm code line:

246 $sth->bind_param(1, "$seq_region_name", SQL_VARCHAR);

And bind_param( ) evidently has the following definitions according to
O'Reilly's Programming the Perl DBI:
bind_param($p_num, $bind_value)
bind_param($p_num, $bind_value, \%attr)
bind_param($p_num, $bind_value, $bind_type)

SQL_VARCHAR does have the value '12' and is not a hash reference, but
why does this matter since SQL_VARCHAR is a bind_type variable?

What version of DBI are you using? Which DBD are you using? What version?
Moreover, why does the method fail here but work when the script is run
from the command prompt?

Are you using the same versions of everything (Perl, DBI, DBD) between
the two situations?

Xho
 
P

pnstarr

Much thanks. I'm using the same DBI version on both, 1.52. However, I
get an error when trying to print $DBD::Foo::VERSION. The error is "a
use of unitialized value in concatenation (.) or string. I've tried to
locate DBD::Foo in my directories and I can't. So I'm going to see if
I need to install the DBD::MySQL module. But I don't think I should
need to do that since the script already works when run from command
prompt.


Paul said:
I've got a script that works perfectly when called from the command
prompt. It collects data from online databases, processes it, and
prints. I'm trying to use it in a web site, where the input is from an
html form. But not all the data I want is printed into the newly
created html page and the error log says that there is an attribute
parameter problem in one of the methods called in the script.

Here is the error from the error log:

[error] [client 127.0.0.1] DBI::st=HASH(0x89628a4)->bind_param(...):
attribute parameter '12' is not a hash ref at
/home/pns7/src/ensembl/modules//Bio/EnsEMBL/DBSQL/SliceAdaptor.pm line
246.

Here is the SliceAdaptor.pm code line:

246 $sth->bind_param(1, "$seq_region_name", SQL_VARCHAR);

Please read:
perldoc -q quoting

And bind_param( ) evidently has the following definitions according to
O'Reilly's Programming the Perl DBI:
bind_param($p_num, $bind_value)
bind_param($p_num, $bind_value, \%attr)
bind_param($p_num, $bind_value, $bind_type)

SQL_VARCHAR does have the value '12' and is not a hash reference, but
why does this matter since SQL_VARCHAR is a bind_type variable?
Moreover, why does the method fail here but work when the script is run
from the command prompt?

How confident are you that your command-line and web environments are
identical? Try printing the value of $DBI::VERSION in your script, and
seeing if you get the same results in both environments. Then try
$DBD::Foo::VERSION (where 'Foo' is your driver module).

Out of curiousity, why are you providing that value to bind_param in
the first place? What benefit is it giving you?

Paul Lalli
 
P

pnstarr

Well, the bind_param( ) is being used in some BioPerl module. I didn't
write the code. I did try, however, to delete the data type variable,
but I got an even more inscrutable error message.
 
T

Tad McClellan

[ Please stop top-posting! ]


Much thanks. I'm using the same DBI version on both, 1.52. However, I
get an error when trying to print $DBD::Foo::VERSION.

Paul Lalli wrote:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 

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
473,774
Messages
2,569,599
Members
45,175
Latest member
Vinay Kumar_ Nevatia
Top