Sql time issue

i have a time/date feild in Access database,,but when i make a select statement of the time, it gives me a strange date with the time :
1899-12-30 15:16:19
1899-12-30 15:17:19
1899-12-30 15:18:19
1899-12-30 15:19:19
1899-12-30 15:20:19
1899-12-30 15:21:19
1899-12-30 15:22:19
1899-12-30 15:23:19
1899-12-30 15:24:19
1899-12-30 16:40:26
1899-12-30 16:58:30Message was edited by:
student14

What is the exact field type, how are you selecting the date, how are you retrieving the date, in which object are you putting the date and how are you printing it?

Similar Messages

  • SQL Performance issue: Using user defined function with group by

    Hi Everyone,
    im new here and I really could need some help on a weird performance issue. I hope this is the right topic for SQL performance issues.
    Well ok, i create a function for converting a date from timezone GMT to a specified timzeone.
    CREATE OR REPLACE FUNCTION I3S_REP_1.fnc_user_rep_date_to_local (date_in IN date, tz_name_in IN VARCHAR2) RETURN date
    IS
    tz_name VARCHAR2(100);
    date_out date;
    BEGIN
    SELECT
    to_date(to_char(cast(from_tz(cast( date_in AS TIMESTAMP),'GMT')AT
    TIME ZONE (tz_name_in) AS DATE),'dd-mm-yyyy hh24:mi:ss'),'dd-mm-yyyy hh24:mi:ss')
    INTO date_out
    FROM dual;
    RETURN date_out;
    END fnc_user_rep_date_to_local;The following statement is just an example, the real statement is much more complex. So I select some date values from a table and aggregate a little.
    select
    stp_end_stamp,
    count(*) noi
    from step
    where
    stp_end_stamp
    BETWEEN
    to_date('23-05-2009 00:00:00','dd-mm-yyyy hh24:mi:ss')      
    AND
    to_date('23-07-2009 00:00:00','dd-mm-yyyy hh24:mi:ss')
    group by
    stp_end_stampThis statement selects ~70000 rows and needs ~ 70ms
    If i use the function it selects the same number of rows ;-) and takes ~ 4 sec ...
    select
    fnc_user_rep_date_to_local(stp_end_stamp,'Europe/Berlin'),
    count(*) noi
    from step
    where
    stp_end_stamp
    BETWEEN
    to_date('23-05-2009 00:00:00','dd-mm-yyyy hh24:mi:ss')      
    AND
    to_date('23-07-2009 00:00:00','dd-mm-yyyy hh24:mi:ss')
    group by
    fnc_user_rep_date_to_local(stp_end_stamp,'Europe/Berlin')I understand that the DB has to execute the function for each row.
    But if I execute the following statement, it takes only ~90ms ...
    select
    fnc_user_rep_date_to_gmt(stp_end_stamp,'Europe/Berlin','ny21654'),
    noi
    from
    select
    stp_end_stamp,
    count(*) noi
    from step
    where
    stp_end_stamp
    BETWEEN
    to_date('23-05-2009 00:00:00','dd-mm-yyyy hh24:mi:ss')      
    AND
    to_date('23-07-2009 00:00:00','dd-mm-yyyy hh24:mi:ss')
    group by
    stp_end_stamp
    )The execution plan for all three statements is EXACTLY the same!!!
    Usually i would say, that I use the third statement and the world is in order. BUT I'm working on a BI project with a tool called Business Objects and it generates SQL, so my hands are bound and I can't make this tool to generate the SQL as a subselect.
    My questions are:
    Why is the second statement sooo much slower than the third?
    and
    Howcan I force the optimizer to do whatever he is doing to make the third statement so fast?
    I would really appreciate some help on this really weird issue.
    Thanks in advance,
    Andi

    Hi,
    The execution plan for all three statements is EXACTLY the same!!!Not exactly. Plans are the same - true. They uses slightly different approach to call function. See:
    drop table t cascade constraints purge;
    create table t as select mod(rownum,10) id, cast('x' as char(500)) pad from dual connect by level <= 10000;
    exec dbms_stats.gather_table_stats(user, 't');
    create or replace function test_fnc(p_int number) return number is
    begin
        return trunc(p_int);
    end;
    explain plan for select id from t group by id;
    select * from table(dbms_xplan.display(null,null,'advanced'));
    explain plan for select test_fnc(id) from t group by test_fnc(id);
    select * from table(dbms_xplan.display(null,null,'advanced'));
    explain plan for select test_fnc(id) from (select id from t group by id);
    select * from table(dbms_xplan.display(null,null,'advanced'));Output:
    PLAN_TABLE_OUTPUT
    Plan hash value: 47235625
    | Id  | Operation          | Name | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT   |      |    10 |    30 |   162   (3)| 00:00:02 |
    |   1 |  HASH GROUP BY     |      |    10 |    30 |   162   (3)| 00:00:02 |
    |   2 |   TABLE ACCESS FULL| T    | 10000 | 30000 |   159   (1)| 00:00:02 |
    Query Block Name / Object Alias (identified by operation id):
       1 - SEL$1
       2 - SEL$1 / T@SEL$1
    Outline Data
      /*+
          BEGIN_OUTLINE_DATA
          FULL(@"SEL$1" "T"@"SEL$1")
          OUTLINE_LEAF(@"SEL$1")
          ALL_ROWS
          OPTIMIZER_FEATURES_ENABLE('10.2.0.4')
          IGNORE_OPTIM_EMBEDDED_HINTS
          END_OUTLINE_DATA
    Column Projection Information (identified by operation id):
       1 - (#keys=1) "ID"[NUMBER,22]
       2 - "ID"[NUMBER,22]
    34 rows selected.
    SQL>
    Explained.
    SQL>
    PLAN_TABLE_OUTPUT
    Plan hash value: 47235625
    | Id  | Operation          | Name | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT   |      |    10 |    30 |   162   (3)| 00:00:02 |
    |   1 |  HASH GROUP BY     |      |    10 |    30 |   162   (3)| 00:00:02 |
    |   2 |   TABLE ACCESS FULL| T    | 10000 | 30000 |   159   (1)| 00:00:02 |
    Query Block Name / Object Alias (identified by operation id):
       1 - SEL$1
       2 - SEL$1 / T@SEL$1
    Outline Data
      /*+
          BEGIN_OUTLINE_DATA
          FULL(@"SEL$1" "T"@"SEL$1")
          OUTLINE_LEAF(@"SEL$1")
          ALL_ROWS
          OPTIMIZER_FEATURES_ENABLE('10.2.0.4')
          IGNORE_OPTIM_EMBEDDED_HINTS
          END_OUTLINE_DATA
    Column Projection Information (identified by operation id):
       1 - (#keys=1) "TEST_FNC"("ID")[22]
       2 - "ID"[NUMBER,22]
    34 rows selected.
    SQL>
    Explained.
    SQL> select * from table(dbms_xplan.display(null,null,'advanced'));
    PLAN_TABLE_OUTPUT
    Plan hash value: 47235625
    | Id  | Operation          | Name | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT   |      |    10 |    30 |   162   (3)| 00:00:02 |
    |   1 |  HASH GROUP BY     |      |    10 |    30 |   162   (3)| 00:00:02 |
    |   2 |   TABLE ACCESS FULL| T    | 10000 | 30000 |   159   (1)| 00:00:02 |
    Query Block Name / Object Alias (identified by operation id):
       1 - SEL$F5BB74E1
       2 - SEL$F5BB74E1 / T@SEL$2
    Outline Data
      /*+
          BEGIN_OUTLINE_DATA
          FULL(@"SEL$F5BB74E1" "T"@"SEL$2")
          OUTLINE(@"SEL$2")
          OUTLINE(@"SEL$1")
          MERGE(@"SEL$2")
          OUTLINE_LEAF(@"SEL$F5BB74E1")
          ALL_ROWS
          OPTIMIZER_FEATURES_ENABLE('10.2.0.4')
          IGNORE_OPTIM_EMBEDDED_HINTS
          END_OUTLINE_DATA
    Column Projection Information (identified by operation id):
       1 - (#keys=1) "ID"[NUMBER,22]
       2 - "ID"[NUMBER,22]
    37 rows selected.

  • Using java.sql.Time: Offset by 1 hour?

    I have a problem understanding the behaviour of the java.sql.Time class. As the following example shows.
    61952000 ms is the Time 17:12:32. If i feed a Time-Object with it and print the time or date I'll get "18:12:32",
    an offset of 1h. But if I use time.getTime(), I get my ms value which equals 17:12:32.
    As my timezone shows, I have a GMT offset of one hour. But why does the getTime() method not calculate
    the timezone offset to the ms?
    Time time = new Time(61952000);
            System.out.println(time.getTime() / 3600 / 1000); // 17 hours
            System.out.println( new Date(time.getTime()) ); // Thu Jan 01 18:12:32 CET 1970
            System.out.println(time.getTime()); // 61952000
            System.out.println(time); // 18:12:32
            System.out.println(Calendar.getInstance().getTimeZone());
             *  sun.util.calendar.ZoneInfo[id="Europe/Berlin",offset=3600000,dstSavings=3600000,
             *  useDaylight=true,transitions=143,lastRule=java.util.SimpleTimeZone[id=Europe/Berlin,
             *  offset=3600000,dstSavings=3600000,useDaylight=true,startYear=0,startMode=2,startMonth=2,
             *  startDay=-1,startDayOfWeek=1,startTime=3600000,startTimeMode=2,endMode=2,endMonth=9,
             *  endDay=-1,endDayOfWeek=1,endTime=3600000,endTimeMode=2]]
             */

    Thanks for your reply. But please take a look at the following code snippet. It intends to add a Timestamp representing the
    start of a day (time component 00:00:00) to a time component (having Date to 01-01-1970):
            Time time = new Time(61952000);
            Calendar c = Calendar.getInstance();
            System.out.println("time: " + time); // 18:12:32
            c.set(Calendar.HOUR_OF_DAY, 0);
            c.set(Calendar.SECOND, 0);
            c.set(Calendar.MINUTE, 0);
            c.set(Calendar.MILLISECOND, 0);
            System.out.println("date: " + c.getTime()); // Fri Apr 03 00:00:00 CEST 2009
            Timestamp timestamp = new Timestamp( c.getTimeInMillis() + time.getTime() );
            Date d = new Date(timestamp.getTime() );
            System.out.println("\nresult: " + d); // result: Fri Apr 03 17:12:32 CEST 2009If I assume that getting and setting the milis always deals with timezone independent values, but operating methods
    like toString(), getHour() etc use the timezone, then I can not explain the result (last line): 17:12:32 is the timezone
    independend value. Should'nt d.toString() show the timezone dependend value of 18:12:32?

  • Time issue- urgnt

    HI Expert !
    I m using this code .
    LTIME TYPE SY-UZEIT
    T1 TYPE SY-UZEIT VALUE 030000,
    T2 TYPE SY-UZEIT VALUE 050000,
    BUT WHEN I M USING T1 AND T2  in loop ( if  statement ),ITS value r
    T1 =  082000.
    t2  = 131100 .
    if  t1(6)  t2(6 )
    ltime (6 ).
    then ok . but in this i wont be able to make comparison in if statement
    how i can resolve this time issue
    i dont want to include timings between 3.00 a.m and 5.00 ,
    for this i have used this code but its not updating data for any employee , is this code correct or not.
    OPEN DATASET PA_FILE FOR INPUT IN TEXT MODE ENCODING DEFAULT.
    DO.
    READ DATASET PA_FILE INTO REC.
    CLEAR WA_PUNCHES.
    IF SY-SUBRC <> 0.
    EXIT.
    ENDIF.
    WRITE: / REC.
    if NOT ( WA_SCORE-LTIME GE T1 AND WA_SCORE-LTIME LE T2 ) .
    AND
    ***( WA_SCORE-TERID NE TR3 AND
    ***WA_SCORE-TERID NE TR4 AND
    ***WA_SCORE-TERID NE TR5 AND
    ***WA_SCORE-TERID NE TR6 AND
    ***WA_SCORE-TERID NE TR7 AND
    ***WA_SCORE-TERID NE TR8 ) .
    WA_SCORE-PERNR = REC+0(8) .
    WA_SCORE-LDATE = REC+9(8) .
    WA_SCORE-LTIME = REC+18(6) .
    WA_SCORE-CANID = REC+25(8) .
    WA_SCORE-TERID = REC+34(4) .
    APPEND WA_SCORE TO IT_SCORE.
    ELSE .
    EXIT .
    ADD 1 TO COUNT.
    ENDIF .
    ENDDO.
    plz help me . its very imp. program .
    thanks

    Hi,
    Pass values in quotes
    T1 TYPE SY-UZEIT VALUE '030000',
    T2 TYPE SY-UZEIT VALUE '050000',
    Can you please check once again after making this change in debug mode, values of T1, T2 and LTIME.
    ashish

  • How to track the sql commands issued against database

    Hello, We are using an interface developed by oracle forms. Its giving some error while pressing an icon. I can not able to trace out from where it arises. This error is displayed by form developed by oracle forms. I dont have source code to track it. I would like to know , which SQL statement rises the error, so that I can update the oracle object and can able to solve the problem if I can able to find the exect SQL statment issued before the error was displayed. kindly help me . thanks.

    habfat wrote:
    Hello, We are using an interface developed by oracle forms. Its giving some error while pressing an icon. I can not able to trace out from where it arises. This error is displayed by form developed by oracle forms. I dont have source code to track it. I would like to know , which SQL statement rises the error, so that I can update the oracle object and can able to solve the problem if I can able to find the exect SQL statment issued before the error was displayed. kindly help me . thanks.Hmm, well kind of a silly but still, if you don't have source code of the form( you said so) so even if you would come to know what statement is raising the error, how would you go and edit it ? Did I miss some thing? And you asked for a sql statement ? How did you come to know that its a sql statement that is causing the error? And if that's actually a sql statement error, isn't it associated with a meaningful message ?
    Find the developer who coded the application, he would be the best person to track the error and tell you its resolution IMO.
    HTH
    Aman....

  • Time issue seems odd to me

    I put a secondary domain and po at a remote location - running 8.03 on Sles/Oes and moved all of the "local" users to that po.
    while everything seems to run ok we have a weird time issue.
    Mail into and out of the new mailboxes shows a three and a half hour time difference both in the date column in the groupwise client and in the printed header of the email.
    The odd thing is that if I go to the properties of the email - the Creation date and the File date and time are both correct.
    I can't see any time issues with the servers (primary or secondary) and especially something that would be 3:30 minutes off
    there is a timezone difference between the pri and sec but that's just 1 hour.
    Any thoughts?
    As a workaround I have had my users add the creation column to see when they actually received the email as our clients have time critical projects.
    Thanks
    Dennis

    Danita,
    Thanks for the reply - Oh how I wish it were that easy - I've checked and double checked the PO object and the domain object - both say US eastern time.
    If I send email from a mailbox on the secondary to the primary - everything is correct (a 1 hour time difference - Eastern to Central)
    If I send mail from a mailbox on the primary to the secondary - it shows up right away, but says 3:30 minutes later than it should (in Date/Time, but not in Created)
    If I send email from a mailbox on the secondary to a GMail account - the header shows the 3:30 offset, but the properties of the mail shows correctly.
    I would be happy to send email from that po to anyone that wants to see for themselves.
    Other than the PO Object and the DOM object - Where should I be looking for a time difference
    and how would it be getting UTC minus 30 minutes - - Is there a special timezone out there for Hy Brasil?
    The workstations all get their time settings from "time.windows.com" the windows default.
    Thanks for looking into this - I just hope that I can get it figured out because as small of an issue that I think it is (they get their email, it just looks like it gets read before they officially receive it)
    but it seems that this office uses the received time to track how long it takes them to do their work.
    Dennis

  • Real time issue

    Hi all,
    Can any body plz send me some FICO real time issue on [email protected]
    and plz tell me hw shld I prepare for interview
    Thanks & Regards
    Vaibhav

    Hi Balraj,
    In the normal practice, developers will try to find the similer infocube (as per the requirement) in the Business content. But always you will not be lucky to find such infocube in Business content. You need to create at your own to suite the business requirements. Regarding the characteristcs & key figure, it 's again depend on the requirements. Calculated object can be assign as key figure like. Sales qty, revenue & net sales etc. where as Dimesion (characteritcs) will be purely depends on the reporting point of view. Like Customer, Material & Sales Document type etc.
    Hope this will help you !
    Thanks,
    Sanjiv

  • Execution Time Issue

    Help Please!!!
    I've been searching for an execution time issue in our application for a while now. Here is some background on the application:
    Collects analog data from a cDAQ chassis with a 9205 at 5kHz
    Data is collected in 100ms chunks
    Some of the data is saved directly to a TDMS file while the rest is averaged for a single data point. That single data point is saved to disk in a text file every 200ms.
    Problem: During operation, the VI that writes the data to the text file will periodically take many hundreds of milliseconds to execute. Normal operation execution times are on the order of 1ms or less. This issue will happen randomly during operation. It's usually many seconds between times that this occurs and it doesn't seem to have any pattern to when the event happens.
    Attached is a screenshot of the VI in question. The timing check labeled "A" is the one that will show the troubling execution time. All the other timing checks show 0ms every time this issue occurs. I simply can't see what else is holding this thing up. The only unchecked subVI is the "append error call chain" call. I've gone through the heirarchy of that VI and ensured that everything is set for reentrant execution. I will check that too soon, but I really don't expect to find anything.
    Where else can I look for where the time went? It doesn't seem to make sense.
    Thanks for reading!
    Tim
    Attachments:
    Screen Shot 2013-09-06 at 9.32.46 AM.png ‏87 KB

    You should probably increase how much data you write with a single Write to Text File.  Move the Write to Text File out of the FOR loop.  Just have the data to be written autoindex to create an array of strings.  The Write to Text File will accept the array of strings directly, writing a single line for each element in the arry.
    Another idea I am having is to use another loop (yes another queue as well) for the writing of the file.  But you put the Dequeue Element inside of another WHILE loop.  On the first iteration of this inside loop, set the timeout to something normal or -1 for wait forever.  Any further iteration should have a timeout of 0.  You do this with a shift register.  Autoindex the read strings out of the loop.  This array goes straight into the Write to Text File.  This way you can quickly catch up when your file write takes a long time.
    NOTE:  This is just a very quick example I put together. It is far from a complete idea, but it shows the general idea I was having with reading the queue.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines
    Attachments:
    Write all data on queue.png ‏16 KB

  • PL/SQL speed issues when using a variable

    I have a very strange issue that is causing problems.
    I am running Golden connecting to a 11g database.
    I created a procedure to insert records into a table based on a query. The source query includes variables that I have populated prior to the insert statement. The problem is that if I use the variable for one very specific where statement, the statement goes from running in less than 1 second, to running in 15 minutes. It gets even more strange though. Not only does a 2nd variable not cause any problems, the exact same variable in the same statement works fine.
    This procedure takes 15 minutes to run.
    declare
        v_start_period date;
        v_end_period date;
    begin
        select add_months(trunc(sysdate,'mm'), -1), trunc(sysdate,'mm')
        into v_start_period, v_end_period
        from dual;
        insert into RESULTS_TABLE
                (first_audit_date, last_audit_date,
                data_column1, data_column2, data_column3)
            select
                a.first_audit_date, a.last_audit_date,
                b.data_column1, b.data_column2, b.data_column3
            from
                SOURCE_TABLE_1 b,
                (select marker_id, min(action_time) as first_audit_date, max(action_time) as last_audit_date
                    from SOURCE_TABLE_2
                    where action_time >= v_start_period and action_time < v_end_period
                    group by marker_id) a
            where b.marker_id = a.marker_id
                and exists (select 1 from SOURCE_TABLE_2
                    where marker_id = b.marker_id
                    and action_time >= v_start_period and action_time < v_end_period
                    and action_type = 'XYZ');
        commit;
    end;This procedure runs in less than 1 second, yet returns the exact same results.
    declare
        v_start_period date;
        v_end_period date;
    begin
        select add_months(trunc(sysdate,'mm'), -1), trunc(sysdate,'mm')
        into v_start_period, v_end_period
        from dual;
        insert into RESULTS_TABLE
                (first_audit_date, last_audit_date,
                data_column1, data_column2, data_column3)
            select
                a.first_audit_date, a.last_audit_date,
                b.data_column1, b.data_column2, b.data_column3
            from
                SOURCE_TABLE_1 b,
                (select marker_id, min(action_time) as first_audit_date, max(action_time) as last_audit_date
                    from SOURCE_TABLE_2
                    where action_time >= v_start_period and action_time < trunc(sysdate,'mm')
                    group by marker_id) a
            where b.marker_id = a.marker_id
                and exists (select 1 from SOURCE_TABLE_2
                    where marker_id = b.marker_id
                    and action_time >= v_start_period and action_time < v_end_period
                    and action_type = 'XYZ');
        commit;
    end;The only difference between the two is where I replace the first v_end_period variable with trunc(sysdate,'mm').
    I've been googling for possible solutions and keep running into something called "parameter sniffing". It appears to be a SQL Server issue though, as I cannot find solutions for Oracle. I tried nesting the insert statement inside it's own procedure with new variables populated by the old variables, but nothing changed.
    Edited by: user_7000017 on Jan 8, 2013 9:45 AM
    Edited by: user_7000017 on Jan 8, 2013 9:52 AM Put the code in code tags.

    You are not describing procedures. You are listing anonymous PL/SQL blocks.
    As for the code - this approach to assigning PL/SQL variables are highly questionable. As the functions are native PL/SQL functions too, there is no need to parse and execute a SQL cursor, do context switching, in order to assign values to PL/SQL variables.
    This is wrong:
    select
        add_months(trunc(sysdate,'mm'), -1), trunc(sysdate,'mm')
        into v_start_period, v_end_period
    from dual;This is correct:
    v_start_period := add_months(trunc(sysdate,'mm'), -1);
    v_end_period := trunc(sysdate,'mm');Just as you would not use +"select 1 into plVariable from dual;+", instead of a standard variable assignment statement like +"plVariable := 1;"+.
    As for the performance/execution difference. Does not make sense. I suggest simplifying the code in order to isolate the problem. For example, take that in-line SQL (aliased as a in the main SQL) and create a testcase where it uses the function, versus a PL/SQL bind variable with the same data type and value as that returned by the function. Examine and compare the execution plans.
    Increase complexity (if no error) and repeat. Until the error is isolated.
    The 1st step in any troubleshooting, is IDENTIFYING the problem. Without knowing what the problem is, how can one fix it?

  • Time issues? time zone settings appear in two places

    If you leave the default "set time and date automatically", you see the time zone support below and you can check it or uncheck. You can then set your time zone there. But if you uncheck the automatic date and time, you get another time zone choice and the default is Cupertino, of course. I wonder if that's the problem with some of these time issues.
    I've since unchecked automatic date and time, set my city's time zone, then rechecked automatic. The only weirdness I've seen was with an excel spreadsheet where the time was correctly shown on my mac, but not on the iphone. Unfortunately I don't have that sheet anymore or I'd try again to see if it works now.
    Just a thought.

    I noticed the same thing and did the same thing you did because my time was off by several hours each time I turned the phone on...after it being off overnight. When it was off by only 1 hour I could turn the Auto OFF then 'tap' the timezone (already set to the correct city) and the time would instantly correct itself. Then I'd turn Auto back ON.
    Turns out that my time issue was related to having the SIM PIN enabled. Once I disabled that, the time's been correct every day.

  • Real  time issues

    hi there,
    can any one share some of the issues that have been dealt with in real time. i.e.during blue print stage, <b>especially in realisation stage</b>, final preparation stage
    puhlease answer this question immediately

    Hi Medasani,
    Real time issue you can get it from the Sap support consultants. Hence, getting all the information is very difficult.
    In what basis you are asking let me your requirements.
    For Example :- Tolerance limits is has to increase to Rs.1 to Rs.100. for employees and vendor / customer. This is the issue from client.
    How you will decide that to increase.
    First you should understand the clinet work flow and get the approval from client end (core Team) then you have to increase meanwhile you have to decide the % also.
    Oba3 /Oba2
    Warm Regards,
    Sivakumar Sathiyamoorthy

  • Oracle 11g - External Table/SQL Developer Issue?

    Oracle 11g - External Table/SQL Developer Issue?
    ==============================
    I hope this is the right forum for this issue, if not let me, where to go.
    We are using Oracle 11g (11.2.0.1.0) on (Platform : solaris[tm] oe (64-bit)), Sql Developer 3.0.04
    We are trying to use oracle external table to load text files in .csv format. Here is our data look like.
    ======================
    Date1,date2,Political party,Name, ROLE
    20-Jan-66,22-Nov-69,Democratic,"John ", MMM
    22-Nov-70,20-Jan-71,Democratic,"John Jr.",MMM
    20-Jan-68,9-Aug-70,Republican,"Rick Ford Sr.", MMM
    9-Aug-72,20-Jan-75,Republican,Henry,MMM
    ------ ALL NULL -- record
    20-Jan-80,20-Jan-89,Democratic,"Donald Smith",MMM
    ======================
    Our Expernal table structures is as follows
    CREATE TABLE P_LOAD
    DATE1 VARCHAR2(10),
    DATE2 VARCHAR2(10),
    POL_PRTY VARCHAR2(30),
    P_NAME VARCHAR2(30),
    P_ROLE VARCHAR2(5)
    ORGANIZATION EXTERNAL
    (TYPE ORACLE_LOADER
    DEFAULT DIRECTORY P_EXT_TAB_D
    ACCESS PARAMETERS (
    RECORDS DELIMITED by NEWLINE
    SKIP 1
    FIELDS TERMINATED BY "," OPTIONALLY ENCLOSED BY '"' LDRTRIM
    REJECT ROWS WITH ALL NULL FIELDS
    MISSING FIELD VALUES ARE NULL
    DATE1 CHAR (10) Terminated by "," ,
    DATE2 CHAR (10) Terminated by "," ,
    POL_PRTY CHAR (30) Terminated by "," ,
    P_NAME CHAR (30) Terminated by "," OPTIONALLY ENCLOSED BY '"' ,
    P_ROLE CHAR (5) Terminated by ","
    LOCATION ('Input.dat')
    REJECT LIMIT UNLIMITED;
         It created successfully using SQL Developer
    Here is the issue.
    It is not loading the records, where fields are enclosed in '"' (Rec # 2,3,4,7)
    It is loading all NULL value record (Rec # 6)     
    *** If we remove the '"' from input data, it loads all records including all NULL records
    Log file has
    KUP-04021: field formatting error for field P_NAME
    KUP-04036: second enclosing delimiter not found
    KUP-04101: record 2 rejected in file ....
    Our questions
    Why did "REJECT ROWS WITH ALL NULL FIELDS" not working?
    Why did Terminated by "," OPTIONALLY ENCLOSED BY '"' not working?
    Any idea?
    Thanks in helping.

    I don't think this is a SQLDeveloper issue. You will get better answers in the Database - General or perhaps SQL and PL/SQL forums.

  • Java.sql.Time not working correctly

    Hi guys,
    I have the following code which is used to put clients session data in my database.
    long logged_in_time = p.getCreatedTime();
                long logged_out_time = System.currentTimeMillis();
                long duration = logged_out_time - logged_in_time;
                System.out.println("LOGGED IN: " + logged_in_time);
                System.out.println("LOGGED OUT: " + logged_out_time);
                System.out.println("DURATION: " + duration);
                System.out.println("DURATION TIME: " + new Time(duration));and this is the result:
    LOGGED IN: 1141394617474
    LOGGED OUT: 1141394638634
    DURATION: 21160
    DURATION TIME: 01:00:21
    Does anyone know why java.sql.Time adds an hour? The duration in milliseconds equals 21 seconds but when I constuct the Time obj I get 1 hour 21 seconds.
    Any help would be great.
    Alex

    Probably because your default timezone is not GMT, but GMT+1 (e.g. CET.)
    The java.util.Date (and subclasses) wraps a long value representing the number of miliseconds elapsed since January 1, 1970, 00:00:00 GMT.
    As a consequence a new Date(0) will represent the date above, which is equivalent to January 1, 1970, 01:00:00 CET.
    You might use a DateFormat and specify the TimeZone.
    Example:        Time time = new Time(21160);
            DateFormat format = DateFormat.getTimeInstance();
            format.setTimeZone(TimeZone.getTimeZone("CET"));
            System.out.println(format.format(time));
            format.setTimeZone(TimeZone.getTimeZone("GMT"));
            System.out.println(format.format(time));Will output:
    01:00:21
    00:00:21

  • How to combine sql.Date with sql.Time into one?

    I have a database where I keep dates and times separately, and getting date only and time only out of a java.util.Date is no problem thanks to the classes java.sql.Date and java.sql.Time. However, I need to read these values back in, put them back together, and then do date comparisons with java.util.GregorianCalendar. I tried just adding the millisecond long values together but that didn't seem to work, and I've tried setting the year, month, date, hours, minutes and seconds individually into a GregorianCalendar but I haven't figured that out yet. Certain queries work out better keeping the date and time separate in the database and it takes less bytes than a timestamp, so please don't suggest I use a timestamp!
    Thanks for your help!
    Stephen

    You can add the milliseconds (ms), but you need to use just part of it. For this example, let X be one more than the maximum number of units in time and also the minimum number of units in date. If we were using hours instead of ms X would be 24.
    t = total ms from time
    d = total ms from date
    T = new combined time
    T = ((d / X) * X) + (T % X);Add (the date, rounded to the nearest day) and (the portion of time which is less than a day).

  • [SOLVED] Yet another time issue...

    Hi there,
    I'm having some crazy, hair pulling, head banging UTC time issues on both my dual boot (Arch & Windows 8) desktop and single boot laptop.
    I've been searching and following a mulitude of old threads and the official Wiki guide, however, I simply cannot get UTC time to stay correct between reboots. I've installed Arch a fair few times now, both before and after the switch to systemd and in dual and single boot setups and have never had time related issues like this before...
    Here's a run down of the whole sorry story....
    Fresh install - set time with hwclock --systohw utc as suggested in the beginners guide.
    First boot - time an hour out - huh? cat /etc/adjtime and ls -l /etc/localtime - everything as it should be... UTC and symlink to /usr/share/zoneinfo/Europe/London. Nonetheless I duly follow the Time guide on the wiki, get to know timedatectl a bit, and soon after, time is set to be correct. Great.
    Reboot. Time an hour out. Whaaaa??. Start googling, finding a plethora of bbs links to others with similar issues, decide to use NTP. Install, ntpd -qg. All good again. Time right. Phew...
    Reboot. Nope. Arrrrgggghhhh. (Bare in mind - at this point I haven't even booted the Windows 8 disc, and I went through the exact same process on my Arch only laptop...)
    More googling, thread reading. Find out that hwclock and ntp might be in conflict. Delete /etc/adjtime, reinstall tzdata, re-follow Time article to the letter and reenable NTP to start at boot.
    Reboot - time is foward an hour yet again. Bang head repeatedly on desk. Then suddenly - 10 mins or so after boot - NTP kicks in, and time is magically goes back an hour to the correct time! Surely NTP should be doing this early in the boot process, not 10 minutes after? But OK, at least something is happening...
    Next I dare to boot into Windows, and yup, time an hour out. Expected, but frustrating nonetheless. Add the registry tweak as suggested in the guide, and turn off the Windows time synchronisation. During which I noticed that Windows 8 time is set to UTC by default, not localtime, which is what the wiki says. Is this a Windows 8 thing?
    I can't help thinking, that if this is the case, and the Wiki advise is written under the assumption that Windows time is always localtime, that perhaps this is the route of my problem....
    Anyway, Windows time all good now, reboot Arch, time again wrong untill NTP finally kicks in - sigh. Reboot to Windows. Time an hour back. Gaaaahhhh - WTF?!! reset it to be correct. Try again. Same thing. Oops, forgot to mention that on each reboot, I check the BIOS clock, which remains persistently correct during the whole debarkle...
    Ok, so I try without the registry hack and turn Windows sync back on. Still fucked. I try various combinations of the two, I try resetting Arch time over and over again. With NTP - late sync. With hwclock only, or both hwclock & NTP - totally fucked! Eventually, I give up on UTC in Arch, set it localtime, delete registry key, turn Windows time sync back on, and thus far all good......
    TL;DR - couldn't get hwclock to set UTC time correctly across reboots. NTP worked (sort of), but after each reboot it would take ten minutes for the time to sync and the clock to move back an hour to the correct time. Localtime just works...
    My question is - why is the wiki (and the timedatectl status output for that matter) - so adamant that we should use UTC? From what I can gather, as long as I boot Windows around the DST time. or manually move the clock forward or back an hour - all should be well, no? Or are there other issues that I may run into that I've missed? The thing I'm most concerned about is data corruption due to timestamp issues...
    Also, why does the wiki repeatedly say that Windows uses localtime, when this doesn't appear to be the case in Eight? Does the wiki need updating or is Windows lying to me? I know which I'd put my money on ;-)
    Finally can anyone explain why my time was always an hour forward after a reboot, even when the time was set correctly before, the BIOS showed the correct time, and NTP was in use?
    Sorry for the crazy long posting, but this issue has been driving me totally batty!! Any light-shedding greatfully appreciated :-)
    Last edited by knowayhack (2013-08-10 15:24:09)

    Ok, so I set the clock back an hour in the BIOS, booted Windows - time right - YAY.
    Rebooted Arch - time right. OMFG - pure joy!!!
    I have to say, I still find it odd that this is how it works, and would like to confirm that things are looking as they should in the output from the following commands....
    toby@archy ~ > timedatectl status
          Local time: Sat 2013-08-10 15:42:56 BST
      Universal time: Sat 2013-08-10 14:42:56 UTC
            Timezone: Europe/London (BST, +0100)
         NTP enabled: n/a
    NTP synchronized: no
    RTC in local TZ: no
          DST active: yes
    Last DST change: DST began at
                      Sun 2013-03-31 00:59:59 GMT
                      Sun 2013-03-31 02:00:00 BST
    Next DST change: DST ends (the clock jumps one hour backwards) at
                      Sun 2013-10-27 01:59:59 BST
                      Sun 2013-10-27 01:00:00 GMT
    toby@archy ~ > sudo hwclock --debug
    sudo: timestamp too far in the future: Aug 10 16:39:24 2013
    We trust you have received the usual lecture from the local System
    Administrator. It usually boils down to these three things:
        #1) Respect the privacy of others.
        #2) Think before you type.
        #3) With great power comes great responsibility.
    [sudo] password for toby:
    hwclock from util-linux 2.23.2
    Using /dev interface to clock.
    Last drift adjustment done at 1376148264 seconds after 1969
    Last calibration done at 1376148264 seconds after 1969
    Hardware clock is on UTC time
    Assuming hardware clock is kept in UTC time.
    Waiting for clock tick...
    ...got clock tick
    Time read from Hardware Clock: 2013/08/10 14:43:20
    Hw clock time : 2013/08/10 14:43:20 = 1376145800 seconds since 1969
    Sat 10 Aug 2013 15:43:20 BST  -0.953640 seconds
    Is it OK to now reinstall NTP to keep the clock in sync on Arch, and are the Windows reg tweaks still necessary on Windows 8?
    Thank you guys SOOO much for all the unbelievabley speedy help on this issue - you have no idea how much this has been stressing me out!!
    Last edited by knowayhack (2013-08-10 14:54:31)

Maybe you are looking for

  • Macbook Pro Mid 2010 keeps on crashing after update

    I updated my macbook pro mid 2010 and now it randomly crashes! Any help is appreciated. Thank you Anonymous UUID:       D4BFA1B4-3FC3-CB21-4ABA-A50D9CE38F8D Tue Jan 14 14:38:42 2014 panic(cpu 0 caller 0xffffff7f9e5fffac): "GPU Panic: [<None>] 5 3 7f

  • Value Flow Monitor in ML

    Hi Experts, Can you explain to me how the Value Flow Monitor transaction CKMVFM works in ML. How to correct the unallocated, and the undistribuited amounts?

  • How to...Order by

    Hi all, create table tt_1 (col varchar2(10)); insert into TT_1 values('AAA'); insert into tt_1 values('BBB'); insert into tt_1 values('CCC'); insert into TT_1 values('DDD'); insert into tt_1 values('TEST'); insert into tt_1 values('UUUU'); insert int

  • Suitcase 3

    Hello, since I installed Suitcase 3, the following occurs : - I doubleclick an illustrator CS 5 file and see in a blink the fonts load - then the document opens and I get the "find font" window which indicates font missing - without changing any font

  • I tunes is not workin.Windows is serchin a solution

    I tunes is not workin.Windows is serching a solution.Thanks