PDA

View Full Version : Problem with A SQLite Query



maveric
24th June 2008, 09:56
Hi,
all, i am trying to change the name of my table name present in my database....
i am using this query

ALTER TABLE USERS RENAME TO USERS1 this thing works very good...
the problem is i need to create my table name basing upon the current system time....
is this possible.... to have system current time as my table...

the query for that which i am trying is


Alter table USERS1 Rename to time('now','localtime'); query string is returning an exception saying that " there is an error at '(' "


So can any one help me sorting this


Thanks in advance....

janus
24th June 2008, 11:15
Hi,

Why are you not using a QTime/Date function .toString and add this to your query as a parameter ... e.g.


query.exec("Alter table USERS1 Rename to " + QTime::currentTime ().toString(your format))

But I think "." is not allowed as a character in a table name ... use something else then