[sqlite] Looking for web interfaced based opensource project using sqlite
All expert Users and Developers: I am looking for sqlite based opensource project with web inertaface for college student, please let me know. appreciated. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] any command to find last rowid in a table
I understand "SELECT last_insert_rowid()" gives rowird, but I have to call these SQL statements in C language code, for that I have to sqlite3_prepare and sqlite3_step() calls, I am looking for sample of sqlite3_step, how that return the rowid, can I call like this: int rowid; sqlite3_stmt *pStmt; sqlite3(pDB, "SELECT last_insert_rowid()", -1, , 0); rowid = sqlite3_step(pStmt); On Mon, Feb 8, 2010 at 2:36 PM, Kees Nuyt <k.n...@zonnet.nl> wrote: > On Mon, 8 Feb 2010 11:44:39 -0500, Vasanta > <vtan...@gmail.com> wrote: > > > I tried to use this function call > > "sqlite3_last_insert_rowid()< > http://www.sqlite.org/c3ref/last_insert_rowid.html>" > > calling from C language function, but it always returns zero, any idea?. > > I have valid DB handle. > > The function only returns the rowid of the last successful > INSERT statement on the same connection / DB handle. It > tells you which row has been inserted. > > Perhaps you expected it to predict which row would be > inserted on the next INSERT statement? > > If you need a new ID for every row you insert, don't try to > find out which value to use, but let SQLite do the work. > > Sample code: > > CREATE TABLE t1 ( >id INTEGER PRIMARY KEY AUTOINCREMENT, >col2 REAL, >col3 TEXT > ); > > BEGIN; > INSERT INTO t1 (col2,col3) >VALUES (julianday('now'),'row one'); > SELECT last_insert_rowid(); > INSERT INTO t1 (col2,col3) >VALUES (julianday('now'),'row two'); > SELECT last_insert_rowid(); > INSERT INTO t1 (col2,col3) >VALUES (julianday('now'),'row three'); > SELECT last_insert_rowid(); > COMMIT; > > Read http://www.sqlite.org/c3ref/last_insert_rowid.html > again for more details. > -- > ( Kees Nuyt > ) > c[_] > ___ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] any command to find last rowid in a table
I tried to use this function call "sqlite3_last_insert_rowid()<http://www.sqlite.org/c3ref/last_insert_rowid.html>" calling from C language function, but it always returns zero, any idea?. I have valid DB handle. On Sat, Feb 6, 2010 at 9:25 AM, Vasanta <vtan...@gmail.com> wrote: > I found this C function call, this solved my problem, > sqlite3_last_insert_rowid()<http://www.sqlite.org/c3ref/last_insert_rowid.html>, > I just want to append new entries to existing imported table. > > > > > > > > On Sat, Feb 6, 2010 at 8:36 AM, Ibrahim A <ibrahim.a...@googlemail.com>wrote: > >> Am 05.02.2010 22:33, schrieb Vasanta: >> > Kittayya: >> > >> > My issue is, I already have imported table in the Database, there alreay >> > around 1000 records in that table where ROWID is from 1 to 1000, now >> system >> > generates new events, where ROWID again starts from beginning from 1, >> now >> > these new events are overwriting the earlier imported events by "REPLACE >> > INTO..", I made that change to instead REPLACE, I need INSERT, but >> now I >> > need new ROWID (I need to update at the end of previous imported >> records. I >> > don't want to overwrite original records. >> > >> > >> > >> First of all a few questions to make things clear : >> >> 1) you import your data with a script that inserts rows with existing >> rowid's ? >> >> after that : >> >> 2) you try to insert new rows with INSERT ... but it doesn't work as you >> expect because you think you need to specify a new unused rowid ? >> >> if so : >> >> a) don't classify the field rowid in your insert command because sqlite >> then generates automatically new unused values. >> b) if your script (from earlier posts) restores your database with sql >> commands (most likely) then try to avoid using rowid in that script at >> all. The default behaviour for rowid works fine especially for your >> problem with only a few thousand entries in the database >> c) if rowid is your primary key to identify your data, then you depend >> on a internal feature of the engine and you should change this with a >> user defined field called id which could also be a autoincrement field >> similar to rowid for better performanc (integer primary key autoinc --- >> look at the documentation) >> >> your problem is that you try to insert new rows with a rowid and you >> will only get performance problems when you have to search for the >> maximum value of a rowid each time you search for a new valid id. try to >> avoid this by defining your own primary key. At least don't try to >> specify a rowid value when you insert new rows. >> >> Hope this could solve your problem ;) >> ___ >> sqlite-users mailing list >> sqlite-users@sqlite.org >> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users >> > > ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] any command to find last rowid in a table
Can I use this function call in C code to return last rowid to be inserted?. On Sat, Feb 6, 2010 at 9:25 AM, Vasanta <vtan...@gmail.com> wrote: > I found this C function call, this solved my problem, > sqlite3_last_insert_rowid()<http://www.sqlite.org/c3ref/last_insert_rowid.html>, > I just want to append new entries to existing imported table. > > > > > > > > On Sat, Feb 6, 2010 at 8:36 AM, Ibrahim A <ibrahim.a...@googlemail.com>wrote: > >> Am 05.02.2010 22:33, schrieb Vasanta: >> > Kittayya: >> > >> > My issue is, I already have imported table in the Database, there alreay >> > around 1000 records in that table where ROWID is from 1 to 1000, now >> system >> > generates new events, where ROWID again starts from beginning from 1, >> now >> > these new events are overwriting the earlier imported events by "REPLACE >> > INTO..", I made that change to instead REPLACE, I need INSERT, but >> now I >> > need new ROWID (I need to update at the end of previous imported >> records. I >> > don't want to overwrite original records. >> > >> > >> > >> First of all a few questions to make things clear : >> >> 1) you import your data with a script that inserts rows with existing >> rowid's ? >> >> after that : >> >> 2) you try to insert new rows with INSERT ... but it doesn't work as you >> expect because you think you need to specify a new unused rowid ? >> >> if so : >> >> a) don't classify the field rowid in your insert command because sqlite >> then generates automatically new unused values. >> b) if your script (from earlier posts) restores your database with sql >> commands (most likely) then try to avoid using rowid in that script at >> all. The default behaviour for rowid works fine especially for your >> problem with only a few thousand entries in the database >> c) if rowid is your primary key to identify your data, then you depend >> on a internal feature of the engine and you should change this with a >> user defined field called id which could also be a autoincrement field >> similar to rowid for better performanc (integer primary key autoinc --- >> look at the documentation) >> >> your problem is that you try to insert new rows with a rowid and you >> will only get performance problems when you have to search for the >> maximum value of a rowid each time you search for a new valid id. try to >> avoid this by defining your own primary key. At least don't try to >> specify a rowid value when you insert new rows. >> >> Hope this could solve your problem ;) >> ___ >> sqlite-users mailing list >> sqlite-users@sqlite.org >> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users >> > > ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] any command to find last rowid in a table
I found this C function call, this solved my problem, sqlite3_last_insert_rowid()<http://www.sqlite.org/c3ref/last_insert_rowid.html>, I just want to append new entries to existing imported table. On Sat, Feb 6, 2010 at 8:36 AM, Ibrahim A <ibrahim.a...@googlemail.com>wrote: > Am 05.02.2010 22:33, schrieb Vasanta: > > Kittayya: > > > > My issue is, I already have imported table in the Database, there alreay > > around 1000 records in that table where ROWID is from 1 to 1000, now > system > > generates new events, where ROWID again starts from beginning from 1, now > > these new events are overwriting the earlier imported events by "REPLACE > > INTO..", I made that change to instead REPLACE, I need INSERT, but > now I > > need new ROWID (I need to update at the end of previous imported records. > I > > don't want to overwrite original records. > > > > > > > First of all a few questions to make things clear : > > 1) you import your data with a script that inserts rows with existing > rowid's ? > > after that : > > 2) you try to insert new rows with INSERT ... but it doesn't work as you > expect because you think you need to specify a new unused rowid ? > > if so : > > a) don't classify the field rowid in your insert command because sqlite > then generates automatically new unused values. > b) if your script (from earlier posts) restores your database with sql > commands (most likely) then try to avoid using rowid in that script at > all. The default behaviour for rowid works fine especially for your > problem with only a few thousand entries in the database > c) if rowid is your primary key to identify your data, then you depend > on a internal feature of the engine and you should change this with a > user defined field called id which could also be a autoincrement field > similar to rowid for better performanc (integer primary key autoinc --- > look at the documentation) > > your problem is that you try to insert new rows with a rowid and you > will only get performance problems when you have to search for the > maximum value of a rowid each time you search for a new valid id. try to > avoid this by defining your own primary key. At least don't try to > specify a rowid value when you insert new rows. > > Hope this could solve your problem ;) > ___ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] any command to find last rowid in a table
Kittayya: My issue is, I already have imported table in the Database, there alreay around 1000 records in that table where ROWID is from 1 to 1000, now system generates new events, where ROWID again starts from beginning from 1, now these new events are overwriting the earlier imported events by "REPLACE INTO..", I made that change to instead REPLACE, I need INSERT, but now I need new ROWID (I need to update at the end of previous imported records. I don't want to overwrite original records. On Fri, Feb 5, 2010 at 4:09 PM, P Kishor <punk.k...@gmail.com> wrote: > I am top posting here because, (1) You are simply unable to articulate > your own problem clearly, (2) you are not listening to the advice that > you are getting, and (3) the quicker we put you on the right track the > better it will be for everyone. > > First, if you have a table, you should have a primary key. You should > create your own primary key instead of using ROWID as that is used by > the software, and is not reliable for your own use. Creating a primary > key is as easy as defining a column as INTEGER PRIMARY KEY. For > example, > > CREATE TABLE eventlog (id INTEGER PRIMARY KEY, foo TEXT, bar REAL); > > There, that was easy, no? Now, sqlite will do the work for you, > automatically inserting primary keys for you, automatically ensuring > that there will be no collisions and you saving you from the misery of > figuring out what key to create and use next. > > Second, if for some reason you want to know what the highest primary > key already in use is, you can ask the database > > SELECT Max(id) FROM eventlog; > > There, that was easy also. > > > Third, if, for some reason, you want to insert a new row, and then > immediately want to use the id of that new row for a different > operation, you can use last_insert_rowid() > > BEGIN TRANSACTION; > -- insert a new row > INSERT INTO eventlog (foo, bar) VALUES ('blah blah', 21.546); > -- note that you didn't have to insert the id, as sqlite did that work for > you > -- now, update some other table with the last inserted row id > UPDATE someothertable > SET col = ( SELECT last_insert_rowid() ) > WHERE condition; > -- note, last_insert_rowid() is a db connection property, > -- so you don't have to specify a table. Make sure to > -- wrap the two in a transaction > COMMIT > > Now, wasn't that easy? > > Next step. Please read the docs and do some sql tutorials. You will > really benefit. > > > On Fri, Feb 5, 2010 at 2:54 PM, Vasanta <vtan...@gmail.com> wrote: > > I wroe this code to get ROWID, but if I assign output of sqlite3_step to > an > > id, and assign that id, is OK?. > > > > const char *rowidSql = "SELECT max(ROWID)+1 "EVENTLOG_TBL ; > > > >const char *zSql; > >sqlite3_stmt * pStmt, pStmt2; > > > > /* This is added to run query to get ROWID */ > >rc = sqlite3_prepare(pDB, rowidSql, -1, , 0); > >if( rc != SQLITE_OK ) > >{ > >ADP_PRINTF ("sqlite3_prepare failed for %s\n", rowidSql); > >return (ERROR); > >} > >eventLogRowIndex = sqlite3_step(pStmt2) > >sqlite3_bind_int(pStmt, 1, eventLogRowIndex); > > > > > > On Fri, Feb 5, 2010 at 3:30 PM, Shane Harrelson <sh...@sqlite.org> > wrote: > > > >> As stated before, in general, you should not specify the ROWID on > inserts, > >> but instead, let the database engine choose it for you. > >> This is true of most/all database engines. > >> > >> The syntax you're trying below is not supported. Indeed, even it were, > >> max(ROWID) is the maximum ROWID *in use*. Trying to insert another row > >> with > >> the same ROWID will result in a collision. > >> > >> At the very least you would need to do something like "SELECT > max(ROWID)+1 > >> from EVENTLOG_TBL;", use sqlite_step() to run this query, and bind the > >> ROWID > >> returned here into your insert statement and run that. > >> > >> You can read more on SQLite's ROWID usage at > >> http://www.sqlite.org/search?q=rowid > >> > >> HTH. > >> -Shane > >> > >> > >> > >> > >> On Fri, Feb 5, 2010 at 3:22 PM, Vasanta <vtan...@gmail.com> wrote: > >> > >> > This is my actual string, still not working: > >> > > >> > const char *replaceSql = "INSERT INTO "EVENTLOG_TBL \ > >> > "(_ROWID_, component, facilityId, > logLevel,"\ > &g
Re: [sqlite] any command to find last rowid in a table
I wroe this code to get ROWID, but if I assign output of sqlite3_step to an id, and assign that id, is OK?. const char *rowidSql = "SELECT max(ROWID)+1 "EVENTLOG_TBL ; const char *zSql; sqlite3_stmt * pStmt, pStmt2; /* This is added to run query to get ROWID */ rc = sqlite3_prepare(pDB, rowidSql, -1, , 0); if( rc != SQLITE_OK ) { ADP_PRINTF ("sqlite3_prepare failed for %s\n", rowidSql); return (ERROR); } eventLogRowIndex = sqlite3_step(pStmt2) sqlite3_bind_int(pStmt, 1, eventLogRowIndex); On Fri, Feb 5, 2010 at 3:30 PM, Shane Harrelson <sh...@sqlite.org> wrote: > As stated before, in general, you should not specify the ROWID on inserts, > but instead, let the database engine choose it for you. > This is true of most/all database engines. > > The syntax you're trying below is not supported. Indeed, even it were, > max(ROWID) is the maximum ROWID *in use*. Trying to insert another row > with > the same ROWID will result in a collision. > > At the very least you would need to do something like "SELECT max(ROWID)+1 > from EVENTLOG_TBL;", use sqlite_step() to run this query, and bind the > ROWID > returned here into your insert statement and run that. > > You can read more on SQLite's ROWID usage at > http://www.sqlite.org/search?q=rowid > > HTH. > -Shane > > > > > On Fri, Feb 5, 2010 at 3:22 PM, Vasanta <vtan...@gmail.com> wrote: > > > This is my actual string, still not working: > > > > const char *replaceSql = "INSERT INTO "EVENTLOG_TBL \ > > "(_ROWID_, component, facilityId, logLevel,"\ > > "textMessage, binMessage) VALUES(?,?,?,?,?,?); > > SELECT max(ROWID) from EVENTLOG_TBL"; > > > > > > On Fri, Feb 5, 2010 at 3:05 PM, Vasanta <vtan...@gmail.com> wrote: > > > > > Thanks jay. > > > > > > Can I combine like this: > > > > > > "INSERT INTO trends(UnitID,HeureTrends,DateTrends) VALUES(?,?,?);SELECT > > > max(ROWID) FROM table-name"; > > > > > > or > > > > > > "INSERT INTO trends(UnitID,HeureTrends,DateTrends) VALUES(?,?,?);SELECT > > > last_insert_rowid() AS [ID]"; > > > > > > > > > On Fri, Feb 5, 2010 at 2:49 PM, Jay A. Kreibich <j...@kreibi.ch> wrote: > > > > > >> On Fri, Feb 05, 2010 at 02:28:33PM -0500, Vasanta scratched on the > wall: > > >> > command "SELECT rowid from table-name;" gives all rows from 1 to > 100 > > >> for > > >> > total 100 rows, any command to get last rowid?. I need insert from > > last > > >> > rowid onwards (if table already 100 records, need to insert from 101 > > >> > onwards) > > >> > > >> SELECT max(ROWID) FROM table-name; > > >> > > >> > > >> You shouldn't be setting ROWIDs manually, however. Just insert the > > >> row and let SQLite pick the ROWID. If you have a ROWID alias in the > > >> form of an INTEGER PRIMARY KEY, in most cases you should still just > > >> let SQLite pick the value, possibly with AUTOINCREMENT. > > >> > > >> -j > > >> > > >> -- > > >> Jay A. Kreibich < J A Y @ K R E I B I.C H > > > >> > > >> "Our opponent is an alien starship packed with atomic bombs. We have > > >> a protractor." "I'll go home and see if I can scrounge up a ruler > > >> and a piece of string." --from Anathem by Neal Stephenson > > >> ___ > > >> sqlite-users mailing list > > >> sqlite-users@sqlite.org > > >> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > > >> > > > > > > > > ___ > > sqlite-users mailing list > > sqlite-users@sqlite.org > > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > > > ___ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] any command to find last rowid in a table
This is my actual string, still not working: const char *replaceSql = "INSERT INTO "EVENTLOG_TBL \ "(_ROWID_, component, facilityId, logLevel,"\ "textMessage, binMessage) VALUES(?,?,?,?,?,?); SELECT max(ROWID) from EVENTLOG_TBL"; On Fri, Feb 5, 2010 at 3:05 PM, Vasanta <vtan...@gmail.com> wrote: > Thanks jay. > > Can I combine like this: > > "INSERT INTO trends(UnitID,HeureTrends,DateTrends) VALUES(?,?,?);SELECT > max(ROWID) FROM table-name"; > > or > > "INSERT INTO trends(UnitID,HeureTrends,DateTrends) VALUES(?,?,?);SELECT > last_insert_rowid() AS [ID]"; > > > On Fri, Feb 5, 2010 at 2:49 PM, Jay A. Kreibich <j...@kreibi.ch> wrote: > >> On Fri, Feb 05, 2010 at 02:28:33PM -0500, Vasanta scratched on the wall: >> > command "SELECT rowid from table-name;" gives all rows from 1 to 100 >> for >> > total 100 rows, any command to get last rowid?. I need insert from last >> > rowid onwards (if table already 100 records, need to insert from 101 >> > onwards) >> >> SELECT max(ROWID) FROM table-name; >> >> >> You shouldn't be setting ROWIDs manually, however. Just insert the >> row and let SQLite pick the ROWID. If you have a ROWID alias in the >> form of an INTEGER PRIMARY KEY, in most cases you should still just >> let SQLite pick the value, possibly with AUTOINCREMENT. >> >> -j >> >> -- >> Jay A. Kreibich < J A Y @ K R E I B I.C H > >> >> "Our opponent is an alien starship packed with atomic bombs. We have >> a protractor." "I'll go home and see if I can scrounge up a ruler >> and a piece of string." --from Anathem by Neal Stephenson >> ___ >> sqlite-users mailing list >> sqlite-users@sqlite.org >> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users >> > > ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] any command to find last rowid in a table
Thanks jay. Can I combine like this: "INSERT INTO trends(UnitID,HeureTrends,DateTrends) VALUES(?,?,?);SELECT max(ROWID) FROM table-name"; or "INSERT INTO trends(UnitID,HeureTrends,DateTrends) VALUES(?,?,?);SELECT last_insert_rowid() AS [ID]"; On Fri, Feb 5, 2010 at 2:49 PM, Jay A. Kreibich <j...@kreibi.ch> wrote: > On Fri, Feb 05, 2010 at 02:28:33PM -0500, Vasanta scratched on the wall: > > command "SELECT rowid from table-name;" gives all rows from 1 to 100 > for > > total 100 rows, any command to get last rowid?. I need insert from last > > rowid onwards (if table already 100 records, need to insert from 101 > > onwards) > > SELECT max(ROWID) FROM table-name; > > > You shouldn't be setting ROWIDs manually, however. Just insert the > row and let SQLite pick the ROWID. If you have a ROWID alias in the > form of an INTEGER PRIMARY KEY, in most cases you should still just > let SQLite pick the value, possibly with AUTOINCREMENT. > > -j > > -- > Jay A. Kreibich < J A Y @ K R E I B I.C H > > > "Our opponent is an alien starship packed with atomic bombs. We have > a protractor." "I'll go home and see if I can scrounge up a ruler > and a piece of string." --from Anathem by Neal Stephenson > ___ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] any command to find last rowid in a table
I couldn't find, looklike lot of expert users here, throw me command quickly On Fri, Feb 5, 2010 at 2:34 PM, P Kishor <punk.k...@gmail.com> wrote: > On Fri, Feb 5, 2010 at 1:28 PM, Vasanta <vtan...@gmail.com> wrote: > > command "SELECT rowid from table-name;" gives all rows from 1 to 100 for > > total 100 rows, any command to get last rowid?. I need insert from last > > rowid onwards (if table already 100 records, need to insert from 101 > > onwards) > > Did you read the docs? > http://www.sqlite.org/lang_corefunc.html#last_insert_rowid > > > Did you search for help with SQL commands? > http://www.google.com/search?q=sql+tutorial > > > -- > Puneet Kishor http://www.punkish.org > Carbon Model http://carbonmodel.org > Charter Member, Open Source Geospatial Foundation http://www.osgeo.org > Science Commons Fellow, http://sciencecommons.org/about/whoweare/kishor > Nelson Institute, UW-Madison http://www.nelson.wisc.edu > --- > Assertions are politics; backing up assertions with evidence is science > === > Sent from Madison, Wisconsin, United States > ___ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
[sqlite] any command to find last rowid in a table
command "SELECT rowid from table-name;" gives all rows from 1 to 100 for total 100 rows, any command to get last rowid?. I need insert from last rowid onwards (if table already 100 records, need to insert from 101 onwards) ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Getting an error "table insert failed for eventLog" any idea what is the reason
Here the issue is comes when it imports configuration, the script throws an error, since this is users group, I thought some esprts who can figure out the issue from script, DON'T YOU? On Sat, Jan 30, 2010 at 11:42 AM, Simon Slavin <slav...@bigfraud.org> wrote: > > On 30 Jan 2010, at 4:00pm, Vasanta wrote: > > > Thanks Simon. actually I have one sql file contains all tables info > > (system.sql, then system.db file gets created using this command "sqlite3 > > system.sb < system.sql), then lua script runs on this database file > using > > default configuration (restoreDB.lua system.db def_config_ascii), then > this > > problem comes. > > Read the error messages you posted, they all say the same thing: "I tried > to make but it's already there.". Whatever process is spitting out > these errors is expecting to find a blank database, not one which already > has schema in it. It is complaining because when it tries to fill the blank > database from scratch, things it's trying to create are already there. > > This is not a bug in sqlite. sqlite is doing everything right. You should > take this matter up with whoever wrote the software you're using, or whoever > supplied those files to you, or whoever told you which commands to issue in > which order. > > > I have those files, can I attach here?. > > No, do not try to send them over the mailing list. > > Simon. > ___ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Getting an error "table insert failed for eventLog" any idea what is the reason
Thanks Simon. actually I have one sql file contains all tables info (system.sql, then system.db file gets created using this command "sqlite3 system.sb < system.sql), then lua script runs on this database file using default configuration (restoreDB.lua system.db def_config_ascii), then this problem comes. I have those files, can I attach here?. On Sat, Jan 30, 2010 at 8:45 AM, Simon Slavin <slav...@bigfraud.org> wrote: > > On 29 Jan 2010, at 8:52pm, Vasanta wrote: > > > when Database tries to create tables, getting the below error: > > "table insert failed for eventLog" any idea what is the reason, also I > have > > these errors when I run manually, I gets these: > > Everything apart from this line > > > sh: 1: unknown operand > > is a message that you are creating things (tables, indexes, etc.) which are > already in your file. In other words, you didn't start from no database > file, or a blank database file, but from the database you created when your > application last ran. > > Simon. > ___ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
[sqlite] Getting an error "table insert failed for eventLog" any idea what is the reason
when Database tries to create tables, getting the below error: "table insert failed for eventLog" any idea what is the reason, also I have these errors when I run manually, I gets these: SQL error near line 2: table dbUpdateRegisterTbl already exists SQL error near line 17: table sqliteLock already exists SQL error near line 22: table ifDevEventTbl already exists SQL error near line 33: table tableValidation already exists SQL error near line 43: table tableDefaults already exists SQL error near line 54: table system already exists SQL error near line 65: table systemConfig already exists SQL error near line 72: table dbUpdateRegisterProgram already exists SQL error near line 84: table saveTables already exists SQL error near line 91: table environment already exists SQL error near line 99: table tableMaxRecords already exists SQL error near line 105: table stringsMap already exists SQL error near line 118: column stringId is not unique SQL error near line 119: column stringId is not unique SQL error near line 120: column stringId is not unique SQL error near line 121: table httpsMgmt already exists SQL error near line 131: columns tableName, columnName are not unique SQL error near line 132: table ethernet already exists SQL error near line 147: columns tableName, columnName are not unique SQL error near line 148: columns tableName, columnName are not unique SQL error near line 150: column stringId is not unique SQL error near line 151: column stringId is not unique SQL error near line 152: table vlan already exists SQL error near line 160: columns tableName, columnName are not unique SQL error near line 162: table networkInterface already exists SQL error near line 182: table networkInfo already exists SQL error near line 192: table logging already exists SQL error near line 200: table logConfig already exists SQL error near line 216: table compFacilityMap already exists SQL error near line 225: table sysLogInfo already exists SQL error near line 232: columns tableName, columnName are not unique SQL error near line 235: columns component, facilityId are not unique SQL error near line 236: columns component, facilityId are not unique SQL error near line 237: columns component, facilityId are not unique SQL error near line 238: columns component, facilityId are not unique SQL error near line 239: columns component, facilityId are not unique SQL error near line 240: columns component, facilityId are not unique SQL error near line 242: columns component, facilityId are not unique SQL error near line 243: columns component, facilityId are not unique SQL error near line 244: columns component, facilityId are not unique SQL error near line 245: columns component, facilityId are not unique SQL error near line 247: columns component, facilityId are not unique SQL error near line 250: table eventLog already exists SQL error near line 262: table emailLogs already exists SQL error near line 270: columns tableName, columnName are not unique SQL error near line 272: column stringId is not unique SQL error near line 273: column stringId is not unique SQL error near line 274: column stringId is not unique SQL error near line 275: column stringId is not unique SQL error near line 276: column stringId is not unique SQL error near line 277: column stringId is not unique SQL error near line 278: column stringId is not unique SQL error near line 279: column stringId is not unique SQL error near line 280: table loginSession already exists SQL error near line 294: column stringId is not unique SQL error near line 295: column stringId is not unique SQL error near line 296: column stringId is not unique SQL error near line 297: column stringId is not unique SQL error near line 298: table ntp already exists SQL error near line 311: table ntpDefServers already exists SQL error near line 321: column stringId is not unique SQL error near line 322: column stringId is not unique SQL error near line 324: table users already exists SQL error near line 338: columns tableName, columnName are not unique SQL error near line 339: table reboot already exists SQL error near line 348: table bootpc already exists SQL error near line 357: columns tableName, columnName are not unique SQL error near line 358: columns tableName, columnName are not unique SQL error near line 359: columns tableName, columnName are not unique SQL error near line 361: column stringId is not unique SQL error near line 362: column stringId is not unique SQL error near line 363: column stringId is not unique SQL error near line 364: column stringId is not unique SQL error near line 365: column stringId is not unique SQL error near line 366: column stringId is not unique SQL error near line 367: column stringId is not unique SQL error near line 368: table kdcConfig already exists SQL error near line 379: table cert already exists SQL error near line 397: table x509SelfCertReq already exists SQL error near line 414: table x509DbUpdateFlag already exists SQL error near line