Re: substitute variable in sql?

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: Doug McNaught <doug(at)mcnaught(dot)org>
Cc: "Johnson, Shaunn" <SJohnson6(at)bcbsm(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: substitute variable in sql?
Date: 2002-10-29 17:01:28
Message-ID: 20021029170128.GA5942@wolff.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Oct 29, 2002 at 11:19:31 -0500,
Doug McNaught <doug(at)mcnaught(dot)org> wrote:
> "Johnson, Shaunn" <SJohnson6(at)bcbsm(dot)com> writes:
>
> > Running PostgreSQL 7.2.1 on RedHat Linux 7.2:
> >
> > I have a query where I have to replace the
> > date parameter each time I run the query.
> >
> > Is there a way to substitute just the date
> > parameter in the sql without having to
> > edit the script, re-run and edit again?
>
> There are loads of ways to do this. What client language are you
> using? Are you running 'psql' from a shell script?

And also what date do you want? It may be possible to calculate it based
on the current date and/or information in the database.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Bruno Wolff III 2002-10-29 17:05:49 Re: substitute variable in sql?
Previous Message Johnson, Shaunn 2002-10-29 16:35:42 Re: substitute variable in sql?