Re: [GENERAL] Using DEFAULT as a parameter value with PQexecPrepare()

2012-04-06 Thread Greg Sabino Mullane
-BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 > I simplified my example somewhat. I usually have six of > these "optional" parameters. The number of prepared statements > would be too many for this approach. > I will follow your advice in the cases where I just one or two > of the "optio

Re: [GENERAL] Using DEFAULT as a parameter value with PQexecPrepare()

2012-04-06 Thread EXT-Rothermel, Peter M
meter values. Thanks for the advice -Original Message- From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Greg Sabino Mullane Sent: Thursday, April 05, 2012 7:18 PM To: pgsql-general@postgresql.org Subject: Re: [GENERAL] Using DEFAULT as a para

Re: [GENERAL] Using DEFAULT as a parameter value with PQexecPrepare()

2012-04-05 Thread Greg Sabino Mullane
-BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 > I was looking for a to use a prepared statement for this operation. > > PREPARE myinsert AS "INSERT INTO t ( c1, c2, c3, c4, c5) VALUES ( $1, $2, > $3, $4, $5); > > Now I want to execute this prepared statement something like: > > EXECUTE m

[GENERAL] Using DEFAULT as a parameter value with PQexecPrepare()

2012-04-05 Thread EXT-Rothermel, Peter M
I am currently dynamically building a SQL command in my C code like that executes SQL statement like: INSERT INTO t (c1,c2,c3,c4,c5) VALUES ('abc', 1, DEFAULT, 9, 3); I execute the command using PQexec() of libpq. The application logic determines when to use the default values for several