pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Shane Wright <me@shanewright.co.uk>
To: pgsql-php@postgresql.org
Subject: Re: constants
Date: Mon, 4 Feb 2002 21:31:26 +0000
Message-ID: <200202042131.g14LVmJ22309@fullerruss.dsvr.co.uk> (raw)
In-Reply-To: <Pine.SOL.3.96.1020204144315.17025A-100000@shell.gis.net>
References: <Pine.SOL.3.96.1020204144315.17025A-100000@shell.gis.net>


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



view thread (7+ messages)  latest in thread

Message-ID: <200202042131.g14LVmJ22309@fullerruss.dsvr.co.uk>
Permalink:  ../200202042131.g14LVmJ22309@fullerruss.dsvr.co.uk/
Also on:    postgresql.org/message-id/200202042131.g14LVmJ22309@fullerruss.dsvr.co.uk

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-php@postgresql.org
  Cc: me@shanewright.co.uk
  Subject: Re: constants
  In-Reply-To: <200202042131.g14LVmJ22309@fullerruss.dsvr.co.uk>
  References: <Pine.SOL.3.96.1020204144315.17025A-100000@shell.gis.net> <200202042131.g14LVmJ22309@fullerruss.dsvr.co.uk>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox