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
sbrbot
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: 64109
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
SQL> select sysdate, trunc(add_months(sysdate,1),'month') next_month from dual;
SYSDATE     NEXT_MONTH
----------- -----------
8-MAY-2007  1-JUN-2007

1 row selected.

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

SYSDATE  LAST_DAY
-------- --------
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: Mon Dec 05 09:13:14 CST 2016

Total time taken to generate the page: 0.10302 seconds