db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Suraj Batuwana <scsb...@gmail.com>
Subject Need to convert CURRENT_TIMESTAMP value to BIGINT
Date Mon, 07 Jan 2008 08:14:32 GMT

My Application is using Apache Derby and it needs to insert current
time stamp value to a column which is a BIGINT ( it can also be SMALLINT,
INTEGER or DECIMAL) datatype.

According to http://db.apache.org/derby/docs/10.2/ref/rrefsqlj33562.html
time stamp value can't directly converted to BIGINT.So first I convert that
to CHAR and then try to convert that to BIGINT. But it gave the following

ERROR 22018: Invalid character string format for type BIGINT.

SQL scripts used to this is in ij are given below

ij> CREATE TABLE Testtime (
        username        VARCHAR(64)     NOT NULL ,
        timestamp       BIGINT  NOT NULL ,
        CONSTRAINT Testtime_PK  PRIMARY KEY (username) );
0 rows inserted/updated/deleted
ij>     INSERT INTO Testtime (username, timestamp)
        VALUES ('testusername',
ERROR 22018: Invalid character string format for type BIGINT.

	Is there a way to do that in Derby
View this message in context: http://www.nabble.com/Need-to-convert-CURRENT_TIMESTAMP-value-to-BIGINT-tp14660378p14660378.html
Sent from the Apache Derby Users mailing list archive at Nabble.com.

View raw message