How to get YYYY-MM-DD

Hi,
I am trying to get a format of YYYY-MM-DD from 10/1/2005 and cannot get
from the below program.
any help in this regard is appreciated.
Thanks
Chat
import java.util.*;
import java.text.*;
public class GetSampleDate {
     public static void main(String args[]){
              Date ddd=new Date("10/1/2005");
              System.out.println(ddd.toString());
              Format formatter = new SimpleDateFormat("YYYY-MM-DD");
              System.out.println("formatted date is"+formatter.format(ddd)+"\n");
}Sat Oct 01 00:00:00 EDT 2005
Exception in thread "main" java.lang.IllegalArgumentException: Illegal pattern character 'Y'
at java.text.SimpleDateFormat.compile(SimpleDateFormat.java:678)
at java.text.SimpleDateFormat.initialize(SimpleDateFormat.java:497)
at java.text.SimpleDateFormat.<init>(SimpleDateFormat.java:446)
at java.text.SimpleDateFormat.<init>(SimpleDateFormat.java:427)
at GetSampleDate.main(GetSampleDate.java:8)

Calculating Java dates: Take the time to learn how to create and use dates
Working in Java time: Learn the basics of calculating elapsed time in Java
Formatting a Date Using a Custom Format
Parsing a Date Using a Custom Format

Similar Messages

  • How to get period date of for a given month from a given date in mdx for SSRS report (mm/dd/yyyy)

    I have a situation,  where i need to write expression Period to date(PTD). i want to know how to get the period date. i want you to help in writing Period date or else is there any function to get period date for a given date(the  date is given
    from the parameter dynamically) in MDX for SSRS report
    ram

    Hi ram,
    Per my understanding that you want to get the period date based on the month selected and the given date, right?
    Could you please provide details information below to help us better understanding your requirements, thus we will be more effective to provide an solution:
    What is the format of the period date you want to get, is this date in the DB and you want to filter it based on the month and the given Date?
    Did the month and given date are two parameters in the report? if possible, could you please provide some sample data in the DB and also the snapshot of the report structure
    I assume you want to get the period date(mm/dd/yyy) between the select month(e.g:Feb) and the given date (10/1/2014) and you should get the date between(02/01/2014-10/1/2014).
    If so,and you also have two parameter "Month","EndDate"(EndDate is the given date), please reference to details information below:
    You can create an new parameter "BeginDate" (Date/Time) which is the begin date of the period, you can use the expression to get the value based on the value of the month and the year value from the given date,finally hide this parameter:
    Specify the available value:
    Label:=Parameters!Month.Value &"/01/"& DatePart("yyyy",Parameters!EndDate.Value)
    Value:=CDate(=Parameters!Month.Value &"/01/"& DatePart("yyyy",Parameters!EndDate.Value))
    Specify the default Value:
    Value:=CDate(=Parameters!Month.Value &"/01/"& DatePart("yyyy",Parameters!EndDate.Value))
    Add filter to the dataset as below:
    Preview you will get all the date in the given Period:
    If you still have any problem, please feel free to ask.
    Regards
    Vicky Liu

  • How to get date in dd/mm/yyyy format ?

    Hello,
    for this query :
    >select to_date(to_char(sysdate),'dd/mm/yyyy') from dual;
    i wanted to get date in dd/mm/yyyy format , but this query is not returning in correct date format .
    How to get that ?

    select id,
    to_date(to_char(dt1,'mm/dd/yyyy'),'dd/mm/yyyy') dt1,
    to_date(to_char(dt2,'mm/dd/yyyy'),'dd/mm/yyyy') dt2
    from t_table1 where no=23;This is my actual query.
    But this query is giving error.
    ORA-01843: not a valid monthWhen i issued this query :
    select id,dt1,dt2 from t_table1 where no=23 ;
    this is the output :
    ID DT1 DT2
    001 10/7/2011 10/19/2011Edited by: bootstrap on Oct 8, 2011 2:13 PM
    Edited by: bootstrap on Oct 8, 2011 2:13 PM

  • How to get a string "yyyyMMdd" into date like MM/dd/yyyy?.

    Hi
    How to get a string "yyyyMMdd" into date like MM/dd/yyyy?. i have used
    SimpleDateFormat.parse but it is giving long value. i want to disply the date
    like MM/dd/yyyy
    thank you

    Do you want the string rearranged or do you want to create an instance of some form of Date class?
    If you want to rearrange the string you could just do it yourself provided you know the date string is going to be of the format yyyyMMdd.
    something like this:
    String newDate = origStr.charAt(4) + origStr.charAt(5) + "/" + origStr.charAt(6) + origStr.charAt(7) + "/" ...etc.

