Home » SQL & PL/SQL » SQL & PL/SQL » Materialized view refresh
Materialized view refresh [message #235903] Tue, 08 May 2007 06:27 Go to next message
Messages: 5
Registered: August 2006
Location: Croatia
Junior Member

How to define that materialized view (snapshout) should be refreshed on first day of each month since months do have different number of days? When one defines NEXT parameter in mv creation clause there is option NEXT SYSDATE+days or NEXT TO_DATE(date)+days but how to define 1st day of month? If you define SYSDATE+30 this is not what I want.
Re: Materialized view refresh [message #235925 is a reply to message #235903] Tue, 08 May 2007 07:33 Go to previous messageGo to next message
Michel Cadot
Messages: 65090
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
SQL> select sysdate, trunc(add_months(sysdate,1),'month') next_month from dual;
----------- -----------
8-MAY-2007  1-JUN-2007

1 row selected.

Re: Materialized view refresh [message #235928 is a reply to message #235925] Tue, 08 May 2007 07:42 Go to previous message
Messages: 21131
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
SQL> select sysdate, last_day(trunc(sysdate)) + 1 from dual;

-------- --------
08.05.07 01.06.07
Previous Topic: how to number of working days in a month
Next Topic: what is the cause of bad bind variable error here?
Goto Forum:

Current Time: Fri Jul 28 14:24:26 CDT 2017

Total time taken to generate the page: 0.05102 seconds