create table LOG (
ID int primary key generated always as identity (start with 2147483647, increment by -1),
-- the largest INTEGER: see 'Numeric Limitations' at http://developers.sun.com/docs/javadb/10.2.2/ref/rrefnumericlimits.html
T timestamp with default current_timestamp,
-- see 'CREATE TABLE statement' at http://developers.sun.com/docs/javadb/10.2.2/ref/rrefsqlj24513.html
-- and 'CURRENT TIMESTAMP' at http://developers.sun.com/docs/javadb/10.2.2/ref/rrefsqlj15866.html#rrefsqlj15866
MSG varchar(32672)
-- maximal length of VARCHAR: see 'String Limitations' at http://developers.sun.com/docs/javadb/10.2.2/ref/rrefstringlimits.html
);
insert into LOG (MSG) values ('Rolling back the current changes...');
insert into LOG (MSG) values ('Starting a new transaction...');
insert into LOG (MSG) values ('Fetching new data...');
insert into LOG (MSG) values ('Done!');
select * from LOG order by T;
select ID, cast (T as CHAR(23)) as TIMESTAMP, MSG from LOG;
2147483647 2009-03-02 16:50:03.614 Rolling back the current changes...
2147483646 2009-03-02 16:50:03.692 Starting a new transaction...
2147483645 2009-03-02 16:50:03.708 Fetching new data...
2147483644 2009-03-02 16:50:03.723 Done!
See also:
No comments:
Post a Comment