Received: from trends.net (root@clio.trends.ca [209.47.148.2]) by hub.org (8.9.3/8.9.3) with ESMTP id XAA01136 for ; Mon, 14 Jun 1999 23:53:17 -0400 (EDT) (envelope-from kvp@ocol.com) Received: from mail.ocol.com (qmailr@mail.ocol.com [204.244.123.209]) by trends.net (8.8.8/8.8.8) with SMTP id WAA13624 for ; Mon, 14 Jun 1999 22:53:31 -0400 (EDT) Received: (qmail 32576 invoked from network); 15 Jun 1999 03:10:41 -0000 Received: from fsj56-3.ocol.com (HELO ocol.com) (root@204.244.123.137) by mail.ocol.com with SMTP; 15 Jun 1999 03:10:41 -0000 Sender: root@trends.net Message-ID: <3765C0C7.C401342E@ocol.com> Date: Mon, 14 Jun 1999 19:56:07 -0700 From: Ken Plumbly Organization: Aurora Communications X-Mailer: Mozilla 4.51 [en] (X11; I; Linux 2.2.5-15 i586) X-Accept-Language: en MIME-Version: 1.0 To: pgsql-interfaces@hub.org Subject: order by in c (libpq)? Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by hub.org id XAA01146 Hi All, I am writing an app in c, everything works fine except for the order by in my query. I am sending the query thusly: sprintf(querystr, "select * from %s order by %s", table, field); However the query always comeback in the order in which the data was originally entered into the data base. The variable field does actually contain a valid field name, I have checked it. Any ideas???? Ken kvp@ocol.com