replacing expresion in plpgsql

From: Juan Pablo L <jpablolorenzetti(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: replacing expresion in plpgsql
Date: 2013-12-15 23:15:50
Message-ID: CABSYDaZGC9ZJydopXjkBzppRZ-wTBiYPMr2MS7NdVAFD3GJf_Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi, i have a function that receives a parameter which represents days:

FUNCTION aaa_recharge_account(expdays integer)

i want to add those days to the CURRENT_DATE, but i do not know how to do
it, i have tried several ways to replace that in an expresion like:

newexpdate := CURRENT_TIMESTAMP + interval '$1 days' using expdays;
(newexpdate is declared as timestamp)

and many more but none work, can someone please help me to find out how can
i replace that parameter into an expression that i can add to
CURRENT_TIMESTAMP or any other way that i can accomplish what i need which
is to add that parameter to the current timestamp. thanks!!!

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Andreas Brandl 2013-12-16 00:17:53 Re: replacing expresion in plpgsql
Previous Message Juan Pablo L 2013-12-15 23:13:54 help replacing expresion in plpgsql