Re: [sqlite] How to get the total row number of a table by Sqlite more efficient?

2009-01-11 Thread Wenton Thomas
There is no guarantee that it always gets the correct result. For example, we insert 10 records and then delete 2 of them. If the 2 records does not hold the maximum id, the result is not correct. From: jesuscheung To:

[sqlite] trouble in creating table

2009-01-11 Thread Wenton Thomas
I create a table in sqlite 3.5.9, return value indicates success but when I insert records into the table, the return error code is SQLITE_CORRUPT. I search internet web for answer,someone says the reason is there is no disk space left. But I am sure disk space is enough for database

[sqlite] How to drop table in trigger

2009-02-06 Thread Wenton Thomas
could anyone help me ? The sqlite version i usedis 3.5.0. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

[sqlite] why does sqlite3_changes always return -1

2009-02-08 Thread Wenton Thomas
In my program, when executing the following statement rc= sqlite3_exec(db,"delete from test where ...",NULL,NULL,NULL) to delete some records from table test. rc is SQLITE_OK, but after then ,I used sqlite3_changes(db) to get the num of records deleted, it always return -1. Could anyone help

[sqlite] Is sqlite3_next_stmt valid command in SQLite 3.5.9?

2009-02-11 Thread Wenton Thomas
Could anyone help me? ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

[sqlite] problem with SQLITE_FULL

2009-02-27 Thread Wenton Thomas
I used sqlite 3.5.9 in my application. I attempt to insert 1000 records. When i inserted 700 records, sqlite3_step() return SQLITE_FULL. The free disk space is about 1,300M and max id in the table is 700. I have no idea how to solve it. Could anyone help me?

[sqlite] fail to drop table in transaction

2009-04-12 Thread Wenton Thomas
I created two tables A and B. There exists a record which contains B's information. Now I need to drop table B and delete all its information in table A. The two actions were wrapped in a transaction,but dropping table always fail. Error no is SQLITE_CANTOPENwhich means"Unable to open

Re: [sqlite] fail to drop table in transaction

2009-04-13 Thread Wenton Thomas
. From: Kees Nuyt <k.n...@zonnet.nl> To: sqlite-users@sqlite.org Sent: Monday, April 13, 2009 3:22:58 PM Subject: Re: [sqlite] fail to drop table in transaction On Sun, 12 Apr 2009 20:46:40 -0700 (PDT), Wenton Thomas <thomas.wen...@yahoo.com> wrote:

Re: [sqlite] fail to drop table in transaction

2009-04-13 Thread Wenton Thomas
g Sent: Monday, April 13, 2009 8:10:12 PM Subject: Re: [sqlite] fail to drop table in transaction On Mon, 13 Apr 2009 02:35:46 -0700 (PDT), Wenton Thomas <thomas.wen...@yahoo.com> wrote: > I didn't test it from command tool yet. Well, that is the first thing to try. > I have a ta

[sqlite] record order in select

2009-04-24 Thread Wenton Thomas
If "order by" isn't used in a select statment, does the result records ordered in rowid? ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

[sqlite] about insert into select

2009-05-20 Thread Wenton Thomas
What's the execution sequence about " insert ino A select from B "? I means,which is correct prescription in the following: (1) select all rows from B at first, then insert all the result into table A; (2) select a row from B ,then insert the row into table A immediately, repeat the

[sqlite] database exception question

2009-06-29 Thread Wenton Thomas
When executing "pragma integrity_check" ,sqlite will return a error message if there exist something wrong with the database file. Now I wonder what's the max length of the error message? Is it possiable that the length exceeds 255?

[sqlite] problem with SQLITE_BUSY

2009-07-04 Thread Wenton Thomas
Now in my system I used sqlite to manage 2 database file A.db and B.db, and each has a connection handle cA, cB. My operation perform like this: sqlite3_exec( select records from cA) sqlite3_exec("begin transaction"); insert all records into cB; sqlite3_exec("commit transaction"); All

Re: [sqlite] problem with SQLITE_BUSY

2009-07-04 Thread Wenton Thomas
.. sqlite3_open database B ATTACH DATABASE A.db AS dbA BEGIN INSERT INTO main.mytable(col1,...colN) SELECT col1,...colN FROM dbA.myothertable COMMIT DETACH dbA sqlite3_close B.db Cheers! From: Wenton Thomas <thomas.wen...@yahoo.com> To: sqlite-user

Re: [sqlite] problem with SQLITE_BUSY

2009-07-04 Thread Wenton Thomas
I use prepare statements, and I am sure I finalize all of them. From: Igor Tandetnik <itandet...@mvps.org> To: sqlite-users@sqlite.org Sent: Saturday, July 4, 2009 8:44:52 PM Subject: Re: [sqlite] problem with SQLITE_BUSY Wenton Thomas wrote: >

Re: [sqlite] problem with SQLITE_BUSY

2009-07-05 Thread Wenton Thomas
org> Sent: Saturday, July 4, 2009 10:03:47 PM Subject: Re: [sqlite] problem with SQLITE_BUSY On Jul 4, 2009, at 8:12 PM, Wenton Thomas wrote: > I use prepare statements, and I am sure I finalize all of them. You may be mistaken. sqlite3_next_stmt() will return 0 if all statements reall

[sqlite] problem about group by and order by

2009-10-12 Thread Wenton Thomas
Does the following sql statement produce same result? (1)select a,b from tbl group by a ordr by a . (2)select a,b from tbl group by a. In the sqlite website, it says if there is not exist a Transient Indices for group by or order by, sqlite will create the Transient

[sqlite] when to create temporary disk file for group by and order by?

2009-10-14 Thread Wenton Thomas
sqlite perform group by and order by using transient index, and if there isn't exist such an index, sqlite will create the index and store it in its a temporary file. So I think the following SQL statement won't create temporary file in disk. create table tbl(a,b,c);

[sqlite] keyword BEGIN in trigger statement

2009-10-16 Thread Wenton Thomas
For example, CREATE TRIGGER update_customer_address UPDATE OF address ON customers BEGIN UPDATE orders SET address = new.address WHERE customer_name = old.name; END; when updating address ON customers, then follow a BEGIN ...END statement. Does the BEGIN start a transaction?