Forum: Building VoltDB Applications

Post: sqlcmd exec command problem on TIMESTAMP

sqlcmd exec command problem on TIMESTAMP
arhu888
Mar 8, 2016
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!
pzhao
Mar 8, 2016
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
arhu888
Mar 9, 2016
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.
pzhao
Mar 9, 2016
arhu888,
Glad I was able to help. Suggestion was already been made to add this to our documentation.
Peter Zhao