Re: [sqlite] extension-functions.tgz for sqlite3 3.4.1 ?

2007-08-31 Thread Joe Wilson
--- Liam Healy <[EMAIL PROTECTED]> wrote: > Thanks. I have changed the use of sqlite3CreateFunc to > sqlite3_create_function. I did not need to include the source code for > sqlite3utf8CharLen because there's a sqlite3Utf8CharLen (note different > capitalization) in the library. However, the

Re: [sqlite] Difference between OR and IN [http://www.sqlite.org/php2004/page-052.html]

2007-08-31 Thread Dan Kennedy
On Sat, 2007-09-01 at 11:58 +0800, RaghavendraK 70574 wrote: > Hi, > > In one of the slides "http://www.sqlite.org/php2004/page-052.html; > it is stated "OR will make DBEngine not to use Indexes" and IN will > make DBEngine use > indexes" > > I could not understand the rationale abt this. Can u

[sqlite] Difference between OR and IN [http://www.sqlite.org/php2004/page-052.html]

2007-08-31 Thread RaghavendraK 70574
Hi, In one of the slides "http://www.sqlite.org/php2004/page-052.html; it is stated "OR will make DBEngine not to use Indexes" and IN will make DBEngine use indexes" I could not understand the rationale abt this. Can u explain? regards ragha

Re: [sqlite] extension-functions.tgz for sqlite3 3.4.1 ?

2007-08-31 Thread Liam Healy
Thanks. I have changed the use of sqlite3CreateFunc to sqlite3_create_function. I did not need to include the source code for sqlite3utf8CharLen because there's a sqlite3Utf8CharLen (note different capitalization) in the library. However, the definition of sqlite3ReadUtf8 and needed

RE: [sqlite] Problem inserting blob

2007-08-31 Thread Prakash Reddy Bande
OK, I figured it out X should be followed by only hex characters 0-9, a-f. Regards, Prakash Reddy Bande Altair Engg. Inc, Troy, MI -Original Message- From: Prakash Reddy Bande [mailto:[EMAIL PROTECTED] Sent: Friday, August 31, 2007 4:00 PM To: sqlite-users@sqlite.org Subject: [sqlite]

Re: [sqlite] Problem inserting blob

2007-08-31 Thread Cesar D. Rodas
insert into t values ("x'ccaa-ffee'"); or insert into t values ('x''ccaa-ffee'''); What you wanna insert must be between " or ' (''[double ' ] is the scape of ') The cleanest way to do is compiling the query On 31/08/2007, Prakash Reddy Bande <[EMAIL PROTECTED]> wrote: > > Hi, > > I am trying

[sqlite] Problem inserting blob

2007-08-31 Thread Prakash Reddy Bande
Hi, I am trying to insert blob in a sqlite database using sqlite.exe . create table t (x blob); insert into t values (x'ccaaffee'); insert into t values (x'ccaa-ffee'); // This line give the error SQL error: unrecognized token: "x'ccaa" Where am I going wrong? Regards, Prakash

Re: [sqlite] version 3.5.0 - Segv

2007-08-31 Thread Ken
I did do an update this morning to pick up the latest code base. I guess the prior version that I had check out earlier in the week was not the most current. [EMAIL PROTECTED] wrote: Ken wrote: > The segv seems to be resolved. At least no more issues > with this version of the code. >

Re: [sqlite] extension-functions.tgz for sqlite3 3.4.1 ?

2007-08-31 Thread Joe Wilson
--- Liam Healy <[EMAIL PROTECTED]> wrote: > I was the one who packaged up extension-functions.tgz and posted on > contrib. I didn't author the original code but I'd like to fix this up. > I'm not clear on what needs to be changed. I gather that sqlite3utf8CharLen > and sqlite3CreateFunc

Re: [sqlite] rowid versus docid for fts3.

2007-08-31 Thread Scott Hess
Unfortunately, the reason fts2 couldn't be "fixed" was because you can't perform the necessary ALTER TABLE if the column you're adding is a primary key. Since the only alternative would be to build a new table and copy everything over, it seemed more reasonable to just let the app developer do

Re: [sqlite] extension-functions.tgz for sqlite3 3.4.1 ?

2007-08-31 Thread Liam Healy
I was the one who packaged up extension-functions.tgz and posted on contrib. I didn't author the original code but I'd like to fix this up. I'm not clear on what needs to be changed. I gather that sqlite3utf8CharLen and sqlite3CreateFunc shouldn't be used. I'm not sure how to convert to use the

Re: [sqlite] Performance tuning for Insert and select operations

2007-08-31 Thread Joe Wilson
--- venkata ramana <[EMAIL PROTECTED]> wrote: > I am using SQLite 3_3_17with the default configuration of SQLite. > Using Windows XP C++ API. > 50,000 inserts into Table (with primary key and no other index as single > transaction commit) is taking 4.609000 sec. > 50,000 selects from Table (

Re: [sqlite] (select *) VS (select column1, column2 ...)

2007-08-31 Thread Joe Wilson
Using SELECT * will be slower. How much slower depends on your table. Why don't you test it and see? --- "B V, Phanisekhar" <[EMAIL PROTECTED]> wrote: > Assume I have a table with 40 columns. I would like to know the > difference between > > Select * from table > > Select column1, column2,

Re: [sqlite] rowid versus docid for fts3.

2007-08-31 Thread Joe Wilson
--- Ralf Junker <[EMAIL PROTECTED]> wrote: > This one just came to my mind: > > CREATE TABLE (rowid INTEGER PRIMARY KEY, t TEXT); > > This promotes "rowid" to a visible column "rowid" which does not change > during a VACUUM. "rowid" > is already a reserved word in SQLite. Maybe this option is

Re: [sqlite] version 3.5.0 - Segv

2007-08-31 Thread Joe Wilson
--- Dan Kennedy <[EMAIL PROTECTED]> wrote: > On Thu, 2007-08-30 at 19:13 -0700, Joe Wilson wrote: > > I see what's going on now. I incorrectly assumed that both configure > > builds and the amalgamation were both threadsafe by default in the > > 3.4.x sources. > > > > It appears that a default

[sqlite] Is there any book (books??) to help us creating a bidirectional Sync tool?

2007-08-31 Thread jfbaro
Hi guys, We have been looking for books which cover the DB synchronisation subject. We have started creating a plugin to our socket server but we quickly realised how much of a challenge it would be (We are creating it "from scratch"). The conflict problems, the order to tables (rows) be

[sqlite] 3.5.0 error

2007-08-31 Thread Ken
Running the same code (sqlitetest_thrd35.c) using shared_cache, occasionally generates the following output: Where did the table go? 0 => Executing: COMMIT 3 => Executing: INSERT INTO test_table VALUES(3, 0, 'test3_0') 0 => Executing: select count(*) from test_Table 3 => Executing: INSERT INTO

Re: [sqlite] version 3.5.0 - Segv

2007-08-31 Thread drh
Ken <[EMAIL PROTECTED]> wrote: > The segv seems to be resolved. At least no more issues > with this version of the code. > That's funny, because I haven't changed anything to address your problem. I never could reproduce it. Perhaps you were using a version of the code that was two or three

[sqlite] select round(98926650.50001, 1) ?

2007-08-31 Thread Serena Lien
Hello, With SQLite 3.3.13, this returns 98926650.501 Can you explain how I can get the expected rounding/truncation? thanks.

Re: [sqlite] version 3.5.0 - Segv

2007-08-31 Thread Ken
The segv seems to be resolved. At least no more issues with this version of the code. $Id: sqliteInt.h,v 1.606 2007/08/30 14:10:30 drh Exp $ Thanks for a great product. Ken

[sqlite] SQL logic error or missing

2007-08-31 Thread Jiri Hajek
Hi, Some time ago I asked here about a strange and very rare SQLite DB problem that puzzles me, but unfortunatelly I got no answer. I'll try to describe it again and hopefully someone will be able to comment it... Very rarely (I have just 5 debug logs from all our beta testers) executing

Re: [sqlite] Regenerating ROWID...?

2007-08-31 Thread Babu, Lokesh
Thanks Simon, Time being I was looking for the same. Thanks again for the help. On 8/31/07, Simon Davies <[EMAIL PROTECTED]> wrote: > On 31/08/2007, Babu, Lokesh <[EMAIL PROTECTED]> wrote: > > I was trying the following piece of code (see below), > > > > The requirement here is very simple, I

RE: [sqlite] (select *) VS (select column1, column2 ...)

2007-08-31 Thread Tom Briggs
In general, it's best to only include the columns you need in the SELECT clause. And not just with SQLite - that's the best approach when dealing with any database. SQLite is a bit more forgiving because there's no network between the client and the database to slow things down, but that's

Re: [sqlite] Regenerating ROWID...?

2007-08-31 Thread Simon Davies
On 31/08/2007, Babu, Lokesh <[EMAIL PROTECTED]> wrote: > I was trying the following piece of code (see below), > > The requirement here is very simple, I want the t_id field or ROWID > field to be regenerated sequentially even after delete has been > performed. > Hi Lokesh, You can achieve this

[sqlite] Regenerating ROWID...?

2007-08-31 Thread Babu, Lokesh
I was trying the following piece of code (see below), The requirement here is very simple, I want the t_id field or ROWID field to be regenerated sequentially even after delete has been performed. In the below code, I have created a table with 3 fields, Inserted 1000 records, Deleted some middle

Re: [sqlite] rowid versus docid for fts3.

2007-08-31 Thread Ralf Junker
This one just came to my mind: CREATE TABLE (rowid INTEGER PRIMARY KEY, t TEXT); This promotes "rowid" to a visible column "rowid" which does not change during a VACUUM. "rowid" is already a reserved word in SQLite. Maybe this option is even compatible to FTS2? Ralf >ext/fts3.c in the

Re: [sqlite] compiling

2007-08-31 Thread John Stanton
nishit sharma wrote: hi all, i have made a sampe which is opening a database file but i m unable to compile that source code and getting error that undefined reference to sqlite3_open(). i m compiling as gcc test.c can anybody tell that these is the command to compile sqlite3 application or we

Re: [sqlite] running code

2007-08-31 Thread nishit sharma
i m able to run the code. how can i read some specific stuff from that database entry regards Nishit On 8/31/07, kirrthana M <[EMAIL PROTECTED]> wrote: > > Your test1.o with 2 arguments > first will be the name of the database and the second will be some sql > command to be executed. > >

RE: [sqlite] running code

2007-08-31 Thread kirrthana M
Your test1.o with 2 arguments first will be the name of the database and the second will be some sql command to be executed. -Original Message- From: nishit sharma [mailto:[EMAIL PROTECTED] Sent: Friday, August 31, 2007 5:13 PM To: sqlite-users@sqlite.org Subject: [sqlite]

[sqlite] running code

2007-08-31 Thread nishit sharma
here i am attaching a code can anyone tell me how to run this code. waiting for reply #include #include static int callback(void *NotUsed, int argc, char **argv, char **azColName){ int i; for(i=0; i

[sqlite] (select *) VS (select column1, column2 ...)

2007-08-31 Thread B V, Phanisekhar
Assume I have a table with 40 columns. I would like to know the difference between Select * from table Select column1, column2, column3 from table While doing SQLITE3_PREPARE, will both take same amount of time? While doing SQLITE3_STEP, will both take same amount of time?

Re: [sqlite] compiling

2007-08-31 Thread nishit sharma
i have downloaded sqlite-3.4.2.tar.gz from the site and i have compiled this but i didn't find any libraries regarding this. can u help me regarding libraries. regards On 8/31/07, nishit sharma <[EMAIL PROTECTED]> wrote: > > it is included. the program

Re: [sqlite] compiling

2007-08-31 Thread nishit sharma
it is included. the program which i m compiling is attached and thats the sample program available on sqlite3.org but again its giving me error. regards On 8/31/07, kirrthana M <[EMAIL PROTECTED]> wrote: > > I think you have not included header file "sqlite3.h" in your code,if u > have > not

RE: [sqlite] How to generate Unique ID?

2007-08-31 Thread Andre du Plessis
Hi how about the following: CREATE TABLE puids (ID INTEGER PRIMARY KEY AUTOINCREMENT) In python: Def GetUniquePUID(): #OPTIONAL, if you already have a transaction _Conn.cursor().execute("BEGIN EXCLUSIVE") Try: _Conn.cursor().execute("INSERT INTO PUIDS (id) values(null)");

Re: [sqlite] beginner

2007-08-31 Thread nishit sharma
hey buddy can u tell me how to compile the C source code in which i have used sqlite3_open() like calls. i m doing gcc test.c but it is giving me error of undefined reference. i think i am missing some thing in compiling. waiting for reply regards Nishit On 8/30/07, nishit sharma <[EMAIL

Re: [sqlite] Table locked - why?

2007-08-31 Thread Yves Goergen
On 31.08.2007 10:45 CE(S)T, Yves Goergen wrote: > Maybe I should retry it with a plain SQLite console and figure out > whether the bug is in the .NET wrapper (just as the previous one I've > found...). Stay tuned... When I do that from an SQLite console, it works as expected. So I'll head over to

RE: [sqlite] compiling

2007-08-31 Thread kirrthana M
I think you have not included header file "sqlite3.h" in your code,if u have not included include and compile again. -Original Message- From: nishit sharma [mailto:[EMAIL PROTECTED] Sent: Friday, August 31, 2007 12:45 PM To: sqlite-users@sqlite.org Subject: [sqlite] compiling hi all, i

Re: [sqlite] Table locked - why?

2007-08-31 Thread Yves Goergen
On 31.08.2007 06:03 CE(S)T, Dan Kennedy wrote: > On Fri, 2007-08-31 at 00:09 +0200, Yves Goergen wrote: >> CREATE TEMPORARY TABLE attached_db.temp_table > > I'm not sure where that table is created - in the temporary > namespace or as part of attached_db. Checking... > > SQLite version

Re: [sqlite] Table locked - why?

2007-08-31 Thread Yves Goergen
On 31.08.2007 00:50 CE(S)T, Virgilio Alexandre Fornazin wrote: > Did you closed the cursor opened at 'select *...' ? > Thats probably the reason you have getting a 'table is locked' error. I'm using the .NET wrapper to SQLite that should handle all API internals for me. Even disposing the

Re: [sqlite] Table locked - why?

2007-08-31 Thread Yves Goergen
On 31.08.2007 00:23 CE(S)T, RaghavendraK 70574 wrote: > Pls see if u hv an open sqlite3 terminal.sometimes this can also > cause a prob with begin tx and just kept it open. Really, I don't. Trust me. :) -- Yves Goergen "LonelyPixel" <[EMAIL PROTECTED]> Visit my web laboratory at

RE: [sqlite] How to generate Unique ID?

2007-08-31 Thread Gerhard Haering
On Fri, 31 Aug 2007 12:28:49 +0530, "B V, Phanisekhar" <[EMAIL PROTECTED]> wrote: > Hi Gerhard, > > I am finding your code really tough to understand. Can you > please provide some comments? try: from pysqlite2 import dbapi2 as sqlite except ImportError: import sqlite3

[sqlite] compiling

2007-08-31 Thread nishit sharma
hi all, i have made a sampe which is opening a database file but i m unable to compile that source code and getting error that undefined reference to sqlite3_open(). i m compiling as gcc test.c can anybody tell that these is the command to compile sqlite3 application or we have any other command

RE: [sqlite] How to generate Unique ID?

2007-08-31 Thread B V, Phanisekhar
Hi Gerhard, I am finding your code really tough to understand. Can you please provide some comments? Regards, Phani -Original Message- From: Gerhard Haering [mailto:[EMAIL PROTECTED] Sent: Friday, August 31, 2007 12:31 AM To: sqlite-users@sqlite.org Subject: Re: [sqlite] How to

RE: [sqlite] How to generate Unique ID?

2007-08-31 Thread B V, Phanisekhar
Assume I have a table Create table T1 (id INTEGER PRIMARY KEY not null, puid UNIQUE INTEGER not null, format INTEGER not null); Now some values given below Id puidformat 1 8000123 2 9000169 3 8001178 4 8002165 5 9001180 6