binding 64-bit integer - Mailing list pgsql-general

From flying2001us@yahoo.com
Subject binding 64-bit integer
Date
Msg-id 885053.75861.qm@web30009.mail.mud.yahoo.com
Whole thread Raw
Responses Re: binding 64-bit integer  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
Hi all,

I'm using Solaris 10 with 64-bit libpq library.

I wanted to bind a 64-bit integer, but it failed:
"ERROR:  incorrect binary data format in bind
parameter 1".

The code would succeed if the type of "val" is
uint32_t.

Doe anyone know how to fix this?  Thanks a lot!

-------------------------------------------------------------------------------------------------
uint64_t  val;
const char      *paramValues[1];
int  paramLengths[1];
int  paramFormats[1];
const char *sql_clause = "SELECT * FROM mytable  WHERE
mykey = $1";

paramValues[0] = (char *) &val;
paramLengths[0] = sizeof(val);
paramFormats[0] = 1;

res = PQexecParams(conn, sql_clause, 1, NULL,
          paramValues, paramLengths, paramFormats, 1);



__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

pgsql-general by date:

Previous
From: Brent Wood
Date:
Subject: Re: Postgres data/form entry tool
Next
From: "Martin Gainty"
Date:
Subject: Re: binding 64-bit integer