Re: binding values to sql statement in DBI perl

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: Deepblues <deepblues(at)gmail(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: binding values to sql statement in DBI perl
Date: 2005-04-07 00:28:54
Message-ID: 20050407002854.GA57640@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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/

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Keith Worthington 2005-04-07 01:50:39 Re: JOIN on a lookup table
Previous Message Britt Davis 2005-04-06 22:02:01 windows tutorial