Bug with interval and leap years

select to_date('2012-feb-29','yyyy-mon-dd') + interval '1' year as dt from dual;

ORA-01839: date not valid for month specified
01839. 00000 -  "date not valid for month specified"
*Cause:    
*Action:

select to_date('2012-feb-29','yyyy-mon-dd') + interval '2' year as dt from dual;

ORA-01839: date not valid for month specified
01839. 00000 -  "date not valid for month specified"
*Cause:    
*Action:

select to_date('2012-feb-29','yyyy-mon-dd') + interval '3' year as dt from dual;

ORA-01839: date not valid for month specified
01839. 00000 -  "date not valid for month specified"
*Cause:    
*Action:

select to_date('2012-feb-29','yyyy-mon-dd') + interval '4' year as dt from dual;

29-FEB-16 00:00:00


select to_date('2012-feb-29','yyyy-mon-dd') + interval '1' day as dt from dual;

01-MAR-12 00:00:00

select to_date('2012-feb-29','yyyy-mon-dd') + interval '1' month as dt from dual;

29-MAR-12 00:00:00
The problem exists in 10.2.0.4 and 11.2.0.3

Published by: birlenbach-Chase February 29, 2012 09:20

Hello

That's just how the intervals of work. Leap years are the least of the problem; Adding 1 month to 31 March results in the same error.
If you want to make sure that the result is a valid DATE, use ADD_MONTHS. (There is no separate function for adding years; use ADD_MONTH (SYSDATE, 12 * n) to get the DATE which is n years.)

Tags: Database

