Skip site navigation (1) Skip section navigation (2)

Re: Question on libpq parameters

From: Owen Hartnett <owen(at)clipboardinc(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Question on libpq parameters
Date: 2008-11-30 04:53:59
Message-ID: p06240807c557cc58fe1a@[192.168.0.107] (view raw, whole thread or download thread mbox)
Thread:
Lists: pgsql-general
At 11:45 PM -0500 11/29/08, Tom Lane wrote:
>Owen Hartnett <owen(at)clipboardinc(dot)com> writes:
>>  The following libpq code chokes on me with invalid input to an
>>  integer parameter (state == PGRES_FATAL_ERR aPtr == "Error: Invalid
>>  Input syntax for integer """ .   It fails on the call to
>>  PQexecPrepared.  I suspect I'm not doing the parameters right.  Can
>>  anyone spot anything wrong?
>
>You can't just point to integers as if they were strings.  Didn't
>your compiler complain about that?
>
>			regards, tom lane

Yes, it did.  I'm confused.  My first parameter is a string, but the 
following two are integers.  I thought the paramType parameter 
indicated the type.  Do the integers need to be sprintf'd to strings? 
There's only one paramValues array and it's type is a const char * 
array.

-Owen

In response to

Responses

pgsql-general by date

Next:From: சிவகுமார் மாDate: 2008-11-30 09:19:18
Subject: Query too slow with "not in" condition
Previous:From: Tom LaneDate: 2008-11-30 04:45:08
Subject: Re: Question on libpq parameters

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group