On Fri, Sep 05, 2003 at 05:22:48PM -0500, phani wrote:
> Hi
> 
> I want to use the prepare statement with a placeholder in the LIMIT clause 
> like this
> 
> $sth = $dbh->prepare("select col1,col2 from tablename limit ?");
> $sth->param_bind(1,$i,{TYPE => 'SQL_NUMERIC' });
> $sth->execute();

SQL_NUMERIC should not be in quotes, and add "use DBI qw(:sql_types); use strict;"

Maybe also the driver doesn't recognise SQL_NUMERIC for this purpose
(which would be a bug) so try SQL_INTEGER etc.

Finally, you can drop the { TYPE => ... } by using the shorthand form:

  $sth->bind_param(1, $i, SQL_INTEGER);

Tim.

> I get an error message saying that "you have an error at limit '0' ...."
> The value I'am passing to the place holder is binded as character embedded in 
> single quotes.
> how can I make the value passed to the place holder remain as numeric,without 
> any quotes.
> 
> thanx
> phani
> 
> 

Reply via email to