Re: binding values to sql statement in DBI perl - Mailing list pgsql-novice

From Michael Fuhr
Subject Re: binding values to sql statement in DBI perl
Date
Msg-id 20050407002854.GA57640@winnie.fuhr.org
Whole thread Raw
In response to binding values to sql statement in DBI perl  (Deepblues <deepblues@gmail.com>)
Responses Re: binding values to sql statement in DBI perl  (Deepblues <deepblues@gmail.com>)
List pgsql-novice
On Wed, Apr 06, 2005 at 11:42:55AM -0500, Deepblues wrote:
>
> I am having trouble with binding values to SQL statements using dbi perl.
>
> The scenerio is as follows :
>
> I have a scheduling database that holds the listings of classes and
> there schedules for a university. I am trying to query the database to
> display the listings of classes , sections for  a particular semester
> that the user enters.
> I am able to get the results with the actual value but then when I use
> the variable which holds the values of the semester the user entered
> and try querying , it displays an error message saying
>
> "unbound place holder "

Could you post a small but complete program that exhibits the
problem?  Without seeing your code we can only guess what might be
wrong.  Also, please post the complete, exact text of the error
message (copied and pasted, not typed manually).

I suspect the real error is something like the following:

DBD::Pg::st execute failed: execute called with an unbound placeholder at ./foo line 14.

If that's the case, then you might have called $sth->execute() with
no arguments when you should have called it with arguments, e.g.,
$sth->execute($variable).  But that's just a guess; without seeing
your code we can't be sure.

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/

pgsql-novice by date:

Previous
From: "Keith Worthington"
Date:
Subject: JOIN on a lookup table
Next
From: Keith Worthington
Date:
Subject: Re: JOIN on a lookup table