Announcement

Collapse
No announcement yet.

sqlcmd exec command problem on TIMESTAMP

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • sqlcmd exec command problem on TIMESTAMP

    Hi,
    Before client coding, I tried execute procedure on table ABC with commands below:

    3> exec ABC.upsert 123 55.55 123456 1 2345234;
    Unparseable date: "2345234"

    3> exec ABC.upsert 123 55.55 123456 1 '2016-03-08T10:58:25';
    Unparseable date: "2016-03-08T10:58:25"

    3> exec ABC.upsert 123 55.55 123456 1 '20160308';
    Unparseable date: "20160308"

    3> exec ABC.upsert 123 55.55 123456 1 2016.03.08;
    Unparseable date: "2016.03.08"

    finally, I inputed null:
    9> exec ABC.upsert 123 55.55 123456 1 null;
    (Returned 1 rows in 0.01s)
    means there were no errors on other columns data inputed.

    So my question is how to input TIMESTAMP value on command line? Thanks a lot!
    Last edited by arhu888; 03-08-2016, 06:52 AM.

  • #2
    arhu888,
    Here's an example of adding a timestamp into sqlcmd:
    create table foo ( aa timestamp);
    exec FOO.insert '2015-11-11 00:00:00.000000';

    Please keep in mind, datestamp of '2015-11-11 00:00:00' or '2015-11-11' with stored procedure will cause an unexpected 'Unparseable date: ' error. The workaround is to use the example above.
    I've created a bug to get this issue addressed, here.
    Peter Zhao
    Last edited by pzhao; 03-08-2016, 12:28 PM.

    Comment


    • #3
      Thank you Peter,
      It's now working with appending '.000000' to '2016-03-08 10:11:00'. I didn't find any mention about this point in VoltDB docs yesterday, maybe add this into voltdb docs will be a good idea.

      Comment


      • #4
        arhu888,
        Glad I was able to help. Suggestion was already been made to add this to our documentation.
        Peter Zhao

        Comment

        Working...
        X