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!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

How to add a month to a date?

568775Sep 10 2009 — edited Sep 10 2009
Hello,

I have the following SProc where <one month> is the syntax i am after. I think the code is fairly self explanatory, but if anything is not clear then please ask :)
CREATE or REPLACE PROCEDURE &HKResourceDB_Schema_Name..UpdateSubscriptionDates
(
aGroupID NUMBER
)
AS

BEGIN

UPDATE HKGroup 
SET SubscriptionStarted = CAST(SYS_EXTRACT_UTC(LOCALTIMESTAMP) AS DATE), 
SubscriptionEnded = CAST(SYS_EXTRACT_UTC(LOCALTIMESTAMP) AS DATE) + <one month>
WHERE ID = aGroupID;

END UpdateSubscriptionDates;
/
This post has been answered by 673860 on Sep 10 2009
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 8 2009
Added on Sep 10 2009
7 comments
500 views