Re: [GENERAL] Problems with INSERT INTO? - Mailing list pgsql-general

From Dustin Sallings
Subject Re: [GENERAL] Problems with INSERT INTO?
Date
Msg-id Pine.SGI.3.95.990524103209.1477A-100000@bleu.west.spy.net
Whole thread Raw
In response to Re: [GENERAL] Problems with INSERT INTO?  (Simon Drabble <simond@foxlink.net>)
List pgsql-general
On Mon, 24 May 1999, Simon Drabble wrote:

# char query[LOTS_OF_ROOM];
# sprintf(query, "INSERT INTO octects VALUES(%d)", a);
#
# PQexec(conn, query);

    snprintf would probably be a better choice.

# -or- download my libpq wrapper, which allows you to perform queries without
# using a temporary char array, in a manner similar to printf(). Available via
# anon ftp from
#
# brainkarma.dyndns.org/pub/dblib/

    I was about to suggest something like this be part of the core
library.  It makes a lot of sense, and that's what vsnprintf is for.  :)

--
SA, beyond.com           My girlfriend asked me which one I like better.
pub  1024/3CAE01D5 1994/11/03 Dustin Sallings <dustin@spy.net>
|    Key fingerprint =  87 02 57 08 02 D0 DA D6  C8 0F 3E 65 51 98 D8 BE
L_______________________ I hope the answer won't upset her. ____________


pgsql-general by date:

Previous
From:
Date:
Subject: Undeliverable Message
Next
From: Ari Halberstadt
Date:
Subject: pg_dump core dumps