Similar Questions

  • Y at - it shows a bug with Hide and regions in 4.1.1.00.23?

    Hi all

    I tried to put a subregion Hide and Show area on a page. It is supposed to have a subregion of the form of each side (i.e. above and below).

    'View' of the region will show a "View only" control with a text and a picture inside.

    When I create the subregion Hide and Show area and add the control. everything seems to work as expected. However, when I then moves the subregion so that it is now between the subregions two form, 'view' is no longer something watch. The arrow changes, but that's all. It's as if the display control had ceased to exist. Move that the subregion any where from there does not change the behavior - show it only control is not displayed.

    Does anyone know if this is a known issue with 4.1.00.23? If so, is there a workaround?

    Thank you very much

    PT

    There seems not to be a bug and it seems not be a workaround.

    To recreate (at least in version 4.1.1), in the tree, create two subregions of form and add some controls. Create a subregion Hide and Show, and then add a control. If you run the page now, it should appear normal (i.e. the content in the skin and see the subregion will be visible when you click on show). Now, move the sub-region Hide and Show via drag and drop to between the two sub-regions form. If you run the page now, it should appear that there is no content in the skin and see the sub-region, despite the fact that, in the design view control is always there.

    See the bug itself, swap component mode. You will notice that even if the sequence of sub region numbers appear correct, the physical order of the sub regions will always be as they were when the subregion to hide and see the creation.

    Thus, it will look something like this:

    Shape 90 1 sub-region

    Subregion 230 form 2

    100 hide / display the subregion<-- in="" tree="" view,="" this="" will="" appear="" to="" be="" between="" form="" sub="" region="" 1="" and="" 2,="" in="" component="" view,="" it="" still="" appears="" at="" the="">

    To fix, go back to tree, drag hide and show of the subregion at the bottom, return to the view of the component, change hide and show of the subregion it and manually change the value of the sequence to a value between Sub regions 1 and 2 form. This will be:

    • go hide and show the sub-region to form Sub region 1 region 2 Sub form
    • the content of the Hide and Show under region now appears when you click to perform the operation to see the

    Hope this helps someone someday.

    PT

  • Very strange bug with AIR and native process (Windows 7, EXE)

    Hi all!

    The situation is:

    I did an Application AIR, inside which a native process - running EXE file.

    I use Flash CC as IDE and tried to use the compilation as EXE with AIR 2.6 and 3.6 - results are the same.

    So I insert inside a control if the nativeprocess is supported or not and the native process is supported all the time.

    When I come to install the application and run it - the first attempt is good - everything works as a must: internal EXE is called by my Application with the necessary parameters so long I need.

    However if I close the application, then if it run not new - internal EXE is not starting at all, depends on number of attempts to restart the application.

    Then only is to uninstall, install back and then you'll be a session more successful EXE-internal requests, until the forthcoming resumption of the application.

    That's all.

    I tried to "google it" but without success. The bug is probably very rare.

    Help me please?

    Update: compiling with the Flash IDE of CC, he works all the time with no problems.

    Update-2: when I run EXE installator, there will be a notification "same version is installed, etc.', then choose 'Run Now' - he also works without any problem.

    Well, I found the solution and the answer by myself and it is here please:

    In the case with the same situation above, you will need to add a single line in your AS3 code

    nativeProcessStartupInfo.workingDirectory = File.applicationDirectory;

    And you will be so happy

  • There is a bug with GarageBand and download on soundcloud

    I wanted to download a song on soundcloud, so I named it the flamethrower. I put a cover photo and set it to the public. And assign the average quality. But this error screen appeared. I put it the same thing this time, but as an uncompressed file. AIFF.

    She is still the same please help or at least tell what happened to you too (important note: I am in Korea, not America.)

    Welcome X8_minithug_8X,

    Thank you for your first post on Apple Support communities.  I'd like to help you with the download of your Garageband creations SoundCloud.  I found all kinds of great artists there, so I know it's important, that you can get your downloaded music.

    The below-referenced article has instructions on how to download on SoundCloud.

    Send a song from GarageBand to SoundCloud

    You mentioned being in Korea would affect your ability to access to SoundCloud or feature.  It may be possible that this feature is not available in your area.

    Best wishes

  • Bug with truncatewords and truncate in blogs...

    I have noticed a problem with the help of truncatewords or truncate in blogs. (It can happen elsewhere, just have not seen).

    To replicate the issue, let me share a bit of code.

    First of all, in the overall design, I have code that looks like this:

    < div class = 'row content-margin' >

    < div class = "medium-8 small-12 columns" >

    < div class = "content-container" >

    {tag_postlist}

    < p > {tag_previouspage} {tag_pagination} {tag_nextpage} < /p >

    < / div >

    < / div >

    < div class = "way-4 small-12 columns" >

    {module_contentholder name = "sidebar"}

    < / div >

    < / div >

    Of course, this brings in the layout of the post and it must have a primary column and a sidebar. Then, in the list of Post layout, I have the following code:

    < h2 > {{title}} < / h2 >

    {{body | truncatewords: 100, '...}} »}}

    < br class = 'clear' >

    < a href = "{{url}}" class = "button brand" > Read Post < /a >

    Then let's say that I have the following code in a blog:

    < ul class = "non-balle" >

    " < li > < a href =" http://www.example.com "> example of title < /a > < /li > .

    Additional information about the link above < /li > < li >

    " < li > < a href =" http://www.example.com "> example of title < /a > < /li > .

    Additional information about the link above < /li > < li >

    " < li > < a href =" http://www.example.com "> example of title < /a > < /li > .

    Additional information about the link above < /li > < li >

    <!--< li > > other items

    < /ul >

    That should give me a nice snippet from the list in the blog post, but it does not work.

    It gives me a nice snippet, but also it messes up the code on my page.

    Like this, it should BE rendered on the page:

    < div class = 'row content-margin' >

    < div class = "medium-8 small-12 columns" >

    < div class = "content-container" >

    Blog Post 1 < h2 > < / h2 >

    < ul class = "non-balle" >

    First < /li > < li > li element

    Second point < /li > < li > li

    Third point li < li > < /li >

    < /li > < li > limited to the first 100... Etc. Word

    < /ul >

    < br class = 'clear' >

    < a href = "" / post-url "class ="button brand"> Read Post < /a >"

    The 2 posts Blog < h2 > < / h2 >

    < ul class = "non-balle" >

    First < /li > < li > li element

    Second point < /li > < li > li

    Third point li < li > < /li >

    < /li > < li > limited to the first 100... Etc. Word

    < /ul >

    < br class = 'clear' >

    < a href = "" / post-url "class ="button brand"> Read Post < /a >"

    <! - additional Blog post - >

    < p > < a href = "#" > 1 < /a >, < a href = "#" > 2 < /a >, < a href = "#" > 3 < /a >, etc. < /p >

    < / div >

    < / div >

    < div class = "way-4 small-12 columns" >

    <! - the content of my Sidebar - >

    < / div >

    < / div >

    But it doesn't work. Instead, he makes like this:

    < div class = 'row content-margin' >

    < div class = "medium-8 small-12 columns" >

    < div class = "content-container" >

    Blog Post 1 < h2 > < / h2 >

    < ul class = "non-balle" >

    First < /li > < li > li element

    Second point < /li > < li > li

    Third point li < li > < /li >

    < li > Etc. Word that is limited to the first 100...

    < br class = 'clear' >

    < a href = "" / post-url "class ="button brand"> Read Post < /a >"

    The 2 posts Blog < h2 > < / h2 >

    < ul class = "non-balle" >

    First < /li > < li > li element

    Second point < /li > < li > li

    Third point li < li > < /li >

    < li > Etc. Word that is limited to the first 100...

    < br class = 'clear' >

    < a href = "" / post-url "class ="button brand"> Read Post < /a >"

    <! - additional Blog post - >

    < p > < a href = "#" > 1 < /a >, < a href = "#" > 2 < /a >, < a href = "#" > 3 < /a >, etc. < /p >

    < div class = "way-4 small-12 columns" >

    <! - the content of my Sidebar - >

    < / div >

    <!-Additional LI or DIV tags for each subsequent blog post. ->

    < /li > <!-LAST LI TAG FOR BLOG POST 2! ->

    < /ul >

    < /li > <!-LAST LI TAG FOR BLOG POST 1. ->

    < /ul >

    < / div >

    < / div >

    < / div >

    I know this may be hard to visualize because these forums are not the best at the position code. But basically the last li and ul tag encapsulates everything breaking the layout of the page. This happens when I use both {{body | truncatewords: 100, '...}} "} OR {{body |}} TRUNCATE: 100 «...» »}}.

    If I just use {{body}} it works fine, but it is not desirable that this post is really long. Also, I can use {tag_blogpostbody, 50, [...]}, but this makes my list just as a block of text without any set and all the links are in the citations which is horrible.

    The site is still under development so I'm not post a URL but I will happily the PM all BC personal link.

    Does anyone found a workaround for this?

    You will have to strip_html when using truncate or truncate_words ; they work only on channels and are not aware of the html syntax. They do not close tags that have been opened in their result.

    If you need to keep the html tags in the code snippet, you will probably have to make the whole of the body and hide the rest with css such as overflow: hidden; .

  • PhongMaterial.setMaterial "bug" with MeshView and multiple TriangleMesh

    Basically, I create a group of TriangleMesh using 1 mesh, creating a new instance of the view every time and just defining the coordinates to create a group that has batteries high, wide and deep.

    In the code I originally wanted to do
    (if w % 2 ==0) 
    {
    p.setDiffuseColor(Color.RED)
    }
    {
    else
    {
    //blue
    }
    As a result, displaying only the second color in this case, or the first color if w %2! = 0, which was weird.


    Then, I entered this next issue to attempt to define the scale and the high.
     protected final void populate()
                    {
                        for(int w = 0; w < wide; w++)
                        {
                           MeshView meshV = new MeshView(this.mesh);
    
                               p.setDiffuseColor(Color.AQUA);
                            
                          
                            meshV.setMaterial(p);
                            
                             super.getChildren().add(meshV);
                             
                        }
    
                        for(int h = 0; h < high; h++)
                        {
                           MeshView meshV = new MeshView(this.mesh);
                          
    
                               p.setDiffuseColor(Color.ANTIQUEWHITE);
                       
                            meshV.setMaterial(p);
     super.getChildren().add(meshV);
    
                    }
    So, try to affect the material in both loops I get all the s MeshV be ANTIQUEWHITE. If I get rid of the second setMaterial I'll have the first ANTIQUEWHITE set and the second gray. each other in the first results being grey and the second ANTIQUEWHITE.


    Now it seems to me that if he does everything with just this 1 setMaterial, but I don't know why if I create a new instance each time. If it was the MeshV even, perhaps, but in this case, it's weird... I have no real use for the handling of the MeshView later, I just need to create the mesh and then aside, their distance with the code for that is not stated above.

    According to this Web page 'features 3D' https://wikis.oracle.com/display/OpenJDK/3D+Features | https://wikis.Oracle.com/display/OpenJDK/3D+features]:

    -javafx.scene.shape.Mesh: sharable between several forms defined by the user
    -javafx.scene.paint.Material: sharable between several Shape3D nodes

    In your code you re-use the mesh instance (TriangleMesh) and the instance of p (PhongMaterial). These instances are not copied, they are referenced. Any change requested to 'mesh' and 'p' will affect ALL users (MeshView).

    Creation and re-use of two PhongMaterial, pAqua, and pAntiquewhite objects, should lead to the Visual effect desired.

    August

  • Bug or error during the handling of leap years with WDS/DS

    Hi all

    I discovered a difference in results with the construction and to debug (without frame) and generate and debug with the revisions of Web or server of determinations when calculating the days in leap years.
    I use the DayDifferenceInclusive function to calculate the number of days in a period of insurance.

    the number of days of insurance period = DayDifferenceInclusive (the start date of the insurance, the date of the end of insurance)

    With the tester of regression or generation and debugging (without frame), I get the following result for the following entry:

    * 93 = DayDifferenceInclusive (02-29-2008, 05-31-2008) *.

    When we use the revisions of Web or server of determinations we get the value of * 92 * for exactly the same data entry when it should be 93.
    Is this a bug in the java code? How can we fix this or is there a work around it?

    We are in the middle of integration testing system for a huge project to help is very appreciated!

    Best regards
    Niels Roest

    Niels,

    Thanks for that - and it seems that in the Netherlands DST began March 30, 2008, that is, as far as I know, the trigger for this error.

    I have reproduced the issue against 10.1 using the period from 1st October 2010 to 30 October 2010, which contains the date this summer time began in Australia.

    Regarding the ways to work around the problem, I can offer 3:

    * wait 10.2 - it is in beta at the moment (but given your opening remarks, may not be an option for you)
    * set your locale of the server to that which has no DST
    * work around the issue in the rules:

    First of all, the question is that the retail version fails because it does not realize that one of these days is shorter than the standard 24 hours.

    The trick is to replace the DayDifference function with the HourDifference function and round up the number of days.

    Thus given a rule that looks like:

    result = DayDifference (date one, date two)

    It can be rewritten in the form:

    The result = round (HourDifference (one at 00:00:00, date two to 00:00:00) / 24, 0)

    * the "at 00:00:00 ' is necessary because HourDifference works on dates/hours, not dates.

    Sorry for the inconvenience.

    Concerning
    Andrew

  • interval + "1" [year | month | day] does not take into account leap years?

    Hi all

    The Version of database: Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bi
    Database version: PL/SQL Release 10.2.0.5.0 - Production

    I just realized that the function of the interval is not account of leap years.
    SQL> select to_date('29-02-2008','dd-mm-yyyy') + interval '1' year 
      2    from dual;
    select to_date('29-02-2008','dd-mm-yyyy') + interval '1' year
                                          *
    ERROR at line 1:
    ORA-01839: date not valid for month specified
    I looked through the documentation as much as I can and could find no mention of this.

    If I want to add a year to date, I have to calculate the number of days or do something like incrementing only the part of the year and then manually check that it does not fall on February 29 if it is not a leap year manually?

    Edit:

    just to clarify, day and minute seem to work for example but do not have month and year:
    SQL> select to_date('28-02-2009','dd-mm-yyyy') + interval '1' day
      2    from dual;
    
    TO_DATE('
    ---------
    01/MAR/09
    
    1 row selected.
    
    Elapsed: 00:00:00.00
    SQL> 
    SQL> select to_date('28-02-2009 23:59','dd-mm-yyyy hh24:mi') + interval '1' minute 
      2    from dual;
    
    TO_DATE('
    ---------
    01/MAR/09
    
    1 row selected.
    
    Elapsed: 00:00:00.00
    SQL> 
    SQL> select to_date('29-01-2009','dd-mm-yyyy') + interval '1' month
      2    from dual;
    select to_date('29-01-2009','dd-mm-yyyy') + interval '1' month
                                          *
    ERROR at line 1:
    ORA-01839: date not valid for month specified
    
    
    Elapsed: 00:00:00.00
    SQL> 
    SQL> select to_date('29-02-2008','dd-mm-yyyy') + interval '1' year
      2    from dual; 
    select to_date('29-02-2008','dd-mm-yyyy') + interval '1' year
                                          *
    ERROR at line 1:
    ORA-01839: date not valid for month specified
    Published by: WhiteHat on July 14, 2011 10:31

    Hello

    It is true; in the INTERVAL arithmetic + x (or) d - x, where x is the months or years, the result will be the same day of the month as d. If this date does not exist, then you will get an error
    Another example is:

    SQL> SELECT  DATE '2011-03-31' + INTERVAL '1' MONTH  FROM dual;
    SELECT  DATE '2011-03-31' + INTERVAL '1' MONTH  FROM dual
                              *
    ERROR at line 1:
    ORA-01839: date not valid for month specified
    

    To avoid triggering an error, use ADD_MONTHS and/or arithmetic DATE instead.

  • Is it possible with the serial number of an Xserve to read the configuration and the year of production?

    Is it possible with the serial number of an Xserve to read the configuration and the year of production?

    This will show you the model and year: https://checkcoverage.apple.com/

    If a specific configuration (like the 1 TB disk instead of 500 GB for ex) will not be determined. You can only learn by starting the Xserve (or open and look into it.)

  • Lost Windows XP product key operating system but still have box with certificate and XP CD years ago. How can I recover my product key?

    Lost XP product but key BONES who still box with certificate and XP CD years ago. How can I recover my product key? Thank you

    Here are some utilities, which will display your product keys:

    Belarc Advisor: http://www.belarc.com/free_download.html
    (He did a good job of providing a wealth of information.
    However may not detect a key to office, then try one of the other two below)

    Also: http://www.magicaljellybean.com/keyfinder.shtml
    and: http://www.nirsoft.net/utils/product_cd_key_viewer.html

    J W Stuart: http://www.pagestart.com

  • RECENTLY I bought the subscription for the month, but then canceled (I think?) because I'm frustrated. I've been using bridge and photoshop cs6 for 4 years. I've never understood light room and where it is located. I've dabbled with it and I could not

    RECENTLY I bought the subscription for the month, but then canceled (I think?) because I'm frustrated. I've been using bridge and photoshop cs6 for 4 years. I've never understood light room and where it is located. I've dabbled with it and I couldn't find out how to save my images in my workflow of currengt, or how to resize and put a border around my images. How to save for web and as TIFF, as I did for all my files for four years. LR seems to be taking pictures of my Iphoto folder and I don't use that. I tried to cancel the cc of photoshop and lightroom cc and cc bridge but I don't know if I did. I am really confused, and I have work to do. What can I do, do I do, help me! @@ !

    Cancel see answer #1 in https://forums.adobe.com/thread/2023066 - includes a link to Chat from Monday to Friday

    Your subscription to cloud or serial number to show on your account page?

    https://Accounts.adobe.com/ , then click on Plans & products top

    Cloud of reading takes up https://forums.adobe.com/thread/2089127 for some ideas

  • Hi, I would like my contract with photoshop and lightroom, it has been a year and I do not want to renew, how do I proceed?

    Hi, I would like my contract with photoshop and lightroom, it has been a year and I do not want to renew, how do I proceed?

    Basically, the contact support as soon as POSSIBLE.

    Cancel your membership Adobe Creative Cloud

    To the link below, click on the still need help? option in the blue box below and choose the option to chat or by phone...

    Make sure that you are logged on the Adobe site, having cookies enabled, clearing your cookie cache.  If he continues to not try to use a different browser.

    https://helpx.Adobe.com/contact.html?step=CCSN_membership-account-payment_cancel-your-memb ership_stillNeedHelp

  • I download the demo version of Lightroom CC for Mac and it bugs with DW021 error code. What should I do?

    I download the demo version of Lightroom CC for Mac and it bugs with DW021 error code. What should I do?

    Hello

    Please visit:-Error 21 or DW021 when installing Photoshop CC 2015

    or

    I need help!

  • With the help of SQL, need to display the previous year, current year and the year next to single variable

    Hi all

    We have an obligation to state the previous year, current year and values of the year next as a LOV in the ADF page.

    This is the query that retrieves the previous year, current year and next year. But the result of this query displays values in 3 columns:

    Select (Extract(year from sysdate)-1), extract (year sysdate), (extract (year sysdate) + 1) twice;

    Output:

    2012 2013 2014


    But I want to display them in a single with 3 rows as column:

    2012

    2013

    2014


    Please your ideas.

    or in the same way

    SELECT EXTRACT (YEAR FROM ADD_MONTHS (SYSDATE, 12 *(LEVEL-2)))

    OF the double

    connect by level<>

  • Bug with rendering property on IE and FF

    Hello
    I have a bug with the property made on jdev 11g 11.1.1.1.0
    In a managed bean, I create a method starting with 'get' as getchPasswordRendered
    This method returns a Boolean value.
        System.out.println("getChPasswordRendered -> " + bindings.get("ChPassword").toString().length());
        if (bindings.get("ChPassword").toString().length() != 32) 
        {
          System.out.println("getChPasswordRendered -> TRUE");
          return Boolean.TRUE;
        }
        else 
        {
          System.out.println("getChPasswordRendered -> FALSE");
          return Boolean.FALSE;
        }
    I call this method in ChPassword inputText property rendered like this:
    #{managedBeanName.chPasswordRendered}

    It's my Structure.

    When I run the page:
    The first line of the display: table is selected, length = 5, the input text "ChPassword" to af: panelFormLayout is visible (getchPasswordRendered return true-> ok)
    I select the second line, length = 6, the input text is visible (getchPasswordRendered return true-> ok)
    Then I select the third row, length = 32, text entry is not visible (false return getchPasswordRendered-> ok)
    Finally, I select the second line, length = 6 and text entry is NOT visible (getchPasswordRendered return true-> bug!)

    Can you tell me why?
    Thanks for your help.

    Try the visible attribute instead of the rendering and see if it works.
    If Yes, it's probably only so rendered because is set to false, the component is removed from the page and you don't get back until the next full page reload.

    Timo

Maybe you are looking for

  • Hard drive MacBook Air full when using only iclouddrive

    Can anyone help please.  I'm sure that its very simple.  I have a Macbook Air and create books for children.  I saved all the files on my iclouddrive account, thinking that I don't use space on my hard drive!  However, my hard drive is now complete. 

  • No "set up sync" under "Tools". Attempt to synchronize bookmarks on my phone

    I'm trying to sync my firefox with my smartphone browser. It says to click on "Set up sync" under "Tools". I do not show this choice under 'tools '. It just says: 'sync', which does nothing. There is no "set up synchronization" anywhere.

  • Satellite 2540CDS, cannot start system!

    I have a 2540CDS Satallite my son gave me and I can't get the system to boot. I tried windows 98 w/os boot floppy disk in and the system restarts and I get the "non-system disk", I get the same message when I try to boot from the CD-ROM in windows xp

  • NEW 3D LUT for F55 and F65

    All, We have created four LUT 3D for your rating pleasure. If please see below to download and do not forget to read the document before using to understand their function Because of differences in the reproduction of colors between F5 and F55, we wi

  • HP ZBook G14 2: upgrade to Windows 8, Windows 7, no disk drive

    I ordered my ZBook on May 26, 2015. It was supposed to have Windows 8.1 Pro pre-installed on it (she has even the Windows 8 sticker on the bottom), but the vehicle currently has Windows 7 above. It also came with Windows 8 recovery disks, which I pre