Received: from smtp-relay.noc.dsvr.net (smtp-relay.noc.dsvr.net [212.69.192.4]) by postgresql.org (8.11.3/8.11.4) with ESMTP id g14LVml34630 for ; Mon, 4 Feb 2002 16:31:49 -0500 (EST) (envelope-from me@shanewright.co.uk) Received: from [212.69.206.2] (helo=fullerruss.dsvr.co.uk) by smtp-relay.noc.dsvr.net with esmtp (Exim 3.16 #1) id 16XqiL-000Mdt-00 for pgsql-php@postgresql.org; Mon, 04 Feb 2002 21:31:49 +0000 Received: from there (fuller-230.adsl.newnet.co.uk [213.131.184.230]) by fullerruss.dsvr.co.uk (8.11.3/8.11.1) with SMTP id g14LVmJ22309 for ; Mon, 4 Feb 2002 21:31:48 GMT Message-Id: <200202042131.g14LVmJ22309@fullerruss.dsvr.co.uk> Content-Type: text/plain; charset="iso-8859-1" From: Shane Wright Reply-To: me@shanewright.co.uk To: pgsql-php@postgresql.org Subject: Re: constants Date: Mon, 4 Feb 2002 21:31:26 +0000 X-Mailer: KMail [version 1.3.2] References: In-Reply-To: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Archive-Number: 200202/18 X-Sequence-Number: 924 Thanks but I know how to do it in PHP - the problem is that I want to do it straight in SQL to avoid inserting my PHP constants into my SQL queries. -- Shane On Monday 04 Feb 2002 7:48 pm, Chadwick Rolfs wrote: > There is a define: > > define("MYCONST", "4"); > > read here... > http://www.php.net/manual/en/language.constants.php > > and here... > http://www.php.net/manual/en/function.define.php > > and anywhere else I might have missed. I haven't used postgresql to > define constants, yet, but I do believe it's possible... > > On Mon, 4 Feb 2002, Shane Wright wrote: > > Hi > > > > This may be the wrong list to ask this, apologies if so :) > > > > Anyway, is there any way to define constants in PostgreSQL - my app has > > lots of them at the PHP level, but it'd be nice to use them directly in > > the SQL without overly complex query building. > > > > Something like this... > > > > DEFINE CONSTANT MYCONST = 4; > > > > SELECT * FROM mytable WHERE myfield=MYCONST; > > > > > > Thanks > > > > -- > > Shane > > > > ---------------------------(end of broadcast)--------------------------- > > TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org > > Chadwick Rolfs - cmr@gis.net > Cleveland State University - Student > Music Major - The Holden Arboretum Volunteer > Computer Programmer - Student Employee > --*I finally found powdered water; > I just can't figure out what to add to it*-- > > > ---------------------------(end of broadcast)--------------------------- > TIP 6: Have you searched our list archives? > > http://archives.postgresql.org