Re: Dynamic Query for System functions - now() - Mailing list pgsql-sql

From Stephan Szabo
Subject Re: Dynamic Query for System functions - now()
Date
Msg-id 20031110072842.K16647@megazone.bigpanda.com
Whole thread Raw
In response to Dynamic Query for System functions - now()  ("Kumar" <sgnerd@yahoo.com.sg>)
List pgsql-sql
On Mon, 10 Nov 2003, Kumar wrote:

> select now()+ interval'1 month';  -- This is working fine.
>
> I wanna dynamically assign the interval number. i,e --> select now()+
> interval'n month';

If n is an integer, I'd suggest something likeselect now() + n * interval '1 month';
rather than messing around with the text of the interval literal.



pgsql-sql by date:

Previous
From: "George Weaver"
Date:
Subject: Re: Dynamic Query for System functions - now()
Next
From: Stephan Szabo
Date:
Subject: Re: transaction processing after error in statement