Timestamp fractional seconds problem

Hi,
I have a table with a timestamp column and I create an OCCI Timestamp variable in C++ and initialize the fractional seconds from a tv_usec variable in the structure returned by gettimeofday on Solaris. This is supposed to be microseconds and as such max 999999 in value before ticking over a second. I created the column without a size modifier and my understanding is the default to be 6 which indicates the size of the fractional seconds. However, when inserting values into the table from the C++ app, it would appear as if the lower 3 positions are discarded and the value right-shifted by 3 positions. This manifests when I select from the table with FF6 I will always get 000### meaning the first three digits are always zero and the ### will always be the most significant digits of my original tv_usec. For example inserting a fractional seconds 123456 and selecting afterwards I get 000123. Could anyone cast some light on this behavior ?
Regards

Unfortunately it takes longer to resolve the problem through support than I have available so I used a combination of alternative types to simulate a timstamp

Similar Messages

  • Change the timestamp fractional seconds precision default

    How do you change the database level default for fractional seconds precision from 6 to 9 so the systimestamp function will show all 9 digits for fractional seconds?
    Edited by: PickLPeach on Aug 17, 2011 11:32 AM
    Edited by: PickLPeach on Aug 17, 2011 11:33 AM
    Edited by: PickLPeach on Aug 17, 2011 11:34 AM
    Edited by: PickLPeach on Aug 17, 2011 12:02 PM

    AIX 5.3 is a IBM version of UNIX which we have running on the PowerPC processors. The PowerPC processor does supply nanosecond information.
    Our issue is three fold.
    1) Make the PowerPC processor provide the nanosecond information. That was found at this link ==> http://publib.boulder.ibm.com/infocenter/pseries/v5r3/index.jsp?topic=/com.ibm.aix.basetechref/doc/basetrf2/read_real_time.htm
    2) Once we supply nanosecond time from the operating system, how do we make Oracle sysdate and systimestamp use this time?
    3) Once Oracle sysdate and systimestamp is using the nanosecond information, what database, system or session parameter must we change to make our default fractional seconds precision of 6 become 9 system wide?
    Edited by: PickLPeach on Aug 18, 2011 6:27 AM

  • Fractional seconds in conversion to XML dateTime are 000

    Hello,
    when converting a Java Date (via XMLGregorianCalendar) to XML (xs:dateTime) using WLS 10.3, the XML includes the fractional seconds ".000".
    Example: <AppointmentStart>2009-03-18T16:00:00.000Z</AppointmentStart>
    According to the XML Schema Spec (http://www.w3.org/TR/xmlschema-2/) the canonical representation of fractional seconds should not include trailing zeros.
    Is this a bug in WLS, or am I misunderstanding something?
    Roger
    PS: From the spec:
    3.2.7.2 Canonical representation
    Except for trailing fractional zero digits in the seconds representation, '24:00:00' time representations, and timezone (for timezoned values), the mapping from literals to values is one-to-one. Where there is more than one possible representation, the canonical representation is as follows:
    The 2-digit numeral representing the hour must not be '24';
    The fractional second string, if present, must not end in '0';
    for timezoned values, the timezone must be represented with 'Z' (All timezoned dateTime values are UTC.).

    Hi Bill,
    I'm not sure how valid my test is, but I ran a quick test where I created a table with a timestamp column, inserted a row, and then retrieved the row. I did not see any difference with 9i and 10g, but I only have 9.2.0.8 and 10.2.0.4 versions so maybe it was a patch thing, but I have found no references to this change. Of course, that doesn't mean that there wasn't a change, and/or maybe there was something specific to a particular port, etc.
    EDIT - Just to clarify... I mean the 9.2.0.8 and 10.2.0.4 tests both returned the fsecs the same. As did an 11.1.0.7 test.
    Assuming the timestamp inserted was "01-JAN-09 01.00.00.11 PM" and the column is TIMESTAMP(2) or even TIMESTAMP(4) then invoking OCIDateTimeGetTime as follows returns:
    OCIDateTimeGetTime(usrhp, errhp, pTestTS, &hh, &mm, &ss, &fs);
    hh = 13
    mm = 0
    ss = 0
    fs = 110000000
    EDIT2 -
    I have noticed that SQL*Plus does exhibit the behavior I think you are describing when displaying the values:
    SQL> select * from ts_test;
       TEST_ID TEST_TS
             1 01-JAN-09 01.00.00.11 PM
    1 row selected.
    SQL> alter table ts_test modify(test_ts timestamp(4));
    Table altered.
    SQL> select * from ts_test;
       TEST_ID TEST_TS
             1 01-JAN-09 01.00.00.1100 PM
    1 row selected.Regards,
    Mark
    Edited by: Mark Williams on May 1, 2009 10:20 PM
    Edited by: Mark Williams on May 2, 2009 9:44 AM

  • Timestamp - insert seconds

    Hi,
    I need to insert the amount of seconds (19826.324306) +2 since 1900 in a timestamp column because I need fractional seconds.
    CREATE TABLE TIMESTAMP_TEST(TIJD  TIMESTAMP(9));
    insert into timestamp_test values(TO_DATE('01-01-1900','DD/MM/YYYY HH24:MI:SS') + 19826.324306 +2);
    select * from timestamp_test;
    TIJD
    16/04/54 07:47:00,000000000Why are there no fractional seconds??
    Regards
    B.

    Using date arithmetic causes implicit timestamp to date conversion and you lose second fractional part:
    SQL> insert into timestamp_test values(TO_TIMESTAMP('01-01-1900','DD/MM/YYYY HH24:MI:SS') + NUMTODSINTERVAL(19826.324306 +2,'DAY'));
    1 row created.
    SQL> select * from timestamp_test;
    TIJD
    16-APR-54 07.47.00.038400000 AMSY.

  • TIMESTAMP with nano seconds problem

    Hi there,
    Can someone help on the following ?
    select systimestamp(9) from dual, always returns timestamp values with the last 3 digits of nanoseconds equals to 000.
    SQL> select systimestamp(9) from dual;
    SYSTIMESTAMP(9)
    05.06.15 15:39:26,606662000 +01:00
    SQL> select systimestamp(9) from dual;
    SYSTIMESTAMP(9)
    05.06.15 15:39:30,280257000 +01:00
    Thank you in advance.
    Best Regards.

    the valuable document referenced in the metalink post referenced above is a asktom post seconding justin cave argument.
    If you have microseconds, be happy, windows have only milliseconds.
    op.cit. tom kyte
    I haven't yet see a system clock that will generate a time that granular (and we are reliant on that).

  • Fraction program problem.

    Hi, ive done a program to compute two fractions, but im getting wierd results, and I know its because I stuffed up the logic in equals(), add(), and isZero(). Its saying some fractions are equal to 0 when they are not, and when it does add two fractions they turn out to be fairly large.
    Any help to tell me what parts I did wrong would be great.
    Thankyou.
    //Accessor class
    public class Fraction {
         private int num1, den1, num2, den2, resultNum, resultDen;
         public void readIn() {
              System.out.println("\nTime to enter the first fraction.");
              System.out.print("\nEnter the numerator: ");
              num1 = SavitchIn.readLineInt();
              System.out.print("Enter the denominator: ");
              den1 = SavitchIn.readLineInt();
              System.out.println("\nTime to enter the second fraction");
              System.out.print("\nEnter the numerator: ");
              num2 = SavitchIn.readLineInt();
              System.out.print("Enter the denominator: ");
              den2 = SavitchIn.readLineInt();
         public boolean errorCheck() {
             if ((den1 == 0)||(den2 == 0)) {
                  System.out.println("\nError: The fraction is invalid is its denominator is 0, Halting!");
                  return false;
             else
                  return true;
         public boolean isZero() {
              int result = num1 / den1;
              if (result == 0) {
                  System.out.println("The first fraction equals 0, Halting Program!");
                  return false;
              else
                  return true;
         public boolean equals() {
              if (num1*den2 == den1*num2)
                   return true;
              else
                   return false;
         public void add() {
              int tempNum = (num1*den2) + (den1*num2);
              int tempDen = den1*den2;
              int d = simplify(tempNum, tempDen);
              resultNum = tempNum/d;
              resultDen = tempDen/d;
         public static int simplify(int a, int b) {
              if(a%b > 0)
                   return simplify(b, a%b);
              else
                   return b;
         public void writeOutTrue(boolean check) {
              System.out.println("The fractions entered were: "+num1+"/"+den1+" and "+num2+"/"+den2+".");
              System.out.println("The sum of the fractions entered is: "+resultNum+"/"+resultDen+".");
              if (check == true)
                   System.out.println("The fractions are equal!");
    }//Main class
    public class FractionDemo {
         public static void main(String[] args) {
              boolean truthCheck = true;
              int firstNume=0, firstDenom=0, secNume=0, secDenom=0;
              System.out.println("\nThis program gathers a faction from the user and displays it to the screen.");
              System.out.println("If the first fraction entered equals to '0' to the program will exit.");
              Fraction fracData = new Fraction();
              while(true) {
                   fracData.readIn();
                   truthCheck = fracData.errorCheck();
                   if (truthCheck == true)
                        truthCheck = fracData.isZero();
                   if (truthCheck == false)
                        break;
                   truthCheck = fracData.equals();
                   fracData.add();
                   fracData.writeOutTrue(truthCheck);
    }

    Well, first off, I really don't like your simplify method. If I were you, I'd return an array of two ints, one for the numerator and one for the denominator. Or a Point object, but that could get confusing. :P
    I think your modulo method of simplifying may not work for all situations, but I'm not completely sure; I'm having trouble following it in my head. Personally, I think I'd do simplifying like this:
    public int[] simplify(int n, ind d)
         int nFactors[] = getFactors(n);
         int dFactors[] = getFactors(d);
         // take out factors that are the same here, and the multiply the remaining ones in nFactors for the new numerator and the remaining ones in the dFactor for the denominator.
    publicn int[] getFactors(int n)
        int size=1;
        int twos;
        int threes;
        int fives;
        int sevens;
        boolean canFactor = true;
        while(canFactor))
             if(n%2 == 0)
                 size++;
                 twos ++;
                 n = n/2;
             if(n%3 == 0)
                 size++;
                 threes++;
                 n = n/3;
             if(n%5 == 0)
                 size++;
                 fives++;
                 n = n/5;
             if(n%7 == 0)
                 size++;
                 sevens++;
                 n = n/7;
             else
                 size++;
                 canFactor = false;
        int factors[] = new int[size];
        for(int i = 0; i<factors.size; i++)
            if(twos != 0)
                factors[i] = 2;
                twos --;
            else if(threes != 0)
                factors[i] = 3;
                threes --;
            else if(fives != 0)
                factors[i] = 5;
                fives --;
            if(sevens != 0)
                factors[i] = 2;
                sevens--;
            else
                factors[i] = n; //  this takes care of some of the other prime numbers, like 17 I think
    }I think that code would work for simplifying; but there are probably some exceptions that would get through it; I'm not a mathematician.
    Then, to compare equality, simplify both fractions and if the equal, then the fractions are equal.
    I think your problem with your add method lies in your simplify method, but I'm not sure. If you gave us numbers your program messed up on it would help. I don't have my IDE up here, so I can't test your code.
    As for your isZero method, why divide it out? A fraction will only be 0 if the numerator is 0.
    I hope I was some help. shrug Use my code at your own risk, it's totally untested. I don't know if it will work, but I think it'd work for most cases. I tried a few numbers; I haven't found one where it won't work (yet).

  • TimeStamp with "seconds"

    Hi, I want to use timestamp datatype with seconds.
    please give me specific example thanks !

    TIMESTAMP data type stores date/time till fraction of seconds. It also stores timezone info.
    Please refer http://docs.oracle.com/cd/B19306_01/server.102/b14200/sql_elements001.htm for more info.
    E. g :-
    SQL> select systimestamp from dual;
    SYSTIMESTAMP
    13-MAR-12 02.21.04.442937 AM -04:00
    If you want to store date/time till seconds then "date" data type can do that as well.
    SQL> select to_char(sysdate, 'dd:mon:yyyy hh:mi:ss') from dual;
    TO_CHAR(SYSDATE,'DD:MON:YYYYH
    13:mar:2012 02:24:03
    HTH,
    ~Yogesh

  • Timestamp and signature problems

    Hello, everybody!
    I have a problem when attaching a timestamp to a signature using the BouncyCastle provider.
    I have read the [RFC 3161|http://www.ietf.org/rfc/rfc3161.txt] and in chapter 2.4.1 it states that the messageImprint contained in the request "SHOULD contain the hash of the datum to be time-stamped."
    Also, in the appendix A of the same RFC, it's stated: "The value of messageImprint field within TimeStampToken shall be a hash of the value of signature field within SignerInfo for the signedData being time-stamped."
    My problem is as follows:
    I'm creating a request generator, using TimeStampRequestGenerator class in the org.bouncycastle.tsp package of the BouncyCastle provider. Then the request is created using the generate method of the TimeStampRequestGenerator object
    TimeStampRequestGenerator reqGen = new TimeStampRequestGenerator();
    reqGen.setCertReq (true);
    TimeStampRequest request = reqGen.generate(TSPAlgorithms.SHA1, hash, BigInteger.valueOf(100));Please, be aware that the hash variable is generic. But what value must this variable have? The value of the a hash function for the unsigned data or the value of a hash function for the signature field in the SignerInfo? What is the right way to build the request?
    The request should be build using the hash of the unsigned data? Then, after generating the pkcs7 file with the timestamped attached as an unsigned attribute, when a verification is performed, should I verify that the value in the messageImprint has the same value with the hash of the signature field in the SignerInfo? If so, it means I'm doingsomething wrong,because those values cannot be equal at all.
    Or the request should be built using the hash of the signature. And when the verification is performed, the messageImprint will contain the correct value, as stated in the Appendix A of the RFC3161?
    So my problem is what value must be passed for the hash when building the request?
    Any help qould be appreciated.
    Thank you!

    problem solved
    I had interpreting in the wrong way the RFC3161 that states that if adding the timestamp to a signature in a pkcs7 file the hash that needs to be sent to the TSA must be the hash of the signature field in the SignerInfo of the data.
    Which is correct if I stay a little bit to think because the timestamp is for the signature, not for the unsigned data.
    So, when creating the request for the TSA, the hash has to be the the hash for the signature.

  • The old no resonse in 10 seconds problem

    I get this error message
    2005-09-26 10:40:07 -0500: No data has been received for the last 10 seconds.
    Audio channel info: local machine using 134.48.140.30:16386, expecting remote machine to send to 134.48.140.30:16386
    Video channel info: local machine using 134.48.140.30:16384, expecting remote machine to send to 134.48.140.30:16384
    I have tried both opening all the ports and turning of my mac firewall.
    im running 10.4.2
    imac g4 800mhz
    using my colleges internet.

    Hello Wilson,
    If you are not certain that your iSight is working properly, you can check it using the hints in the How To Ensure Your iSight Is Functional FAQ..
    If your iSight works, but you are having problems with iChat AV, see Help for iChat AV 3 Problems

  • Difference between 2 timestamps in seconds

    Can anyone tell me how to subtract 2 timestamps and
    get the difference in seconds? "extract" doesn't work,
    it always gives a value between 0-59, I want the total
    seconds, not the seconds part of the interval.
    I'm using Oracle Database 10g Express Edition Release 10.2.0.1.0

    Hope this will work:
    CREATE TABLE TESTASIF
    NAME VARCHAR2(20 BYTE),
    ADDRESS VARCHAR2(100 BYTE),
    JOINTIME DATE
    TABLESPACE ASIFKA
    PCTUSED 0
    PCTFREE 10
    INITRANS 1
    MAXTRANS 255
    STORAGE (
    INITIAL 64K
    MINEXTENTS 1
    MAXEXTENTS 2147483645
    PCTINCREASE 0
    BUFFER_POOL DEFAULT
    LOGGING
    NOCOMPRESS
    NOCACHE
    NOPARALLEL
    MONITORING;
    INSERT INTO testasif
    VALUES ('rumi', 'comilla', SYSDATE);
    ## this query give you the result in seconds..
    SELECT SUBSTR (TO_CHAR (jointime), 1, 30) AS Joined,
    SUBSTR (TO_CHAR (sysdate), 1, 30) AS Today,
    ( TO_NUMBER (TO_CHAR (sysdate, 'J'))
    - TO_NUMBER (TO_CHAR (jointime, 'J'))
    * 86400
    + ( TO_NUMBER (TO_CHAR (sysdate, 'SSSSS'))
    - TO_NUMBER (TO_CHAR (jointime, 'SSSSS'))
    ) AS "Delta (sec)"
    FROM testasif
    WHERE name = 'rumi';
    #Mark the answer as correct/helpful
    Regards
    Asif Kabir

  • GP70 2PE Leopard game freezer for second problem

    Hello,
    when I'am playing a game sometimes it freeze for a second.
    What could be the problem?

    Dear joujou333 and Nichrome
    Quote from: joujou333 on 17-September-14, 06:12:37
    I fixed it with KeepAliveHD, every 7 seconds it writes a txt and overwrite itselfs every 7 seconds
    My games stops with freezing
    Glad to hear
    Quote from: Nichrome on 17-September-14, 06:42:49
    Thanks VAMET for providing name of that SW 
    No problem
    Sincerely

  • Fraction rounding problem

    I had problem with the rounding the fraction. Can any one solve this.
    String value="0.125";
    DecimalFormat df = new DecimalFormat("#0.00");
    Double orig = new Double(value);
    value = df.format(orig);
    if i print value ,the output is 0.12 , it should be 0.13
    String value="0.135";
    DecimalFormat df = new DecimalFormat("#0.00");
    Double orig = new Double(value);
    value = df.format(orig);
    if i print value ,the output is 0.14
    Why this is Happening.0.125,0.145,0.165,0.185 all are rounding wrong
    but 0.135,0.115,0.155,0.175,0.195 rounding properly.
    why this is happening,any altenate solution is there

    Other alternatives are available.Like creating a custom methos for that.But why its not working fraction round off for the even fractions and why its working for the odd fractions(its happening only if the round off value is 5).
    Can any body guess it.

  • K7n2 Delta power on for 1 second problem

    I have owned a MSI k7n2 Delta motherboard for just over a year, and it has worked fine.
    Just recently i decided to clean my computer after coming back from university, where it had gotten a little dusty.After cleaning it i plugged it all back in and powered it on. The power came on for about 1 second and then went off agen.The PSU fans came on, the CPU fan came on, but then it all just stopped after about a second.
    I have tried a different PSU also, and still the problem is the same.
    I also attempted removing everything then re-building, hoping this might fix something, but still the same problem.
    I have taken the CPU out and booted the system, the system beeps and stays on, the D-LED at the back signifying that the CPU is damaged or not installed, which is correct, but on replacing the CPU, the system again powers on and then off.I've tested the RAM, both modules, one module and switched DIMMs, but still the same problem.
    This is a very odd problem after a year of my computer working fine, i can only assume that i have damaged a component during cleaning, but im not sure whether the CPU,Motherboard or RAM is damaged.
    I dont suspect its the RAM, otherwise the computer would hang on power.
    Any suggestions would be thankful ?
    Specs:
    AMD-Athlon XP2600
    MSI K7N2 Delta
    2x256 Crucial 2700 DDR
    Radeon 9600 GFX
    80Gb Seagate
    120Gb Seagate
    2x CD/DVD/RW Drives

    Someone else had that problem here a few days ago, he found mobo knackered, did you ground your self when cleaning? When cleaning you must be grounded the easiest way is to leave power cord plugged in with the mains switched off!! Press power button on case to discharge psu, then hold or touch the side of the case regularly while cleaning.   I WOULD DO REBUILD FIRST YOU MAY HAVE MISSED SOMETHING.

  • Firefox crashes when I try to attach a file. Seems related to second problem, receive error messages when opening a pdf in adobe (which I've reinstalled twice)

    Crash report:
    bp-74bcae4f-7091-4121-a809-5d0a12140616 is the crash report.
    I have a Toshiba.
    When I open my email (gmail, school email) and try to attach a file, firefox immediately crashes and gives me two error messages. first one is a WerFault, i think. I don't know if that's relevant.
    Apart from these crashes in Firefox, I am also having the same problem when trying to view or open a pdf in adobe reader, or even open adobe reader itself. It won't try to open, I just receive the error messages. I've uninstalled and reinstalled it two times now. I did this thing suggested online where you go into the control panel and look at all your plugins. Then, "repair" adobe reader - pretty sure it's just a button that says repair. that didn't do anything, of course I also could have done something wrong.
    I realize this could be a problem unrelated to Firefox, but I'm doing what I can before I take my laptop in.
    Please save me.

    Ok two things based on the crash report and the steps you took right before the crash:
    # Try to disable scrolling acceleration and restart Firefox. Does it continue to crash?
    # Try Safe Mode and do the same task as above with email and the pdf [[Troubleshoot Firefox issues using Safe Mode]]
    # Also pdf.js may be helpful to read pdfs in the meantime. You can change the default reader in the Preferences/Options > Application menu of Firefox.
    # Try to clear out the downloads folder and update flash to version 14 (that should do it)
    IF it crashes again please also provide the new crash signatures and we can take a look :-) Sorry for the crashing :-(

  • After choosing a jpg for upload, the "Upload File" button on the organization's receiving site of does not respond. The second problem: it's impossible to highlight more that one file at a time.

    Clicking the first file, holding down shift and clicking the last file doesn't work. I've tried all manner of command, control, shift combos without success.  This one-at-a-time attachment problem also happens in web mail.  Are these two issues related?  Thanks for non-techie solutions for both issues.  I have Safari 5.0.6 (5533.22.3) and Leopard.

    Thanks for your response.  I do have javascript turned on (not java).  To answer your question,
    I was trying to upload 3 jpgs to the submissions page of a visual arts website. I could only highlight one jpg at a time in the "Choose File" option, and then the "Upload File" button of the submissions page would not respond.
    It's an ongoing problem with this site (I'm the only one with this issue and there are a lot of submissions). I have to send the images as email attachements to the administrator of the site.  When doing this via webmail, I still the one attachment at a time problem, but the images get to the administrator.  Thanks for helping.

Maybe you are looking for