Search Postgresql Archives

Re: "no value found for parameter 1" error for query with no parameters

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.)






[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux