Re: [sqlite] SQLite parsing of a .sql file
Checking for NULL on the statement fixed it :) -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Roger Binns Sent: Friday, April 09, 2010 5:43 PM To: General Discussion of SQLite Database Subject: Re: [sqlite] SQLite parsing of a .sql file On 04/09/2010 01:25 PM, Shaun Seckman (Firaxis) wrote: > I'm running into a nasty problem towards the end of the file however. > At the very end there are 3 characters left that are just whitespace > characters. When I pass this string into sqlite3_prepare_v2() I get a > return value of 0 as if it's a valid statement. http://sqlite.org/c3ref/prepare.html If the input text contains no SQL (if the input is an empty string or a comment) then *ppStmt is set to NULL Similarly your file could contain this. I suggest using it for testing. select 3 > However, when I attempt > to call sqlite3_sql() I will get a crash in sqlite. Don't do that then. prepare already told you there was no SQL. Note that pzTail is still set correctly. > If I call > sqlite3_step() I receive the error code SQLITE_MISUSE. Don't do that either :-) > What would be very useful is if whitespace or comments were the only > data passed into sqlite3_prepvare_v2() for it to return an error code > that it was an empty statement or something similar. It does, except an empty statement is not an error. You get NULL returned as documented. > Otherwise there's > no other way that I can tell how you could prevent the misuse code or > crash to occur. You are way overthinking all this. Additionally you do not need to call sqlite3_sql since zSql was the start of the statement and pzTail points to the end. This will be the case even when there are empty statements. > I know there is sqlite_complete() but I would have expected prepare to > perform something similar. Also sqlite_complete assumes a NULL > terminated string which is different from most other API functions that > allow for a string/length combination. complete is unrelated to your problem unless you are trying to a read the contents of a file in the smallest chunks possible. Roger ___ 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] Index and GLOB
First thanks to all that have helped on previous occasions. I'm a little confused about some results using an index and GLOB. I'm trying to optimize some queries to ensure they use an index after reviewing the LIKE Optimization section at the sqlite website. Using the latest binary, sqlite3-3.6.23.1.bin.gz sqlite> CREATE TABLE tb_file (tb_file_key INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT , basename TEXT, extension TEXT, path TEXT, deleted INTEGER default 0 ); sqlite> CREATE INDEX fullpath_idx on tb_file (basename, extension, path); sqlite> INSERT INTO tb_file (basename, extension, path) VALUES ('a', 'b', 'c'); sqlite> select * from tb_file; tb_f basename exte path dele - 1 a b c 0 sqlite> explain query plan SELECT tb_file_key, basename, extension, path FROM tb_file WHERE basename GLOB 'a*' AND extension GLOB 'b' AND path GLOB 'c'; orde from deta - 0 0 TABLE tb_file WITH INDEX fullpath_idx sqlite> explain query plan SELECT tb_file_key, basename, extension, path FROM tb_file WHERE basename GLOB 'a' AND extension GLOB 'b*' AND path GLOB 'c'; orde from deta - 0 0 TABLE tb_file USING PRIMARY KEY ORDER BY The first select uses the index since the the glob character is picked up, while the second does not. Is this expected? Does it matter? Thanks ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] SQLite parsing of a .sql file
So, using the tail pointer from sqlite3_prepare_v2() I'm now running through a loop to process all statements in a file. I'm presently using pointer math in order to determine the length of the tail command since no length value is returned as part of the function. I'm running into a nasty problem towards the end of the file however. At the very end there are 3 characters left that are just whitespace characters. When I pass this string into sqlite3_prepare_v2() I get a return value of 0 as if it's a valid statement. However, when I attempt to call sqlite3_sql() I will get a crash in sqlite. If I call sqlite3_step() I receive the error code SQLITE_MISUSE. What would be very useful is if whitespace or comments were the only data passed into sqlite3_prepvare_v2() for it to return an error code that it was an empty statement or something similar. Otherwise there's no other way that I can tell how you could prevent the misuse code or crash to occur. I know there is sqlite_complete() but I would have expected prepare to perform something similar. Also sqlite_complete assumes a NULL terminated string which is different from most other API functions that allow for a string/length combination. Perhaps I missed something else in the documentation? -Shaun -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Shaun Seckman (Firaxis) Sent: Friday, April 09, 2010 3:37 PM To: General Discussion of SQLite Database Subject: Re: [sqlite] SQLite parsing of a .sql file Ah, I missed that in the documentation. This is perfect! Precisely what I needed with much less work than copying the shell.c code. Thanks a bunch! -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Dan Kennedy Sent: Friday, April 09, 2010 3:24 PM To: General Discussion of SQLite Database Subject: Re: [sqlite] SQLite parsing of a .sql file On Apr 10, 2010, at 1:51 AM, Adam DeVita wrote: > Is this a 1 off import? If so, perhaps the command line tool > can .read it. > > On Fri, Apr 9, 2010 at 2:13 PM, Shaun Seckman (Firaxis) < > shaun.seck...@firaxis.com> wrote: > >> Greetings, >> >> I've got a .SQL file that contains multiple SQL insert statements for >> various tables as well as comments embedded throughout. When I >> attempted to pass the file into sqlite3_exec, I found that only the >> first SQL command was getting executed. That should not be the case. sqlite3_exec() should execute the whole script. >> What is the best way to ensure >> that all commands are executed? Parsing the file line-by-line is >> inaccurate as multiple statements may be on the same line and looking >> for the next ';' character has parsing problems as well. >> >> >> >> The documents state that sqlite3_complete() only returns a 1 if the >> statement is complete. Were this method to return the index into the >> character array to denote WHERE the SQL statement is complete, I >> could >> use that to parse multiple statements. >> >> >> >> Does anyone have any suggestions? See also the 5th parameter to sqlite3_prepare_v2(). This API allows you to compile the first statement in an SQL script and returns a pointer to the start of the next statement in the script at the same time. http://www.sqlite.org/c3ref/prepare.html Dan. ___ 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] SQLite parsing of a .sql file
Ah, I missed that in the documentation. This is perfect! Precisely what I needed with much less work than copying the shell.c code. Thanks a bunch! -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Dan Kennedy Sent: Friday, April 09, 2010 3:24 PM To: General Discussion of SQLite Database Subject: Re: [sqlite] SQLite parsing of a .sql file On Apr 10, 2010, at 1:51 AM, Adam DeVita wrote: > Is this a 1 off import? If so, perhaps the command line tool > can .read it. > > On Fri, Apr 9, 2010 at 2:13 PM, Shaun Seckman (Firaxis) < > shaun.seck...@firaxis.com> wrote: > >> Greetings, >> >> I've got a .SQL file that contains multiple SQL insert statements for >> various tables as well as comments embedded throughout. When I >> attempted to pass the file into sqlite3_exec, I found that only the >> first SQL command was getting executed. That should not be the case. sqlite3_exec() should execute the whole script. >> What is the best way to ensure >> that all commands are executed? Parsing the file line-by-line is >> inaccurate as multiple statements may be on the same line and looking >> for the next ';' character has parsing problems as well. >> >> >> >> The documents state that sqlite3_complete() only returns a 1 if the >> statement is complete. Were this method to return the index into the >> character array to denote WHERE the SQL statement is complete, I >> could >> use that to parse multiple statements. >> >> >> >> Does anyone have any suggestions? See also the 5th parameter to sqlite3_prepare_v2(). This API allows you to compile the first statement in an SQL script and returns a pointer to the start of the next statement in the script at the same time. http://www.sqlite.org/c3ref/prepare.html Dan. ___ 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] SQLite parsing of a .sql file
On 04/09/2010 11:13 AM, Shaun Seckman (Firaxis) wrote: > What is the best way to ensure that all commands are executed? Load the whole file into memory or memory map it. Then call sqlite3_prepare/step/reset. prepare will point you to the beginning of the next statement if there is one. > The documents state that sqlite3_complete() only returns a 1 if the > statement is complete. Were this method to return the index into the > character array to denote WHERE the SQL statement is complete, I could > use that to parse multiple statements. sqlite3_complete tells you if there are one (or more) complete statements. It would be useful if you were providing an interactive shell. You could also use it with prepare/step/reset to read the file in statement sized chunks. Roger ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] SQLite parsing of a .sql file
Ah, I believe it is something that the command line tool can .read. Since I'm using just the static library, I'll have to copy the functionality from shell.c into my own code. Thanks! -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Adam DeVita Sent: Friday, April 09, 2010 2:52 PM To: General Discussion of SQLite Database Subject: Re: [sqlite] SQLite parsing of a .sql file Is this a 1 off import? If so, perhaps the command line tool can .read it. On Fri, Apr 9, 2010 at 2:13 PM, Shaun Seckman (Firaxis) < shaun.seck...@firaxis.com> wrote: > Greetings, > > I've got a .SQL file that contains multiple SQL insert statements for > various tables as well as comments embedded throughout. When I > attempted to pass the file into sqlite3_exec, I found that only the > first SQL command was getting executed. What is the best way to ensure > that all commands are executed? Parsing the file line-by-line is > inaccurate as multiple statements may be on the same line and looking > for the next ';' character has parsing problems as well. > > > > The documents state that sqlite3_complete() only returns a 1 if the > statement is complete. Were this method to return the index into the > character array to denote WHERE the SQL statement is complete, I could > use that to parse multiple statements. > > > > Does anyone have any suggestions? > > > > -Shaun > > > > > > ___ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > -- VerifEye Technologies Inc. 905-948-0015x245 7100 Warden Ave, Unit 3 Markham ON, L3R 8B5 Canada ___ 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] SQLite parsing of a .sql file
On Apr 10, 2010, at 1:51 AM, Adam DeVita wrote: > Is this a 1 off import? If so, perhaps the command line tool > can .read it. > > On Fri, Apr 9, 2010 at 2:13 PM, Shaun Seckman (Firaxis) < > shaun.seck...@firaxis.com> wrote: > >> Greetings, >> >> I've got a .SQL file that contains multiple SQL insert statements for >> various tables as well as comments embedded throughout. When I >> attempted to pass the file into sqlite3_exec, I found that only the >> first SQL command was getting executed. That should not be the case. sqlite3_exec() should execute the whole script. >> What is the best way to ensure >> that all commands are executed? Parsing the file line-by-line is >> inaccurate as multiple statements may be on the same line and looking >> for the next ';' character has parsing problems as well. >> >> >> >> The documents state that sqlite3_complete() only returns a 1 if the >> statement is complete. Were this method to return the index into the >> character array to denote WHERE the SQL statement is complete, I >> could >> use that to parse multiple statements. >> >> >> >> Does anyone have any suggestions? See also the 5th parameter to sqlite3_prepare_v2(). This API allows you to compile the first statement in an SQL script and returns a pointer to the start of the next statement in the script at the same time. http://www.sqlite.org/c3ref/prepare.html Dan. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] SQLite parsing of a .sql file
Is this a 1 off import? If so, perhaps the command line tool can .read it. On Fri, Apr 9, 2010 at 2:13 PM, Shaun Seckman (Firaxis) < shaun.seck...@firaxis.com> wrote: > Greetings, > > I've got a .SQL file that contains multiple SQL insert statements for > various tables as well as comments embedded throughout. When I > attempted to pass the file into sqlite3_exec, I found that only the > first SQL command was getting executed. What is the best way to ensure > that all commands are executed? Parsing the file line-by-line is > inaccurate as multiple statements may be on the same line and looking > for the next ';' character has parsing problems as well. > > > > The documents state that sqlite3_complete() only returns a 1 if the > statement is complete. Were this method to return the index into the > character array to denote WHERE the SQL statement is complete, I could > use that to parse multiple statements. > > > > Does anyone have any suggestions? > > > > -Shaun > > > > > > ___ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > -- VerifEye Technologies Inc. 905-948-0015x245 7100 Warden Ave, Unit 3 Markham ON, L3R 8B5 Canada ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
[sqlite] SQLite parsing of a .sql file
Greetings, I've got a .SQL file that contains multiple SQL insert statements for various tables as well as comments embedded throughout. When I attempted to pass the file into sqlite3_exec, I found that only the first SQL command was getting executed. What is the best way to ensure that all commands are executed? Parsing the file line-by-line is inaccurate as multiple statements may be on the same line and looking for the next ';' character has parsing problems as well. The documents state that sqlite3_complete() only returns a 1 if the statement is complete. Were this method to return the index into the character array to denote WHERE the SQL statement is complete, I could use that to parse multiple statements. Does anyone have any suggestions? -Shaun ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Poor query planning for virtual tables
Hello! On Friday 09 April 2010 18:27:52 Roger Binns wrote: > > Virtual table _doesn't_ use any index but query planner show this: > > 0|2|TABLE role_fts VIRTUAL TABLE INDEX 0: > > It is showing the results of the BestIndex virtual table method. Thanks. So the problem is in the FTS3 extension only. Best regards, Alexey Pechnikov. http://pechnikov.tel/ ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Poor query planning for virtual tables
On 04/09/2010 12:27 AM, Alexey Pechnikov wrote: > Virtual table _doesn't_ use any index but query planner show this: > 0|2|TABLE role_fts VIRTUAL TABLE INDEX 0: It is showing the results of the BestIndex virtual table method. Roger ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Export sqlite database to H2
On 9 April 2010 13:37, Andreas Henningssonwrote: > Hi > > I am about to change database from SQLite to H2 in a project of mine. > > Is there any tools I can use to do i it? What is the best way to export data > from an SQLite database? > The easiest is probably that you export your data from SQLite as an SQL dump, adapt it to the H2 dialect and use it to import your data into your H2 database. There is another solution however using the gda-sql tool from Libgda (I'm the Libgda's maintainer) where you can have more control over what get migrated from SQLite to H2 as the migration operation is done by executing some "INSERT into SELECT ... FROM " statements. The idea is to use the gda-sql command to open 2 connections: one to the SQLite database, and one to the H2 database and then "bind" them together into a 3rd virtual connection in which you execute the "INSERT into..." statements. If you want to explore this way, I can give you more details. Regards, Vivien ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] sqlite3_step() transaction
On 9 Apr 2010, at 11:57am, Igor Tandetnik wrote: > Christoph Walser, ETH Zurich wrote: >> Is there a way to do all the 5000 rows in one transaction to minimize >> database locking time? I know I can do a sqlite3_exec with "BEGIN >> TRANSACTION", then do the inserts and then "COMMIT TRANSACTIONS" but how >> does this work when using the bind, step and reset functions? > > Yes it does. Just to make it clear, Igor is recommending that you do explicitly call BEGIN TRANSACTION do the 5000 inserts END TRANSACTION as this will speed up your calls and reduce the amount of disk activity quite a lot. Simon. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Export sqlite database to H2
H2 is a java bases database. I have just started to use it and it works quite well. It have the datatypes you expect and a very natural SQL language. Mips, I do not know. It's open source I think. The only reason I use it is because I want to have the possibility to store files in the database. And the JDBC driver for H2 support this better then SQLite. /Andreas On Fri, Apr 9, 2010 at 1:47 PM, Navaneeth Sen Bwrote: > Hi Andreas, > > I have some questions. > Can H2 completely replace SQLite? > I would like to know more about H2. > Does that have a port on Linux-MIPS platform? > Does it have any licensing issues?(whether open source) > Can it perform better than SQLite? > Or what made you move to H2 from SQLite? > > Regards, > Sen > > On 4/9/2010 5:07 PM, Andreas Henningsson wrote: > > Hi > > > > I am about to change database from SQLite to H2 in a project of mine. > > > > Is there any tools I can use to do i it? What is the best way to export > data > > from an SQLite database? > > > > /Andreas > > > > > > ___ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > -- Andreas Henningsson "Vanligt sunt förnuft är inte särkilt vanligt." -- Voltaire ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Export sqlite database to H2
Hi Andreas, I have some questions. Can H2 completely replace SQLite? I would like to know more about H2. Does that have a port on Linux-MIPS platform? Does it have any licensing issues?(whether open source) Can it perform better than SQLite? Or what made you move to H2 from SQLite? Regards, Sen On 4/9/2010 5:07 PM, Andreas Henningsson wrote: > Hi > > I am about to change database from SQLite to H2 in a project of mine. > > Is there any tools I can use to do i it? What is the best way to export data > from an SQLite database? > > /Andreas > > ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
[sqlite] Export sqlite database to H2
Hi I am about to change database from SQLite to H2 in a project of mine. Is there any tools I can use to do i it? What is the best way to export data from an SQLite database? /Andreas -- Andreas Henningsson "Vanligt sunt förnuft är inte särkilt vanligt." -- Voltaire ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] sqlite3_step() transaction
Christoph Walser, ETH Zurich wrote: > I have a C application which generates around 1000 rows of data per > second to insert in an SQLite database. > What I now do is to collect 5000 rows in a buffer and then for each row, > execute sqlite3_bind_*, sqlite3_step, sqlite3_reset. > > I wonder now how sqlite does this internaly: with the above mentioned > technique, is every row capsulated into a single transaction or are they > one large transaction alltogether? If you don't issue explicit BEGIN and COMMIT statements, then each row is a separate transaction. > Is there a way to do all the 5000 rows in one transaction to minimize > database locking time? I know I can do a sqlite3_exec with "BEGIN > TRANSACTION", then do the inserts and then "COMMIT TRANSACTIONS" but how > does this work when using the bind, step and reset functions? Yes it does. -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
[sqlite] problem porting sqlite amalgamation 3.6.23.1 to vxworks 6.5 pentium3 DKM
I created a vxworks 6.5 Pentium3 downloadable kernel module project . Sqlite3.c and sqlite3.h were imported into project. But when I compiled the sqlite3.c I got the following error output. I wonder whether this package can be directly put into use without any problem with vxworks 6.5. Hope someone can help me .Thanks in advance! - Build Started in Project 'sqlite3': 2010-04-09 15:31:58 Generation of makefiles started. Generation of makefiles finished (Elapsed Time: 00:00). Platform: Wind River VxWorks 6.5 Command: make --no-print-directory BUILD_SPEC=PENTIUMgnu DEBUG_MODE=1 TRACE=1 PENTIUMgnu_DEBUG/sqlite3.o Working Directory: F:/software_project/mpu_firmware/gmc96_mpu_firmware_vxworks_image_project_v1.3/gmc96_mpu_firmware_vxworks_image_project_v1.3/sqlite3 echo "building PENTIUMgnu_DEBUG/sqlite3.o"; ccpentium -g -mtune=pentium -march=pentium -ansi -Wall -MD -MP -ID:/WindRiver/vxworks-6.5/target/h -ID:/WindRiver/vxworks-6.5/target/h/wrn/coreip -DCPU =PENTIUM -DTOOL_FAMILY=gnu -DTOOL=gnu -D_WRS_KERNEL-o "PENTIUMgnu_DEBUG/sqlite3.o" -c "sqlite3.c" building PENTIUMgnu_DEBUG/sqlite3.o In file included from D:/WindRiver/vxworks-6.5/target/h/vxWorksCommon.h:296, from D:/WindRiver/vxworks-6.5/target/h/vxWorks.h:84, from D:/WindRiver/vxworks-6.5/target/h/private/handleLibP.h:21, from D:/WindRiver/vxworks-6.5/target/h/stdio.h:62, from sqlite3.c:6522: D:/WindRiver/vxworks-6.5/target/h/version.h:82: error: syntax error before "char" D:/WindRiver/vxworks-6.5/target/h/version.h:83: error: syntax error before "char" D:/WindRiver/vxworks-6.5/target/h/version.h:84: error: syntax error before "char" D:/WindRiver/vxworks-6.5/target/h/version.h:85: error: syntax error before "char" D:/WindRiver/vxworks-6.5/target/h/version.h:87: error: syntax error before "const" D:/WindRiver/vxworks-6.5/target/h/version.h:88: error: syntax error before "const" D:/WindRiver/vxworks-6.5/target/h/version.h:89: error: syntax error before "const" In file included from D:/WindRiver/vxworks-6.5/target/h/stdio.h:62, from sqlite3.c:6522: D:/WindRiver/vxworks-6.5/target/h/private/handleLibP.h:39: error: syntax error before "UINT32" D:/WindRiver/vxworks-6.5/target/h/private/handleLibP.h:39: warning: no semicolon at end of struct or union D:/WindRiver/vxworks-6.5/target/h/private/handleLibP.h:40: warning: type defaults to `int' in declaration of `attributes' D:/WindRiver/vxworks-6.5/target/h/private/handleLibP.h:40: warning: data definition has no type or storage class D:/WindRiver/vxworks-6.5/target/h/private/handleLibP.h:41: error: syntax error before "type" D:/WindRiver/vxworks-6.5/target/h/private/handleLibP.h:41: warning: type defaults to `int' in declaration of `type' D:/WindRiver/vxworks-6.5/target/h/private/handleLibP.h:41: warning: data definition has no type or storage class D:/WindRiver/vxworks-6.5/target/h/private/handleLibP.h:42: error: syntax error before "contextType" D:/WindRiver/vxworks-6.5/target/h/private/handleLibP.h:42: warning: type defaults to `int' in declaration of `contextType' D:/WindRiver/vxworks-6.5/target/h/private/handleLibP.h:42: warning: data definition has no type or storage class D:/WindRiver/vxworks-6.5/target/h/private/handleLibP.h:43: warning: type defaults to `int' in declaration of `HANDLE' D:/WindRiver/vxworks-6.5/target/h/private/handleLibP.h:43: warning: data definition has no type or storage class D:/WindRiver/vxworks-6.5/target/h/private/handleLibP.h:45: error: syntax error before '*' token D:/WindRiver/vxworks-6.5/target/h/private/handleLibP.h:45: warning: type defaults to `int' in declaration of `HANDLE_ID' D:/WindRiver/vxworks-6.5/target/h/private/handleLibP.h:45: warning: data definition has no type or storage class D:/WindRiver/vxworks-6.5/target/h/private/handleLibP.h:49: error: syntax error before "handleContextGet" D:/WindRiver/vxworks-6.5/target/h/private/handleLibP.h:49: error: syntax error before "handleId" D:/WindRiver/vxworks-6.5/target/h/private/handleLibP.h:50: warning: type defaults to `int' in declaration of `handleContextGet' D:/WindRiver/vxworks-6.5/target/h/private/handleLibP.h:50: warning: data definition has no type or storage class D:/WindRiver/vxworks-6.5/target/h/private/handleLibP.h:51: error: syntax error before "handleId" D:/WindRiver/vxworks-6.5/target/h/private/handleLibP.h:53: error: syntax error before "handleContextSet" D:/WindRiver/vxworks-6.5/target/h/private/handleLibP.h:53: error: syntax error before "handleId" D:/WindRiver/vxworks-6.5/target/h/private/handleLibP.h:54: warning: type defaults to `int' in declaration of `handleContextSet' D:/WindRiver/vxworks-6.5/target/h/private/handleLibP.h:54: warning: data definition has no type or storage class D:/WindRiver/vxworks-6.5/target/h/private/handleLibP.h:55: error: syntax error before
[sqlite] problem porting sqlite amalgamation 3.6.23.1 to vxworks 6.5 DKM
I created a downloadable kernel module project . Sqlite3.c and sqlite3.h were imported into project. But when I compiled the sqlite3.c I got the following error output. I wonder whether this package can be directly put into use without any problem with vxworks 6.5. Hope someone can help me .Thanks in advance! - Build Started in Project 'sqlite3': 2010-04-09 15:31:58 Generation of makefiles started. Generation of makefiles finished (Elapsed Time: 00:00). Platform: Wind River VxWorks 6.5 Command: make --no-print-directory BUILD_SPEC=PENTIUMgnu DEBUG_MODE=1 TRACE=1 PENTIUMgnu_DEBUG/sqlite3.o Working Directory: F:/software_project/mpu_firmware/gmc96_mpu_firmware_vxworks_image_project_v1.3/gmc96_mpu_firmware_vxworks_image_project_v1.3/sqlite3 echo "building PENTIUMgnu_DEBUG/sqlite3.o"; ccpentium -g -mtune=pentium -march=pentium -ansi -Wall -MD -MP -ID:/WindRiver/vxworks-6.5/target/h -ID:/WindRiver/vxworks-6.5/target/h/wrn/coreip -DCPU =PENTIUM -DTOOL_FAMILY=gnu -DTOOL=gnu -D_WRS_KERNEL-o "PENTIUMgnu_DEBUG/sqlite3.o" -c "sqlite3.c" building PENTIUMgnu_DEBUG/sqlite3.o In file included from D:/WindRiver/vxworks-6.5/target/h/vxWorksCommon.h:296, from D:/WindRiver/vxworks-6.5/target/h/vxWorks.h:84, from D:/WindRiver/vxworks-6.5/target/h/private/handleLibP.h:21, from D:/WindRiver/vxworks-6.5/target/h/stdio.h:62, from sqlite3.c:6522: D:/WindRiver/vxworks-6.5/target/h/version.h:82: error: syntax error before "char" D:/WindRiver/vxworks-6.5/target/h/version.h:83: error: syntax error before "char" D:/WindRiver/vxworks-6.5/target/h/version.h:84: error: syntax error before "char" D:/WindRiver/vxworks-6.5/target/h/version.h:85: error: syntax error before "char" D:/WindRiver/vxworks-6.5/target/h/version.h:87: error: syntax error before "const" D:/WindRiver/vxworks-6.5/target/h/version.h:88: error: syntax error before "const" D:/WindRiver/vxworks-6.5/target/h/version.h:89: error: syntax error before "const" In file included from D:/WindRiver/vxworks-6.5/target/h/stdio.h:62, from sqlite3.c:6522: D:/WindRiver/vxworks-6.5/target/h/private/handleLibP.h:39: error: syntax error before "UINT32" D:/WindRiver/vxworks-6.5/target/h/private/handleLibP.h:39: warning: no semicolon at end of struct or union D:/WindRiver/vxworks-6.5/target/h/private/handleLibP.h:40: warning: type defaults to `int' in declaration of `attributes' D:/WindRiver/vxworks-6.5/target/h/private/handleLibP.h:40: warning: data definition has no type or storage class D:/WindRiver/vxworks-6.5/target/h/private/handleLibP.h:41: error: syntax error before "type" D:/WindRiver/vxworks-6.5/target/h/private/handleLibP.h:41: warning: type defaults to `int' in declaration of `type' D:/WindRiver/vxworks-6.5/target/h/private/handleLibP.h:41: warning: data definition has no type or storage class D:/WindRiver/vxworks-6.5/target/h/private/handleLibP.h:42: error: syntax error before "contextType" D:/WindRiver/vxworks-6.5/target/h/private/handleLibP.h:42: warning: type defaults to `int' in declaration of `contextType' D:/WindRiver/vxworks-6.5/target/h/private/handleLibP.h:42: warning: data definition has no type or storage class D:/WindRiver/vxworks-6.5/target/h/private/handleLibP.h:43: warning: type defaults to `int' in declaration of `HANDLE' D:/WindRiver/vxworks-6.5/target/h/private/handleLibP.h:43: warning: data definition has no type or storage class D:/WindRiver/vxworks-6.5/target/h/private/handleLibP.h:45: error: syntax error before '*' token D:/WindRiver/vxworks-6.5/target/h/private/handleLibP.h:45: warning: type defaults to `int' in declaration of `HANDLE_ID' D:/WindRiver/vxworks-6.5/target/h/private/handleLibP.h:45: warning: data definition has no type or storage class D:/WindRiver/vxworks-6.5/target/h/private/handleLibP.h:49: error: syntax error before "handleContextGet" D:/WindRiver/vxworks-6.5/target/h/private/handleLibP.h:49: error: syntax error before "handleId" D:/WindRiver/vxworks-6.5/target/h/private/handleLibP.h:50: warning: type defaults to `int' in declaration of `handleContextGet' D:/WindRiver/vxworks-6.5/target/h/private/handleLibP.h:50: warning: data definition has no type or storage class D:/WindRiver/vxworks-6.5/target/h/private/handleLibP.h:51: error: syntax error before "handleId" D:/WindRiver/vxworks-6.5/target/h/private/handleLibP.h:53: error: syntax error before "handleContextSet" D:/WindRiver/vxworks-6.5/target/h/private/handleLibP.h:53: error: syntax error before "handleId" D:/WindRiver/vxworks-6.5/target/h/private/handleLibP.h:54: warning: type defaults to `int' in declaration of `handleContextSet' D:/WindRiver/vxworks-6.5/target/h/private/handleLibP.h:54: warning: data definition has no type or storage class D:/WindRiver/vxworks-6.5/target/h/private/handleLibP.h:55: error: syntax error before "handleInit"
Re: [sqlite] Poor query planning for virtual tables
Hello! On Friday 09 April 2010 01:28:18 Jay A. Kreibich wrote: > Exactly like every other query the database makes? Why would > this be different? Virtual table _doesn't_ use any index but query planner show this: 0|2|TABLE role_fts VIRTUAL TABLE INDEX 0: Why planner don't show full-teable scan as "TABLE role_fts VIRTUAL TABLE"? Best regards, Alexey Pechnikov. http://pechnikov.tel/ ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
[sqlite] sqlite3_step() transaction
Hi everybody, I have a C application which generates around 1000 rows of data per second to insert in an SQLite database. What I now do is to collect 5000 rows in a buffer and then for each row, execute sqlite3_bind_*, sqlite3_step, sqlite3_reset. I wonder now how sqlite does this internaly: with the above mentioned technique, is every row capsulated into a single transaction or are they one large transaction alltogether? Is there a way to do all the 5000 rows in one transaction to minimize database locking time? I know I can do a sqlite3_exec with "BEGIN TRANSACTION", then do the inserts and then "COMMIT TRANSACTIONS" but how does this work when using the bind, step and reset functions? Thanks for any help, Christoph ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users