Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to Subtract months from a timestamp variable in plsq

user11992761May 28 2015 — edited May 28 2015

How do you subtract months from a timestamp variable in plsql using another variable as the interval number?

So I understand the syntax in a select statement would be eg select systimestamp - interval '4' month from dual;

so how could I do similar in a proc  eg .


pi_months': number:4;

L_TSTAMP_NEW:=v_log_tstamp - interval ' pi_months' month;


how do I put the pi_months in the correct quotes . In the above form it gives an error -  PLS-00167: keyword BULK is used in a wrong context.


Any suggestions would be much appreciated.

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 25 2015
Added on May 28 2015
2 comments
970 views