Error selecting dates around DST

I am having a problem selecting dates from a database at the office. I seem to be unable to select anything on the EDT switchover. I have tried various JDBC versions and it seems to be always wrong. below is my output followed by the code.
I would expect to see this:
2012-03-11 02:24:00.0
2012-03-11 03:24:00.0
What I get
ojdbc14-10.1.0.2.0.jar
2012-03-11 01:24:00.0
2012-03-11 03:24:00.0
ojdbc6_g-11.2.0.2.0.jar
2012-03-11 03:24:00.0
2012-03-11 03:24:00.0
ojdbc6_g-11.2.0.3.jar
2012-03-11 03:24:00.0
2012-03-11 03:24:00.0
import java.sql.*; public class JDBCTest {   public  static void main(String[] args) throws SQLException {     DriverManager.registerDriver(new oracle.jdbc.OracleDriver());     ResultSet bat = DriverManager.       getConnection("--JDBCURL--", "username", "password").       prepareCall("select to_date('3/11/2012 02:24:00','mm/dd/yyyy HH:MI:SS') theDate from dual").       executeQuery();     bat.next();     System.out.println(bat.getTimestamp("theDate"));   ResultSet man = DriverManager.       getConnection("--JDBCURL-", "username", "password").       prepareCall("select to_date('3/11/2012 03:24:00','mm/dd/yyyy HH:MI:SS') theDate from dual").       executeQuery();     man.next();     System.out.println(man.getTimestamp("theDate"));   } }
Any ideas on what could be going wrong? What kind of stuff should I be looking at in the DB environment? Is this a potential bug I should file somewhere? Thanks

>
I would expect to see this:
2012-03-11 02:24:00.0
2012-03-11 03:24:00.0
>
Your expectations are wrong. There is no 2am thru 2:59:59 am during DST. At 2am the clock moves to 3am so 02:24:00 does not exist.
I get the same results for all of those jar files (including 1.4) except I am not using the _g versions.
>
2012-03-11 03:24:00.0
2012-03-11 03:24:00.0
2012-03-11 01:59:59.0
2012-03-11 03:00:00.0 -- value used was for 02:00:00
>
See Support for Daylight Saving Times in the SQL Language Reference
http://docs.oracle.com/cd/B28359_01/server.111/b28286/sql_elements001.htm

