Re: substitute variable in sql? - Mailing list pgsql-general

From Bruno Wolff III
Subject Re: substitute variable in sql?
Date
Msg-id 20021029170549.GB5942@wolff.to
Whole thread Raw
In response to Re: substitute variable in sql?  ("Johnson, Shaunn" <SJohnson6@bcbsm.com>)
Responses Re: substitute variable in sql?
List pgsql-general
On Tue, Oct 29, 2002 at 11:35:42 -0500,
  "Johnson, Shaunn" <SJohnson6@bcbsm.com> wrote:
> --thanks for the reply
>
> --i just have an sql script that i launch
> --by hand (psql -U <user> -d <database> -f ./<script>)
>
> --the date is a rolling date which is supposed to
> --change every 3 months.  and as variable 1 is moved
> --up every month, so should variable 2 move up every
> --month.

It sounds like you might be able to calculate the date based on the
current date. You would need to formula a precise rule for calculating
the two dates based on the date the script is being run. (And you may
still need another script if you need to be able to handle exceptions.)
If the script updates stuff than you may need to put in some extra care
in making sure that it can't be run twice or after skipping a time period
without some sort of override.

pgsql-general by date:

Previous
From: Bruno Wolff III
Date:
Subject: Re: substitute variable in sql?
Next
From: Afra
Date:
Subject: EXPLAIN times