Re: [sqlite] [sqlite-dev] sqlite3 db is locked
The code in function from the 1st e-mail is used before exiting, so the sqlite3_close is called in fact. 2013/12/30 Dan Kennedy > On 12/29/2013 11:43 PM, Alexander Syvak wrote: > >> Hello, >> >> there's a LabView app. which is calling C++ function from a DLL. >> In the DLL the function opens a connection, selects data using >> sqlite3_exec and closing using the code >> >>int rc = 0; >>while ( (rc = sqlite3_close(db)) == SQLITE_BUSY) >>{ >>// TODO: >>// shouldn't happen in a good written application but let's >> handle it >>sqlite3_stmt * stmt_raw_p = nullptr; >>while ((stmt_raw_p = sqlite3_next_stmt(db, NULL)) != NULL) >> sqlite3_finalize(stmt_raw_p); >> // TODO: if (rc != SQLITE_OK) >> // then the app. messes with other thread which should not >> happen >> // more tests are required >>} >> The rc after the if statement holds SQLITE_OK. >> However, after execution the function the LabView app. is finished but >> the IDE is not closed. At deleting the db file using Delete key Windows >> says it's locked and you can either Try again or Cancel. After the IDE is >> closed, the file may be deleted. >> It's needed to delete the file during the app. is running. >> > > I would guess you need to call sqlite3_close() before the > program exits in this case. > > Technically, this is the wrong mailing list for questions > to do with developing SQLite apps. You will get more answers > on the "sqlite-users" group. > > Dan. > > > > >> >> ___ >> sqlite-dev mailing list >> sqlite-...@sqlite.org >> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-dev >> > > ___ > sqlite-dev mailing list > sqlite-...@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-dev > ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
[sqlite] Bug report.
Hello, I am using the @ as a column name delimeter. For instance, if there's a table named woman, then a column describing the size of hips should be named woman@hip_size. There's a table created using CREATE TABLE country ( 'country@id' INTEGER, 'country@name' TEXT, 'country@printable'_name TEXT, 'country@iso2' TEXT, 'country@iso3' TEXT, 'country@numcode' INTEGER, CONSTRAINT PK_country PRIMARY KEY ('country@id') ) After execution of the next query pragma table_info('country'); Sqliteman 1.2.2 yields Sqliteman export cidnametypenotnulldflt_valuepk 0country@id INTEGER01 1country@name TEXT00 2country@printable_name TEXT00 3country@iso2 TEXT00 4country@iso3 TEXT00 5country@numcode INTEGER00 As you can see country@printable has the type _name TEXT. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
[sqlite] pragma foreign_keys;
Hello, there's a need to make delete on cascade, update on cascade work. I am using the next code for a test => int main() { sql_q_raw_ptr = "pragma foreign_keys = 1;"; mms::db db_; db_.open(path); db_.insert(sql_q_raw_ptr); sql_q_raw_ptr = "pragma foreign_keys;"; auto selector = mms::sqlite3_selector(""); db_.select(sql_q_raw_ptr, selector.get_data_handle(), &selector.get_data()); std::cout << selector.get_data().at(0) << '\n'; } mms:: db class is a connection wrapper. Hence, sequential insert and select in the code above are executed on the same connection. Each write-query uses immediate transaction. Hence, the insert is executed as an immediate transaction. However, the output to the shell is 0. When I execute the same code in sqliteman the output is 1. Why there's 0 and if it is caused by the IMMEDIATE TRANSACTION then why? ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
[sqlite] SQLite3 3.7.17 => using column names with character '@'.
Hello, using input select all "project@na" from project where 1 yields 4 lines of "project@na". In fact the column named project@na does not exist, but the project@name does in the tested data base. What is the gist of such a result? P.S. Please, reply to my e-mail. Regards, Alexander. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users