Visokio website     Downloads     Video tutorials     KnowledgeBase  
Publish to mySQL error - Visokio Forums
Publish to mySQL error
  •     sherriff March 9, 2012 3:14AM
    We are attempting to publish to mySQL and receive the following error:

    Database Error

    An error occurred connecting to or querying the database.

    Data truncation: Incorrect time value: '1970-01-01' for column [ETA] at row 1

    The receiving table has been setup in mySQL and the field [ETA] has been give the format TIME which expects hh:mm:ss
    The data to be output is in the format: hh:mm:ss

    The first row is 00:00:00

    But we cannot figure out what might be the cause of the error.
  • 10 Comments
  •     naruemon March 9, 2012 3:23AM
    Additinal information:

    field [ETA] was retrieve from other MySQL DB (called instance 'A') and the type of data is 'time'. The value in instance 'A' for this field is in format 'HH:mm:ss', such as '23:59:00'.

    After this field [ETA] was imported to Omniscope, the value for this field change to this format '01-Jan-1970 23:59:00'

    So, when we tried to export this field [ETA] to other MySQL DB (instance 'B'), the type of data was changed to be 'timestamp' always. We manually adjusted type of data to be 'time' and the value in Omniscope to be 'HH:mm:ss' but we still have this error.
  •     tjbate March 9, 2012 1:56PM
    Mon - A Date/Time field being imported into Omniscope will revert to displaying the 01-Jan-1970 month/year value (the basis for Epoch/Unix/Posix time) if the full, valid date value (including year) is NOT being read in from a single field. Omniscope expects the entire value specifying a point in time: years down to milliseconds, to be imported from a single field as a single valid value.

    Spreadsheets often store the Dates and the Times in separate fields, resulting in Omniscope importing just the the time and having to 'guess' the year. If possible, set your database to store the entire date/time value as a single value (usually milliseconds since 01 January 1970). If this is not possible, import the multiple fields as Text and combine the fields as Text, then use the TEXTTODATE function to convert to a fully specified single-field Date/Time values.
  •     naruemon March 12, 2012 8:52AM
    Thomas, we understand your comment and advice above, however we are experiencing a further anomaly even when we are publishing a combined DATETIME field to mySQL.

    The Field received by mySQL contains only the Date. The Time field has gone to 00:00:00

    We can fix the former problem by joining DATE and TIME fields as you suggest but we cannot see how to preserve the TIME.

    This suggests there may be some format error between Omniscope Publish and mySQL?
  •     naruemon March 12, 2012 8:56AM
    Additional:

    The date/time data (timestamp type) is set to '12-Mar-2012 18:13:59' but when we publish it back to MySQL (timestamp type) it shows only '12-Mar-2012 00:00:00'. The time is missing after we publish it back.
  •     steve March 12, 2012 3:33PM
    Are you certain the time elements are non-zero in the preview of the input block to the publish block?
  •     naruemon March 13, 2012 7:16AM
    Yes, we could see the time in the input block before publish as '12-Mar-2012 18:13:59'. Our version is 2.7 build 289.

    I tried to capture the screen to show you but when I published the DB again. It showed the error as attached - -'
    Attachments
    DatabaseError.png 229K
  •     naruemon March 13, 2012 7:25AM
    Please find more screenshot here ^-^
    Attachments
    beforePublish1.png 317K
  •     chris March 13, 2012 12:09PM
    Hi,

    We will investigate this issue and get back to you.
  •     alec_webliquid March 28, 2012 1:06PM
    Hi,

    I am also having the 00:00:00 time issue when converting to a MySQL timestamp. I have the date/time formatted as yyyy-MM-dd HH:mm:ss within Omniscope and I have verified that it appears correctly in the Preview pane. I am running version 2.7 build 299 (beta).

    Any help would be much appreciated! Please let me know if I can provide any other useful information.

    Cheers, Alec
  •     chris March 29, 2012 9:07AM
    Hi,

    This issue occurs because at the moment the Omniscope Database publisher does not support writing as a Timestamp. We are looking to implement this very soon, however it will probably only be available in Omniscope 2.8. Omniscope 2.8 Alpha should be available to download in the next few weeks.

Welcome!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In Apply for Membership