  • How to get the current date ? in the form of dd/mm/yyyy?

    Hi all,
    As getDate( ), getMonth( ), and getYear( ) is depricated, how to get the current date or System date, month and year ? please help ??
    Regards
    Ashvini

    HI,
    Than u for the reply. But i am getting one error.
    as u said, I tried to do so.........
    but, i am getting one error.
    code
    Calendar cald=(Calendar.getInstance.getTime());
    out.println(cald);
    error message
    validate$jsp.java:86: Attempt to reference method getInstance in class java.util.Calendar as an instance variable.
    Calendar cald=(Calendar.getInstance.getTime());
    ^
    1 error
         at org.apache.jasper.compiler.Compiler.compile(Compiler.java:284)
    Pls help
    Regards,
    Ashvini

  • How to get Date Format from Local Object.

    Hi All,
    I am new to Web Channel.
    I need to know Date format From date of locale.
    suppose there is a date "01/25/2010" date in date field I want to get string "mm/dd/yyyy". Actually I have to pass date format to backend when I call RFC. 
    Is there any way to get Date format from "Locale" object. I should get date format for local object
    I get local object from "UserSessionData" object but how to get Date format from it.
    I am not looking for Date value. I am looking for current local date format ("mm/dd/yyyy or dd/mm/yyyy or mon/dd/yyyy) whatever local date format.  I could not find example which show how to get date format from "Locale" object.
    Any help will be appreciated with rewards.
    Regards.
    Web Channel

    Hi,
    You can get it from "User" or "Shop" business object.
    Try to get User or Shop Business Object as shown below.
    BusinessObjectManager bom = (BusinessObjectManager) userSessionData.getBOM(BusinessObjectManager.ISACORE_BOM);
    User user = bom.getUser();
    char decimalNotation = user.getDecimalPointFormat().getGroupingSeparator();
    If you are seeing "1,234.00" then above code will return "."
    I hope this information help you to resolve your issue.
    eCommerce Developer.

  • How to get the last day of the week?

    Hii
    i can get the calender week number for any given date using
    SELECT to_char(to_date('04/04/2011','MM/DD/YYYY'),'WW') FROM dual
    can any body tell me, how to get the last day of that week ?
    and the answer should be 04/08/2011(8th april )
    thanks
    San
    Edited by: sandeep9 on Apr 4, 2011 3:50 AM

    Hi, San,
    Here's one way:
    WITH     sample_data     AS
         SELECT  DATE '2011-04-04'     AS dt
         FROM     dual
    SELECT  dt
    ,     TO_CHAR (dt, 'WW')     AS week_num
    ,     NEXT_DAY ( dt - 1
               , TO_CHAR ( TRUNC (dt, 'YEAR') - 1
                      , 'Day'
               )          AS end_o_week
    FROM     sample_data;Another way is to use date arrithmetic:
    WITH     sample_data     AS
         SELECT  DATE '2011-04-09'     AS dt
         FROM     dual
    SELECT  dt
    ,     TO_CHAR (dt, 'WW')     AS week_num
    ,     TRUNC (dt, 'YEAR')
          + (7 * CEIL ( (dt - (TRUNC (dt, 'YEAR') - 1))
                / 7
          - 1               AS using_date_arithmetic
    FROM     sample_data;

  • How to get same day of a month in every year in the DB ( To update a flag )

    Hi,
    I am trying to formulate an update query for a flag table in our database which contains dates, and flag columns. Currently the system have dates for the next ten years. The flags are updated with values 0 or 1 if a particular date falls under the required criteria.
    I need to update flag column for the same day of the month in every year. e.g. 2nd Sunday of October. The value should be updated to all years in the table. Currently I am using the following query to update the current year.
    UPDATE FILTERCALENDAR SET YEAR_WINDOW=1 WHERE c_date = NEXT_DAY( TO_DATE('OCT-2013','MON-YYYY'), 'SUNDAY') + (2-1)*7;
    and for next year Like
    UPDATE FILTERCALENDAR SET YEAR_WINDOW=1 WHERE c_date = add_months(NEXT_DAY( TO_DATE('OCT-2013','MON-YYYY'), 'SUNDAY') + (2-1)*7,+12)-1;
    This is not an excellent way to do it as it does not take care of leap years and it does not scan and update values in the whole table for all years correctly.
    Can any one help me to resolve this please.

    Hi,
    user10903866 wrote:
    Hi,
    I am trying to formulate an update query for a flag table in our database which contains dates, and flag columns. Currently the system have dates for the next ten years. The flags are updated with values 0 or 1 if a particular date falls under the required criteria.
    I need to update flag column for the same day of the month in every year. e.g. 2nd Sunday of October. The value should be updated to all years in the table. Currently I am using the following query to update the current year.
    UPDATE FILTERCALENDAR SET YEAR_WINDOW=1 WHERE c_date = NEXT_DAY( TO_DATE('OCT-2013','MON-YYYY'), 'SUNDAY') + (2-1)*7;That's the 2nd Sunday after October 1; the 2nd Sunday of October is the 2nd Sunday after September 30, so you need to subtract 1 more day before calling NEXT_DAY.
    I'd do it this way:
    WHERE   c_date = NEXT_DAY ( TO_DATE ( '01-OCT-2013', 'DD-MON-YYYY') - 8
                             , 'SUNDAY'
                     ) + (7 * 2)     -- Last number is week numberRemember, calling NEXT_DAY like this depends on your NLS_DATE_LANGUAGE.
    and for next year Like
    UPDATE FILTERCALENDAR SET YEAR_WINDOW=1 WHERE c_date = add_months(NEXT_DAY( TO_DATE('OCT-2013','MON-YYYY'), 'SUNDAY') + (2-1)*7,+12)-1;If you want the 2nd Sunday in October, 2014, then take the previous expression, and just change 2013 to 2014:
    WHERE   c_date = NEXT_DAY ( TO_DATE ( '01-OCT-2014'     -- or any month and year you want
                                        , 'DD-MON-YYYY'
                            ) - 8
                             , 'SUNDAY'
                     ) + (7 * 2)     -- Last number is week number
    This is not an excellent way to do it as it does not take care of leap years and it does not scan and update values in the whole table for all years correctly.
    Can any one help me to resolve this please. 
    I hope this answers your question.
    If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all the tables involved, and the results you want from that data.
    In the case of a DML operation (such as UPDATE) the sample data should show what the tables are like before the DML, and the results will be the contents of the changed table(s) after the DML.
    Explain, using specific examples, how you get those results from that data.
    See the forum FAQ {message:id=9360002}

  • How to get current date in a specified format ?

    Hi,
    I want to get the current date (java.util.Date()) in the format yyyy-MM-dd HH:mm:ss.
    Can you please tell me as to how to get that ?
    Regards

    I have used the same and the code looks like this. But i am getting java.text.ParseException : UnParseable Date: "Fri Jul 11 13:29:43 CDT 2003"
    The Code is :
    java.util.Date sysDate = new java.util.Date();
    SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
    String formatted_date = df.format(sysDate);
    It is erroring out in the last statement !!

  • How to get changed records in a table

    I have a table t1 as
    create table t1( num number, name varchar2(35),code char(2));
    my data looks like
    num name code
    1 xy c1
    2 zx c2
    3 qq c5
    after 2 hr i have changed my value to:
    1 zx c3
    2 za c2
    3 qq c5
    i need to get a select statement which gives the changed rows:
    my output looks like:
    1 zx c3
    2 za c2
    how to get these changed rows
    Thanks in advance

    "It's not working" - fabulous feedback.
    Really any reply to that should be just left at "because you're doing it wrong" however....
    The flashback query syntax doesn't work like that.
    Has to be more like this:
    select t1.column,t2.column
    from t1 ,t2
    where t1.column=t2.column
    MINUS
    select t1.column,t2.column
    from t1 AS OF TIMESTAMP TO_TIMESTAMP('27.04.2011 10:00:00', 'DD-MM-YYYY HH24:MI:SS')
    ,    t2 AS OF TIMESTAMP TO_TIMESTAMP('27.04.2011 10:00:00', 'DD-MM-YYYY HH24:MI:SS')
    where t1.column=t2.column;The documentation is great for seeing how things should work, syntax etc.... you should try it.

  • How to get the Date in a particular format?

    Hi,
    How to get the Date in the below format? I will be passing the year in my method..
    2/10/2003 9:46:52 PM
    D/M/YYYY H:M:S A
    public Date getDate (String year) {
    Here i want to get the Date in this format
    2/10/<Passed Year> 9:46:52 PM
    Thanks

    This is my code
    public static Date getCalendar(Calendar calendar,int getYear) {
    String      formatted_date="";
         int year = getYear;
         int month = calendar.get(Calendar.MONTH+1);
         int day = calendar.get(Calendar.DATE);
         int hour = calendar.get(Calendar.HOUR);
         int min = calendar.get(Calendar.MINUTE);
         int sec = calendar.get(Calendar.SECOND);
         int am_pm =calendar.get(Calendar.AM_PM);
         formatted_date = month+"/"+day+"/"+year+" "+hour+":"+min+":"+sec+" PM";
         System.out.println("formatted_date is "+formatted_date);     
         o/p : formatted_date is 1/4/2006 1:44:21 PM
         SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy");
    //     DateFormat dateFormat =DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT);
         Date passdate = new Date();
         try {
              passdate = dateFormat.parse(formatted_date);
         } catch (ParseException e) {
              System.out.println("Invalid Date Parser Exception "+e.getLocalizedMessage()+"DateFormat is "+dateFormat);
              System.out.println("The Date inside the function is "+passdate+"and the year passed is "+year);
    o/p : The Date inside the function is Sat Apr 01 00:00:00 IST 2006and the year passed is 2006
         return passdate;
    Expected O/P is 3/1/2006 1:44:12 PM
         }

  • How to get Historic Data in Oracle

    Hi,
    THe following query might be useful to generate the consecutive dates from given date to sysdate.
    SELECT dt
    FROM   ( SELECT to_date('02/19/1981','mm/dd/yyyy')+rownum-1 AS dt
           FROM    user_objects
    WHERE  TRUNC(dt)<=TRUNC(SYSDATE);NOw lets consider the basic scott.emp table
    The above requirement can be acheived using this query as we may get only 14 records as there are only 14 records in scott.emp table
    select ( to_date('02/19/1981','mm/dd/yyyy')+rownum-1) as dt
    from scott.emp If we see the scott.emp table there are 2 reocrds with empno 7499,7521 with hiredates 20-feb-81 and 22-feb-81 respectively. on pulling the historic data from19-feb-81 to 04-mar-81 as there are only 14 records in the table we need to get the sum of sal or comm as it is along with those dates in the table.
    Assuming there are more than one record for the same date for the dates mentioned above , i have used the following query but could not get the desired output.
    Select To_Date('02/19/1981','mm/dd/yyyy')+Rownum-1,
    sum(Case When Sal>0 And Trunc(Hiredate)= (To_Date('02/19/1981','mm/dd/yyyy')+Rownum-1)
    Then (Sal)
    Else 0 End ) As Hist_Sal,
    sum(Case When Nvl(Comm,0)>= 0 And Trunc(Hiredate)= (To_Date('02/19/1981','mm/dd/yyyy')+Rownum-1)
    Then (Nvl(Comm,0))
    Else 0 End) As hist_comm
    From Scott.Emp
    Group By To_Date('02/19/1981','mm/dd/yyyy')+Rownum-1
    order by 1; I have tried the other option also and I could get the desired output.THe query goes like this:
    --Success Statement
    Select To_Char(Rt.Business_Date , 'Day,Mon DD,yyyy') As Business_Date ,To_Date(Rt.Business_Date) As Hist_date,
    ( Select sum(sal)
    From Scott.Emp  Slm
    Where Trunc (Hiredate) = Trunc(Rt.Business_Date)
    ) as hist_sal
    FROM
    (select ((TO_DATE('02/19/1981','mm/dd/yyyy')-1)+rnm) as business_date from (select rownum rnm from user_objects)) rt
    Where
    Trunc(Rt.Business_Date) Between To_Date('02/19/1981','mm/dd/yyyy') And To_Date('10/31/2012','mm/dd/yyyy')
    order by Hist_date;But i want to get the historic dates/data to be genearted from scott.emp table insetead of using this logic *(select ((TO_DATE('02/19/1981','mm/dd/yyyy')-1)+rnm) as business_date from (select rownum rnm from user_objects)) rt* as written in Success Statement
    As it would be helpful for my requirement ,else I need to write subqueries for all the cols i need as i have written in the above success statement.
    please advise.
    Regards,

    sri wrote:
    Hi,
    THe following query might be useful to generate the consecutive dates from given date to sysdate.
    SELECT dt
    FROM   ( SELECT to_date('02/19/1981','mm/dd/yyyy')+rownum-1 AS dt
    FROM    user_objects
    WHERE  TRUNC(dt)<=TRUNC(SYSDATE);
    Unless you're using Oracle 8 (or older) then it's more efficient to say:
    SELECT     start_dt + LEVEL - 1     AS dt
    FROM     (
              SELECT     TO_DATE ('02/19/1981', 'MM/DD/YYYY')     AS start_dt
              ,     TRUNC (SYSDATE)                           AS end_dt
              FROM     dual
    CONNECT BY  LEVEL     <= 1 + (end_dt - start_dt)
    ;and it doesn't depend on how many rows happen to be in user_objects.
    NOw lets consider the basic scott.emp table
    The above requirement can be acheived using this query as we may get only 14 records as there are only 14 records in scott.emp table
    select ( to_date('02/19/1981','mm/dd/yyyy')+rownum-1) as dt
    from scott.emp If we see the scott.emp table there are 2 reocrds with empno 7499,7521 with hiredates 20-feb-81 and 22-feb-81 respectively. on pulling the historic data from19-feb-81 to 04-mar-81 as there are only 14 records in the table we need to get the sum of sal or comm as it is along with those dates in the table.
    Assuming there are more than one record for the same date for the dates mentioned above , i have used the following query but could not get the desired output.
    Select To_Date('02/19/1981','mm/dd/yyyy')+Rownum-1,
    sum(Case When Sal>0 And Trunc(Hiredate)= (To_Date('02/19/1981','mm/dd/yyyy')+Rownum-1)
    Then (Sal)
    Else 0 End ) As Hist_Sal,
    sum(Case When Nvl(Comm,0)>= 0 And Trunc(Hiredate)= (To_Date('02/19/1981','mm/dd/yyyy')+Rownum-1)
    Then (Nvl(Comm,0))
    Else 0 End) As hist_comm
    From Scott.Emp
    Group By To_Date('02/19/1981','mm/dd/yyyy')+Rownum-1
    order by 1; I have tried the other option also and I could get the desired output.THe query goes like this:
    --Success Statement
    Select To_Char(Rt.Business_Date , 'Day,Mon DD,yyyy') As Business_Date ,To_Date(Rt.Business_Date) As Hist_date,
    ( Select sum(sal)
    From Scott.Emp  Slm
    Where Trunc (Hiredate) = Trunc(Rt.Business_Date)
    ) as hist_sal
    FROM
    (select ((TO_DATE('02/19/1981','mm/dd/yyyy')-1)+rnm) as business_date from (select rownum rnm from user_objects)) rt
    Where
    Trunc(Rt.Business_Date) Between To_Date('02/19/1981','mm/dd/yyyy') And To_Date('10/31/2012','mm/dd/yyyy')
    order by Hist_date;But i want to get the historic dates/data to be genearted from scott.emp table insetead of using this logic *(select ((TO_DATE('02/19/1981','mm/dd/yyyy')-1)+rnm) as business_date from (select rownum rnm from user_objects)) rt* as written in Success Statement
    As it would be helpful for my requirement ,else I need to write subqueries for all the cols i need as i have written in the above success statement.Sorry, I'm not sure what you're asking.
    Do you want to know if there's a simpler and/or more efficient way to get the same results as the 2nd query you posted above?
    Here's one way:
    WITH      all_dates   AS
         SELECT     start_dt + LEVEL - 1     AS dt
         FROM     (
                  SELECT     TO_DATE ('02/19/1981', 'MM/DD/YYYY')     AS start_dt
                  ,             TO_DATE ('10/31/2012', 'MM/DD/YYYY')     AS end_dt
                  FROM    dual
         CONNECT BY  LEVEL     <= 1 + (end_dt - start_dt)
    SELECT       TO_CHAR (a.dt, 'Day, Mon DD, YYYY')     AS business_date
    ,       SUM (e.sal)                                AS hist_sal
    FROM              all_dates  a
    LEFT OUTER JOIN      scott.emp  e  ON  e.hiredate = a.dt
    GROUP BY  a.dt
    ORDER BY  a.dt
    ;For testing purposes, it would be a lot clearer if you made the end_dt something like April 5, 1981 rather than October 31, 2012.
    I hope this answers your question.
    If not, post the results you want from the data in scott.emp, given some reasonable date range. (I suggest Nov. 16, 1981 through Jan. 24, 1982; that includes December 3, 1981 which has 2 rows with the same hiredate.)
    Explain, using specific examples, how you get those results from that data.
    Always say which version of Oracle you're using (e.g., 11.2.0.2.0).
    See the forum FAQ {message:id=9360002}

  • How to get the date in local language

    Hi,
    I want display "Date" in Local language. Written code as below to display date in my RTF Template:
    <?format-date:xdoxslt:sysdate_as_xsdformat();'dd'?><?' '?><?xdoxslt:month_name(substring(xdoxslt:sysdate(),3,2), 0, $_XDOLOCALE)?><?' '?><?format-date:xdoxslt:sysdate_as_xsdformat();'yyyy'?>
    Output showing in my RTF template as "26 May 2011". which is correct for englilsh.
    want to display same format in Local languge for example in Germany :
    26 mai 2011
    To get the local language format tried 1) by Putting "DEU" instead of "$_XDOLOCALE" 2. Tried by declaring a variable with value as "DEU"
    But it two cases it showing in english format not in Germany Language. Please give me idea how to get date in local language.
    Thanks
    -Chakri..

    Dont think you have anyway to tell the target language for a single text retrieval. You can obviously set the locale of the user but that will change language of other texts also. If you always want to show some predefined text in English then better you dont keep the those texts at all in the translated files. Or you keep the English text in all the files - so that everytime English only gets displayed. But if your case is a selective one - i.e. you want to show English text to only German users but spanish to Spanish and French to French then I dont have any answer how to achieve the same.
    Regards,
    Shubhadip

  • How to get LASTDAY for each and every month between given dates..

    Hi Friend,
    I have a doubt,How to get LASTDAY for each and every month between given dates..
    for ex:
    My Input will be look like this
    from date = 12-01-2011
    To date = 14-04-2011
    And i need an output like
    31-01-2011
    28-02-2011
    31-03-2011
    is there any way to achieve through sql query in oracle
    Advance thanks for all helping friends

    Here's a 8i solution :
    select add_months(
             trunc(
               to_date('12-01-2011','DD-MM-YYYY')
             ,'MM'
           , rownum ) - 1 as results
    from all_objects
    where rownum <= ( months_between( trunc(to_date('14-04-2011','DD-MM-YYYY'), 'MM'),
                                      trunc(to_date('12-01-2011','DD-MM-YYYY'), 'MM') ) );
    The above two query is worked in oracle 11GActually the first query I posted is not correct.
    It should work better with
    months_between(
       trunc(to_date(:dt_end,'DD-MM-YYYY'),'MM'),
       trunc(to_date(:dt_start,'DD-MM-YYYY'),'MM')
    )Edited by: odie_63 on 12 janv. 2011 13:53
    Edited by: odie_63 on 12 janv. 2011 14:11

  • How to get a materialized view get to refresh itself after the job is "broken"

    we created a materialized view sometime ago with the following statement:
    create materialized view SXV_PUB_EMPLOYEE_CERT_ALL_M
    refresh complete on demand
    start with to_date('30-08-2009 04:00:00', 'dd-mm-yyyy hh24:mi:ss') next trunc(sysdate) + (28/24)
    as
    select  sxv_emp_cert_all.*
    from    sxv_employee_certification_all sxv_emp_cert_all;
    this week we found out it had not been refresh for about a month
    In dba_jobs the column broken was 'Y', next_date time something like 01-01-4000 and failures 16
    when I ran it manually by executing
    BEGIN DBMS_MVIEW.REFRESH('SXV_PUB_EMPLOYEE_CERT_ALL_M', 'C'); END;
    I found that one of the columns was too small (probably a columns of one of the underlying tables had been extended since the creation of the materialized view)
    After fixing this I ussied yesterday (on 29-8-2013) the statement :
    alter materialized view SXV_PUB_EMPLOYEE_CERT_ALL_M
    refresh complete on demand
    start with to_date('30-08-2009 04:00:00', 'dd-mm-yyyy hh24:mi:ss') next trunc(sysdate) + (28/24)
    after this the table dba_jobs showed me 30-08-2013 04:00:00 as next date
    I was expecting it to run this night at 04:00, but it didn't
    the last_date column value was still from about a month ago, the column broken still shows 'Y'
    and the next date 30-08-2013 04:00:00 (while it should been set to 31-08-2013 01:00:00
    Rrunning
    BEGIN DBMS_MVIEW.REFRESH('SXV_PUB_EMPLOYEE_CERT_ALL_M', 'C'); END;
    gave no errors this time
    and in User_Mview_Analysis the last_refresh_date column showed the date/time I had executed it
    Any idea how to get the job "unbroken" again so that the view refreshes itself every night?
    the database is Oracle Database 10g Release 10.2.0.4.0
    regards,
    Remco

    thanx for all your helpful and correct answers . but eventually I found it myself
    exec dbms_job.broken(<jobnumber>, false);

Maybe you are looking for