From: | "Sumita Biswas" <sbiswas(at)cisco(dot)com> |
---|---|
To: | "'Richard Huxton'" <dev(at)archonet(dot)com> |
Cc: | "'Kris Jurka'" <books(at)ejurka(dot)com>, "'Tom Lane'" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: Date addition using Interval |
Date: | 2004-05-06 00:50:14 |
Message-ID: | 041701c43304$1c848870$dc656540@amer.cisco.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Thanks Richard,
It works fine now.
Regards,
Sumita
-----Original Message-----
From: Richard Huxton [mailto:dev(at)archonet(dot)com]
Sent: Wednesday, May 05, 2004 9:18 AM
To: Sumita Biswas
Cc: 'Kris Jurka'; 'Tom Lane'; pgsql-general(at)postgresql(dot)org
Subject: Re: [GENERAL] Date addition using Interval
Sumita Biswas wrote:
> Hi Experts,
>
> I try to write the following in my Function and it works:
>
> ld_FromDateTemp := ld_FromDate + ''5 DAYS''::interval;
>
> But when I have to pass a parameter in the NUMBER of days(instead of
> 5) like 'li_NoOfDays'
>
> ld_FromDateTemp := ld_FromDate + ''li_NoOfDays DAYS''::interval;
You want ... + (li_NoOfDays || '' DAYS'')::interval;
plpgsql doesn't interpolate variables like perl/php do.
--
Richard Huxton
Archonet Ltd
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2004-05-06 01:09:25 | Re: CHECK constraints and optimizations |
Previous Message | Jim Crate | 2004-05-06 00:39:14 | Re: Error linking libpq into client program |