samedi 2 avril 2016

How to auto insert current millis in sqlite database

My requirement

In my android application sqlite database I want to insert current time millis as primary key

for ex: 1459599746406, 1459599746407...

Note: I want to auto insert this column (not manually).

My previous approach

sqlite query :-

"id" timestamp PRIMARY KEY NOT NULL DEFAULT CURRENT_TIMESTAMP

output:-

2016-04-02 07:14:46 //only one record accepted per second

2016-04-02 07:14:47

Problem in this way,

I can`t insert more than 1 record per second.

Because It auto insert default current_timestamp.

I don't know its possible or not. Because I search more google & SO nothing found. If not possible please comment here.

Anybody guide me.

Aucun commentaire:

Enregistrer un commentaire