-
updating a field with a future date
Let me give you a slight background of what I am trying to do. We have this job that gets run everymonth through a third party app. The job relies on a date value in the field. the data value is always going to be the last day of the month before we run the job. so for example if I am running the job on may 2nd the date value needs to be 4/30. I am trying to write an sql script that after the job runs it updates the date field to so it is ready for the next month. I am not sure how to do this. the database is 10g. I thought about udating with something like sysdate + 29 but sometimes it would be 30. Does oracle now what the last day of each month would be? Does it know the last day of may is 31 and june is 30?
-
Yes. Oracle knows the future that's why she's an Oracle
Try "select last_day(sysdate) from dual;"
Pablo (Paul) Berzukov
Author of Understanding Database Administration available at amazon and other bookstores.
Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.
-
that worked. Thanks.
I guess Oracle knows all..........................
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|