Re: [sqlite] why no such column in sqlite3 ?
Rob Richardson wrote: > Put single quotes around Testitem: > > sprintf( sqlquery, "INSERT INTO tblTest ( CINDEX, CDATE, CDESCR, > CAMOUNT ) VALUES ( 5, 2012-08-29, 'Testitem', 300 )"); And around cdate too. There are no dedicated date type in sqlite, 2012-08-29 is treated as expression ((2012 - 08) - 29). Result will be 1975, not what you might have expected. sprintf( sqlquery, "INSERT INTO tblTest ( CINDEX, CDATE, CDESCR, CAMOUNT ) VALUES ( 5, '2012-08-29', 'Testitem', 300 )"); And you likely should use sqlite3_prepare_v2, placeholders, sqlite3_bind_int and sqlite3_bind_text instead of sprintf. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] why no such column in sqlite3 ?
Put single quotes around Testitem: sprintf( sqlquery, "INSERT INTO tblTest ( CINDEX, CDATE, CDESCR, CAMOUNT ) VALUES ( 5, 2012-08-29, 'Testitem', 300 )"); RobR ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
[sqlite] why no such column in sqlite3 ?
Hello all, I started to experiment with SQLite3. I created database with rc = sqlite3_exec(m_db, "CREATE TABLE [tblTest] ( [CINDEX] INTEGER PRIMARY KEY, [CDATE] DATE, [CDESCR] TEXT, [CAMOUNT] NUMERIC)", callback, 0, ); Then I added some items into table with sqlitebrowser_200. In my code, I can work with table, get items, etc. But I don't know why "INSERT" does not work. I use following: sprintf( sqlquery, "INSERT INTO tblTest ( CINDEX, CDATE, CDESCR, CAMOUNT ) VALUES ( 5, 2012-08-29, Testitem, 300 )"); rc = sqlite3_exec(m_db, sqlquery, callback, 0, ); and getting SQL error "No such column : Testitem". Whatever I write to this third position, I get either this error, or "Unrecognized token" in case "testitem" begins with number. I use sqlite3.c source code, WinXP x86, GCC4.6.1 MinGW compiler. Anybody knows where is the problem ? Thank you in advance. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] SQLITE in a Win7 Service Application [SOLVED]
Hi, Thank you for your assistance. We have solved the below mentioned problem: The reason was that the temp directory of the service did not exist - so sqlite was not able to create temp files in that non-existing directory. We checked the 'TMP' and/or 'TEMP' environment variables of the service and noticed that the configured directory did not exist. Our installer does now ensure that the temp directory of the service user exists during the installation of our application. => For Java JDBC users: Please note that it is NOT sufficient to set the temp directory in the 'java.io.tmpdir' settings since sqlite is an attached dll and uses the %TMP% or %TEMP% environment variable for that purpose. Hope this helps others with the same problem Regards Markus Von:markus ruettimannAn: sqlite-users@sqlite.org Datum: 15.08.2012 17:20 Betreff:[sqlite] SQLITE in a Win7 Service Application Gesendet von: sqlite-users-boun...@sqlite.org Hi, We are facing problems when the sqlite database () is used within an application that runs as a Win7 service under the local system account. The application is written in Java and we use the sqlite-jdbc-3.7.2 JDBC driver. How ever we can create a new database, reading and writing to it withount any problem. The only thing that is not working is the ATTACH DATABASE SQL command. We constantly receive a CAN_NOT_OPEN error code. When we start the same application under a local user everything works fine. I have to add the both databases that are to be attached are in the same folder and have been created by the Application itself. There are no access restrictions on the database folders or files. Does anyone know about this and / or has a solution? Kind regards Markus ___ 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] typo in vdbe.c
file vdbe.c line 659: /* On any opcode with the "out2-prerelase" tag, free any should be "out-prerelease" ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users