Re: [GENERAL] Problems with INSERT INTO?

From: Dustin Sallings <dustin(at)spy(dot)net>
To: Simon Drabble <simond(at)foxlink(dot)net>
Cc: Anna Langer <anna_langer(at)hotmail(dot)com>, pgsql-general(at)postgreSQL(dot)org
Subject: Re: [GENERAL] Problems with INSERT INTO?
Date: 1999-05-24 17:34:51
Message-ID: Pine.SGI.3.95.990524103209.1477A-100000@bleu.west.spy.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-interfaces

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(at)spy(dot)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. ____________

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Brett W. McCoy 1999-05-24 17:34:59 Re: [GENERAL] Full Text Searches
Previous Message Stuart Rison 1999-05-24 15:30:56 Re: [GENERAL] PL/pgSQL - mailng list

Browse pgsql-interfaces by date

  From Date Subject
Next Message Justin Long 1999-05-24 19:19:26 ODBC to access POSTGRESQL on LINUX - take 2
Previous Message Michael R. Anderson 1999-05-24 17:31:33 dynamic IPs