Re: [SQL] Dynamic Query for System functions - now()

2003-11-10 Thread Gaetano Mendola
Kumar wrote: Dear Friends, I am using PostgreSQL 7.3.4 Server on RH Linux 7.2. I am trying to generate a dynamic query to fetch the next month interval. select now()+ interval'1 month'; -- This is working fine. I wanna dynamically assign the interval number. i,e --> select now()+ interval

Re: [SQL] Dynamic Query for System functions - now()

2003-11-10 Thread Stephan Szabo
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 like select now() + n * interval '1 month'; rather than messing

Re: [SQL] Dynamic Query for System functions - now()

2003-11-10 Thread George Weaver
PROTECTED]> Sent: Monday, November 10, 2003 5:57 AM Subject: Re: [SQL] Dynamic Query for System functions - now() > Dear Christoph Haller, > > The code that u sent is not working > test=> EXECUTE 'select now()+ interval\'' ||to_char(3,'9')|| 'month\&#x

Re: [SQL] Dynamic Query for System functions - now()

2003-11-10 Thread Christoph Haller
3779+00 > > (1 row) > > > > test=> execute 'select now()'; > > ERROR: parser: parse error at or near "'select now()'" at character 9 > > test=> > > > > > > Regards > > kumar > > > > ---

Re: [SQL] Dynamic Query for System functions - now()

2003-11-10 Thread Achilleus Mantzios
x27;" at character 9 > test=> > > > Regards > kumar > > ----- Original Message - > From: "Christoph Haller" <[EMAIL PROTECTED]> > To: ""Kumar"" <[EMAIL PROTECTED]> > Cc: <[EMAIL PROTECTED]> > Sent: Mon

Re: [SQL] Dynamic Query for System functions - now()

2003-11-10 Thread Kumar
or near "'select now()'" at character 9 test=> Regards kumar - Original Message - From: "Christoph Haller" <[EMAIL PROTECTED]> To: ""Kumar"" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Monday, November 10, 2003

Re: [SQL] Dynamic Query for System functions - now()

2003-11-10 Thread Christoph Haller
> > Dear Friends, > > I am using PostgreSQL 7.3.4 Server on RH Linux 7.2. I am trying to generate= > a dynamic query to fetch the next month interval. > > select now()+ interval'1 month'; -- This is working fine. > > I wanna dynamically assign the interval number. i,e --> select now()+ inter=

[SQL] Dynamic Query for System functions - now()

2003-11-10 Thread Kumar
Dear Friends,   I am using PostgreSQL 7.3.4 Server on RH Linux 7.2. I am trying to generate a dynamic query to fetch the next month interval.   select now()+ interval'1 month';  -- This is working fine.   I wanna dynamically assign the interval number. i,e --> select now()+ interval'n month'