Similar Messages

  • Error while selecting date from external table

    Hello all,
    I am getting the follwing error while selecting data from external table. Any idea why?
    SQL> CREATE TABLE SE2_EXT (SE_REF_NO VARCHAR2(255),
      2        SE_CUST_ID NUMBER(38),
      3        SE_TRAN_AMT_LCY FLOAT(126),
      4        SE_REVERSAL_MARKER VARCHAR2(255))
      5  ORGANIZATION EXTERNAL (
      6    TYPE ORACLE_LOADER
      7    DEFAULT DIRECTORY ext_tables
      8    ACCESS PARAMETERS (
      9      RECORDS DELIMITED BY NEWLINE
    10      FIELDS TERMINATED BY ','
    11      MISSING FIELD VALUES ARE NULL
    12      (
    13        country_code      CHAR(5),
    14        country_name      CHAR(50),
    15        country_language  CHAR(50)
    16      )
    17    )
    18    LOCATION ('SE2.csv')
    19  )
    20  PARALLEL 5
    21  REJECT LIMIT UNLIMITED;
    Table created.
    SQL> select * from se2_ext;
    SQL> select count(*) from se2_ext;
    select count(*) from se2_ext
    ERROR at line 1:
    ORA-29913: error in executing ODCIEXTTABLEOPEN callout
    ORA-29400: data cartridge error
    KUP-04043: table column not found in external source: SE_REF_NO
    ORA-06512: at "SYS.ORACLE_LOADER", line 19

    It would appear that you external table definition and the external data file data do not match up. Post a few input records so someone can duplicate the problem and determine the fix.
    HTH -- Mark D Powell --

  • BAPI Error: No schedule lines due for delivery up to the selected date

    Hi,
    I have created a program to create delivery orders with reference to sales orders using BAPI - BAPI_OUTB_DELIVERY_CREATE_SLS.
    After execution I get the error: No schedule lines due for delivery up to the selected date
    Please help.
    Thanks in advance!!!
    Regards,
    Sriram

    hi,
    this is to inform you that,
    please check the schedule line date in the sales order because the date is not matching here for the BAPI to upload.
    here,  for example the schedule line is 4 days after and you are running BAPI today. that will mismatch no.
    the same thing is happening in uploading case also.
    so please check the date.
    because in teh sales order if teh schedule line date is today it will accept the uploading with out throwing any errors.
    regards,
    balajia

  • Error "No schedule line due for delivery upto the selected date"

    Hi Experts,
    I am getting an error while creating outbound delivery for sales order.All items have same item cat and schedule line category,same customer.
    The sales order have three items with delivery date of 18.09.2008.the material stock is available for all three material and there is no planned issue for these material.
    In sales order schedule lines for all three items is confirmed on 18.09.2008. When I create a delivery on 04.09.2008(before the chedule line),it allows to create delivery for the two items but when I create delivery for material 3 on 04.09.2008(before the chedule line),it is giving error "No schedule line due for delivery upto the selected date" .on going to help it gives information that check whether the order item to be delivered contains confirmed schedule line.I checked the confirmed schedule line is on 18.09.2008 (though we have availbe stock on 04.09.2008).
    Kindly guide me how to resolve the issue,here I want to create delivery prior to the delivery/Schedule line date in Sles order.for 2 items it works but for third it is giving error.
    Is it something to do with Material group 5 in material master sales view for the 1 and 2nd mtrl it is 14 days for for the third it is 7 days?
    Sarvesh
    Edited by: Sarvesh Vashist on Sep 5, 2008 5:31 AM

    Hi Experts,
    I am getting an error while creating outbound delivery for sales order.All items have same item cat and schedule line category,same customer.
    The sales order have three items with delivery date of 18.09.2008.the material stock is available for all three material and there is no planned issue for these material.
    In sales order schedule lines for all three items is confirmed on 18.09.2008. When I create a delivery on 04.09.2008(before the chedule line),it allows to create delivery for the two items but when I create delivery for material 3 on 04.09.2008(before the chedule line),it is giving error "No schedule line due for delivery upto the selected date" .on going to help it gives information that check whether the order item to be delivered contains confirmed schedule line.I checked the confirmed schedule line is on 18.09.2008 (though we have availbe stock on 04.09.2008).It allows to create a OBD either I change the delivery date in sales order to 04.09.2008 or create a delivery with delivery date 18.09.208.
    Kindly guide me how to resolve the issue,here I want to create delivery prior to the delivery/Schedule line date in Sles order.for 2 items it works but for third it is giving error.
    Is it something to do with Material group 5 in material master sales view for the 1 and 2nd mtrl it is 14 days for for the third it is 7 days?
    Sarvesh
    Edited by: Sarvesh Vashist on Sep 5, 2008 5:31 AM

  • Cube to Cube "Error in data Selection" plz help

    Hi this is Ajay Reddy
    when am sending data from Cube to Cube am getting an error
    "Error in data Selection" plz help

    Hi,
    It needs a Note implementaion. I got similar problem in version BIW 7 and SP 11. We got the solution with on of the note . I am not able to recollect the note number.
    Any way check the notes 920971,155471 may help you or not.
    With rgds,
    Anil Kumar Sharma .P

  • Error in data Selection

    Hi experts,
    I have added a field to 0emp_attr data source using DS enhancements, when trying to extract with full the job is getting failed stating  " error in data selection".

    Hi,
    Just see following thing
    1. Try to extract data in R/3 in RSA3 transaction.If it is working correctly no issue
    2. If RSA3 throw issue check the definition of your code and try to debug it.
    3. If RSA3 is fine check your Infopackage selection settings if it is ok or there is any error,If there is any selection try to remove it and load data.
    Thanks and regards

  • "Error in data selection" while loading

    hi,
    while loading data from one ODS to another(datamart) I, after extraction of some data packages successfully I m getting an error:"Error in data selection"
    i saw its help messages were
    1)error 7 when sending an idoc
    2)sql error in accessing table no 13
    3)error in source system
    in the source ods i have loaded thru init from R/3..
    please help

    Hi,
    Take a look on the cosulting note : 610938.
    In place of R/3 system you have to consider BW itself when you are reading the note.
    With rgds,
    Anil Kumar Sharma .P

  • Error in data selection of Infopackage

    Hi,
    My infopackage is failing with "Error in data selection". RSM 340 is the error message number.
    Datasoucre: 0FI_AP_4
    I have checked
    1. Timestamp--consistent
    2.Reactivated and replicated datasource
    3.Checked SM58 in both BW and source systems and found it OK
    I have taken Source jobs for 1 succesfull infopackage run and 1 unsucessfull infopackage run.
    I see that Job log for unsucessfull has no call to customer enhancement and no data selection is done thereby.
    i am attaching the job logs for 1 successful and 1 unsuccessful case. Please check and let me know the gap that is contributing to this error.

    Hi nayab,
    You and harish works at same location?
    i seen same issue from harish as well.
    http://scn.sap.com/thread/3578278
    Thanks

  • DB connectivi​ty toolkit: syntax error in a SELECT data from joined tables

    Hello everyone
    I'm trying to put in labview an SQL query on joined tables.
    As example I take a DB for storing the data of 2on2 basketball games, whose tables are
    matches(matchId,teamA,teamB)
    teams(teamId,PlayerAname,PlayerBname,Nationality)
    nationalities(NatId,natName)
    To get a result table with the match number and the player names along with their nationality I use this query on MySQL (which works on the command line interface)
    SELECT MatchID,
                     t1.PlayerAName, t1.PlayerBName, n1.natName,
                     t2.PlayerAName, t2.PlayerBName, n2.natName
    FROM matches m
    INNER JOIN teams t1 ON t1.teamID = m.teamA
    INNER JOIN teams t2 ON t2.teamID = m.teamB
    INNER JOIN nationalities n1 ON n1.natID = t1.nationality
    INNER JOIN nationalities n2 ON n2.natID = t2.nationality
    When I put it in labview, using the "select data" block, I get a syntax error as shown in the attached screenshot.
    Am I mistanking something in using the JOIN statements, or the aliases?
    Thanks in advance!
    Solved!
    Go to Solution.
    Attachments:
    select2dabone.vi ‏12 KB

    Giovasa wrote:
    I do't like very much the chain of blocks execute query+n*(fetch element)+free object, so I try to avoid that as much that I can...
    Sounds like a prime candidate for a subVI. You don't have to use it every time, but it probably would help for cases where you do want to put the SQL query directly in code.
    Incidentally, if you're doing joins, you might consider using views, as that allows you to hide the details of the interactions of the tables in the DB itself.
    Try to take over the world!

  • Error to select data field of same length and same type.

    Hi,
    I have to select data from VBRK , VBRP and then from table CE4UCA1_ACCT based on the condition
    AKTBO   IN SO_AKTBO           AND
    PAOBJNR = LT_VBRK_VBRP-POSNR  AND
    PASUBNR IN SO_RKBNR           AND
    PRCTR   IN SO_PRCTR.
    So while coding it gave a syntax error saying that PAOBJNR & POSNR need to be of same length. To solve this I chagned the decalaration of POSNR from "POSNR TYPE POSNR" to "POSNR TYPE RKEOBJNR" and this corrected the error.
    Now I have to select data from KONV table based of the condition :-
    Get data from KONV table.
      select knumv
             kposn
             stunr
             kwert
         into table lt_konv
         from konv
         for all entries in LT_VBRK_VBRP
         where knumv = LT_VBRK_VBRP-knumv and
               kposn = LT_VBRK_VBRP-posnr and
               stunr = '950'.
    Here again it is throwing syntax error that LT_VBRK_VBRP-posnr should be of same type and same length. So please guide me how to solve this type of situation.
    Thank You,
    SB.

    Hi,
    select knumv
    kposn
    stunr
    kwert
    into table lt_konv
    from konv
    for all entries in LT_VBRK_VBRP
    where knumv = LT_VBRK_VBRP-knumv and
    ***--- Change to
    *kposn = LT_VBRK_VBRP-kopos and*
    stunr = '950'. For 4.6c system
    OR
    Pass VBAK-KNUMV to KONV-KNUMV
    VBAP-POSNR to KONV-KPOSN
    Edited by: Raj on Jun 17, 2008 2:27 AM

  • Data Error in the Query/Report after selective data deletion for infocube

    Hi Experts,
    Please advise what i was missing and what went wrong...
    I got a Query (Forecast) on a Multicube...which is based on 2 Infocubes with Aggregates...
    As i identified some data discrepency..yesteraday i performed selective data deleation on one of the Infocube
    and executed report yesteraday and the results in the query are correct...
    When today i executed the same report i am getting different results..
    When i compared the results of the report with that of data in cube they are not matching
    The report is not displaying the data in cube..for some rows it is displaying the data in the cube but for some rows it is just displaying same as the above row
    there is no data loaded into info cube after selective deleation
    Do i need to perform request compression and fill the aggregated after selective deleation
    Please advise what went wrong

    Hi Venkat,
    No i haven't done anything on aggregates before or after selective delete
    As there is not data load after the selective delete according to SAP Manual we don't need to perform any thing on aggregates...as selective data deletion on cube will delete data from aggregates as well
    Please update how to identify error

  • Error in selecting Date

    Hi,
    I am not able to select any date except of this month.If I try to select it will give NAN in the date navigator field.
    Where ever i use Date Navigator in any project I am having the same issue. I am not able to select the date except present month.
    Example. Suppose today's date is 27 July 2009.
    I can select date from July 2009 only.
    If i  click Next or Previous I am getting Nan/Nan/Nan in the date navigator field or input field.
    I am using Java 1.5 and NetWeaver       7.0.1.
    Please provide me the solution.
    Thanks
    Unitarian Aryan

    Hi,
    "NaN" stands for "not a number". "Nan" is produced if a floating point operation has some input parameters that cause the operation to produce some undefined result. For example, 0.0 divided by 0.0 is arithmetically undefined. Taking the square root of a negative number is also undefined
    check the following PDF
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/e012e6a2-8d21-2a10-1bb8-d9b606f3474c?overridelayout=true
    Calendar and Date with external representation

  • Error when selecting date range in query designer

    hi all,
    when iam trying to select date range in query designer like 01.04.2009 to 10.04.2009 it has to select only that dates where as it is selecting all the dates in between those like 010.04.2009,01.03.2009,01.02.2009.why this is happening ,iam unable to understand.plzz help me in this issue.
    Vamshi D Krishna

    hi ,
    i have created a variable as you told but no use.still i have to select the dates manuallyone after the other.for more user friendly can i have a calander where i can select date ranges.is it posible to have calander for selecting date ranges instead selecting dates one by one,if posible i request you to give  the detailed steps.plzz guide me in this issue.thanks in advance.
    Vamshi D Krishna

  • Selecting data from Multiple Partitions in a single select stmt.

    Hi all,
    My Database is very large & my tables are partitioned.
    My question is:
    1) If my data is spread across multiple partitions, is there any way to select data from multiple partitions in a single query?
    If we dont mention partition name also it works fine, but perofmance wise it will be very slow. (Using EXPLAIN PLAN)
    (Note:I dont want to make use of Union concept, i want to do it in a single select statement)
    For ex:
    qry1.sql:
    select empno from emp_trans partition (P012000)
    This above query(qry1.sql) will work fine.
    qry2.sql:
    select empno from emp_trans partition (P012000,P022000)
    The above query(qry2.sql) will return will return the following error:
    ORA-00933: SQL command not properly ended
    If anybody has any solution for this, pls mail me immediately.
    Thanks in advance
    bye
    null

    All my queries are dynamically generated. All my tables are also indexed partition wise based on date field. My question is, if i want to mention multiple partition names at the time of generating my query(select), then with parformance will be good. I have refered some books, inthat what they say is to use UNION concept, i dont want to use that, instead i want in a single select statement.
    Thaks for ur reply
    Bye
    null

  • Error reading data from CLOB column into VARCHAR2 variable

    Hi all,
    Am hitting an issue retrieving data > 8K (minus 1) stored in a CLOB column into a VARCHAR2 variable in PL/SQL...
    The "problem to be solved" here is storing DDL, in this case a "CREATE VIEW" statement, that is longer than 8K for later retrieval (and execution) using dynamic SQL. Given that the EXECUTE IMMEDIATE statement can take a VARCHAR2 variable (up to 32K(-1)), this should suffice for our needs, however, it seems that somewhere in the process of converting this VARCHAR2 text to a CLOB for storage, and then retrieving the CLOB and attempting to put it back into a VARCHAR2 variable, it is throwing a standard ORA-06502 exception ("PL/SQL: numeric or value error"). Consider the following code:
    set serveroutput on
    drop table test1;
    create table test1(col1 CLOB);
    declare
    cursor c1 is select col1 from test1;
    myvar VARCHAR2(32000);
    begin
    myvar := '';
    for i in 1..8192 loop
    myvar := myvar || 'a';
    end loop;
    INSERT INTO test1 (col1) VALUES (myvar);
    for arec in c1 loop
    begin
    myvar := arec.col1;
    dbms_output.put_line('Read data of length ' || length(myvar));
    exception when others then
    dbms_output.put_line('Error reading data: ' || sqlerrm);
    end;
    end loop;
    end;
    If you change the loop upper bound to 8191, all works fine. I'm guessing this might have something to do with the database character set -- we've recently converted our databases over to UTF-8, for Internationalizion support, and that seems to have changed underlying assumptions regarding character processing...?
    As far as the dynamic SQL issue goes, we can probably use the DBMS_SQL interface instead, with it's EXECUTE procedure that takes a PL/SQL array of varchar2(32K) - the only issue there is reading the data from the CLOB column, and then breaking that data into an array but that doesn't seem insurmountable. But this same basic issue (when a 9K text block, let's say, turns into a >32K block after being CLOBberred) seems to comes up in other text-processing situations also, so any ideas for how to resolve would be much appreciated.
    Thanks for any tips/hints/ideas...
    Jim

    For those curious about this, here's the word from Oracle support (courtesy of Metalinks):
    RESEARCH
    ========
    Test the issue for different DB version and different characterset.
    --Testing the following PL/SQL blocks by using direct assignment method(myvar := arec.col1;) on
    different database version and different characterset.
    SQL>create table test1(col1 CLOB);
    --Inserting four CLOB data into test1.
    declare
    myvar VARCHAR2(32767);
    begin
    myvar := RPAD('a',4000);
    INSERT INTO test1 (col1) VALUES (myvar);
    myvar := RPAD('a',8191);
    INSERT INTO test1 (col1) VALUES (myvar);
    myvar := RPAD('b',8192);
    INSERT INTO test1 (col1) VALUES (myvar);
    myvar := RPAD('c',32767);
    INSERT INTO test1 (col1) VALUES (myvar);
    commit;
    end;
    --Testing the direct assignment method.
    declare
    cursor c1 is select col1, length(col1) len1 from test1;
    myvar VARCHAR2(32767);
    begin
    for arec in c1 loop
    myvar := arec.col1;
    --DBMS_LOB.READ(arec.col1, arec.len1, 1, myvar);
    dbms_output.put_line('Read data of length: ' || length(myvar));
    end loop;
    end;
    The following are the summary of the test results:
    ===================================
    1. If the database characterset is WE8ISO8859P1, then the above direct assignment
    method(myvar := arec.col1;) works for database version 9i/10g/11g without any
    errors.
    2. If the database characterset is UTF8 or AL32UTF8, then the above direct assignment method(myvar := arec.col1;) will generate the "ORA-06502:
    PL/SQL: numeric or value error" when the length of the CLOB data is greater
    than 8191(=8K-1). The same error can be reproduced across all database versions
    9i/10g/11g.
    3. Using DBMS_LOB.READ(arec.col1, arec.len1, 1, myvar) method to read CLOB data into a VARCHAR2 variable works for both WE8ISO8859P1 and UTF8
    characterset and for all database versions.
    So - it seems as I'd surmised, UTF8 changes the way VARCHAR2 and CLOB data is handled. Not too surprising, I suppose - may you all be lucky enough to be able to stay away from this sort of issue. But - the DBMS_LOB.READ workaround is certainly sufficient for the text processing situations we find ourselves in currently.
    Cheers,
    Jim C.

Maybe you are looking for