Re: "no value found for parameter 1" error for query with no parameters - Mailing list pgsql-general

From Phil Endecott
Subject Re: "no value found for parameter 1" error for query with no parameters
Date
Msg-id 1171238467381@dmwebmail.belize.chezphil.org
Whole thread Raw
List pgsql-general
Peter Eisentraut wrote:
> Phil Endecott wrote:
>> I converted the first query like this:
>>
>>      create or replace temporary view u_messages as
>>        select * from messsages where owner=$1;
>
> What makes you think this should work?

Hi Peter, thanks for the quick reply.

Well this page:

     http://www.postgresql.org/docs/8.1/static/libpq-exec.html

starts by saying

     "the functions described here are used to perform SQL queries and commands"

and continues

     "PQexecParams is like PQexec but offers additional functionality"

I don't see any suggestion that there are only some commands that can
use PQexecParams while others are limited to using PQexec.

But rather than discus the documentation, can we first establish for
certain whether I may use $n in a create view command, or whether I
have to go back to converting from C types to strings and escaping
them?  It's a shame if I do have to do that, as changing over to binary
parameters had simplified a lot of my code.

Regards,

Phil.


(You are welcome to CC: me in any replies.)





pgsql-general by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: getting postgres to emulate mysql/sqlserver bit datatype
Next
From: Bill Moseley
Date:
Subject: Adjacency List or Nested Sets to model file system hierarchy?