Re: [sqlite] disk image malformed

2012-12-06 Thread Durga D
Does disk io error is related to hardware issue? i mean, fsync() dint get success on unix. so, this error may be thrown by sqlite. Is it? On Fri, Dec 7, 2012 at 12:00 AM, Simon Slavin <slav...@bigfraud.org> wrote: > > On 6 Dec 2012, at 6:13pm, Durga D <durga.d...@gmail.com&

Re: [sqlite] disk image malformed

2012-12-06 Thread Durga D
fraud.org> wrote: > > On 6 Dec 2012, at 5:23pm, Durga D <durga.d...@gmail.com> wrote: > > > Is it (corruption) related error code 10? (disk io) > > > > I would like to know, why sqlite throws disk io error while inserting > > records... > >

Re: [sqlite] disk image malformed

2012-12-06 Thread Durga D
Is it (corruption) related error code 10? (disk io) I would like to know, why sqlite throws disk io error while inserting records... On Thu, Dec 6, 2012 at 10:43 PM, Simon Slavin <slav...@bigfraud.org> wrote: > > On 6 Dec 2012, at 5:04pm, Durga D <durga.d...@gmail.com> w

Re: [sqlite] disk image malformed

2012-12-06 Thread Durga D
i mean in second case. some records corrupted but not all. How to recover this? On Thu, Dec 6, 2012 at 10:27 PM, Durga D <durga.d...@gmail.com> wrote: > Is there anyway to recover? > > > On Thu, Dec 6, 2012 at 10:23 PM, Richard Hipp <d...@sqlite.org> wrote: > >>

Re: [sqlite] disk image malformed

2012-12-06 Thread Durga D
Is there anyway to recover? On Thu, Dec 6, 2012 at 10:23 PM, Richard Hipp <d...@sqlite.org> wrote: > On Thu, Dec 6, 2012 at 11:52 AM, Durga D <durga.d...@gmail.com> wrote: > > > Hi, > > > > Is it possible to corrupt a single table among 10 tables in

[sqlite] disk image malformed

2012-12-06 Thread Durga D
Hi, Is it possible to corrupt a single table among 10 tables in a database? Is it possible to corrupt some records among millions of records in a table? Best Regards, ___ sqlite-users mailing list sqlite-users@sqlite.org

Re: [sqlite] to find table exists or not

2012-12-06 Thread Durga D
> > > You can always do > > > > > > DROP TABLE IF EXISTS ... > > > CREATE TABLE ... > > > > > > to replace the definition or > > > > > > CREATE TABLE IF NOT EXISTS ... > > > > > > to keep the old def

[sqlite] to find table exists or not

2012-12-05 Thread Durga D
Hi all, I just want to find whether table exists or not in a database. Is it correct query? select distinct tbl_name from sqlite_master where tbl_name = 'abc'; Is there any other better way to find whether table exists or not. Thanks in advance. Regards,

Re: [sqlite] sqlite3 db open/close

2012-11-19 Thread Durga D
Thank you. On Sun, Nov 18, 2012 at 8:18 PM, Yuriy Kaminskiy <yum...@gmail.com> wrote: > Durga D wrote: > >What happens if sqlite3_close() called multiple times but > > sqlite3_open_v2() called only once. > > > > Practically I dint see any malfunct

[sqlite] sqlite3 db open/close

2012-11-18 Thread Durga D
Hi All, What happens if sqlite3_close() called multiple times but sqlite3_open_v2() called only once. Practically I dint see any malfunction/corruption here. I would like to know the behavior of sqlite in this scenario. Best Regards, ___

Re: [sqlite] added new db with other journal mode. Any issue?

2012-11-14 Thread Durga D
this the sequence of sqlite statements: -- sqlite3_open sqlite3_key sqlite3_prepare_v2 sqlite3_step sqlite3_finalize sqlite3_prepare_v2 --- //my application crashed here On Wed, Nov 14, 2012 at 5:14 PM, Durga D <durga.d...@gmail.com>

Re: [sqlite] added new db with other journal mode. Any issue?

2012-11-14 Thread Durga D
sqlite_source_id(): 2012-03-20 11:35:50 00bb9c9ce4f465e6ac321ced2a9d0062dc364669 I will send the sequence of sql stmts. On Wed, Nov 14, 2012 at 4:51 PM, Richard Hipp <d...@sqlite.org> wrote: > On Wed, Nov 14, 2012 at 3:41 AM, Durga D <durga.d...@gmail.com> wrote: > > &g

Re: [sqlite] added new db with other journal mode. Any issue?

2012-11-14 Thread Durga D
lav...@bigfraud.org> wrote: > > On 14 Nov 2012, at 7:35am, Durga D <durga.d...@gmail.com> wrote: > > > I have 8 sqlite databases with TRUNCATE journal mode. I have added new > > database with WAL journal mode. Now, 9 databases in my application. Will > it > > give any data

[sqlite] added new db with other journal mode. Any issue?

2012-11-13 Thread Durga D
Hi All, I have 8 sqlite databases with TRUNCATE journal mode. I have added new database with WAL journal mode. Now, 9 databases in my application. Will it give any database corruption? Regards, ___ sqlite-users mailing list sqlite-users@sqlite.org

Re: [sqlite] indexing for integer column

2012-09-10 Thread Durga D
Hi, Can I create INDEX for the particular column when database journal mode is WAL? Any impact If I INDEXed database with some triggers? Thanks in advance. Best Regards, On Thu, Sep 6, 2012 at 4:04 PM, Durga D <durga.d...@gmail.com> wrote: > Thank you Kees. > > > O

Re: [sqlite] indexing for integer column

2012-09-06 Thread Durga D
Thank you Kees. On Thu, Sep 6, 2012 at 3:34 PM, Kees Nuyt <k.n...@zonnet.nl> wrote: > On Thu, 6 Sep 2012 12:02:03 +0400, Durga D <durga.d...@gmail.com> wrote: > > >Hi All, > > > >Somehow "original author" missed one INTETER column as se

[sqlite] indexing for integer column

2012-09-06 Thread Durga D
Hi All, Somehow "original author" missed one INTETER column as searchable field ( like unique or primary key) in the table. When execute queries based on this integer field in where clause/joins, huge performance hit. So, I am planning to add INDEXING for this integer column. Is there

[sqlite] open database on Linux. Already db created on Mac.

2012-07-29 Thread Durga D
Hi All, What is the procedure to open the sqlite3 database file in Linux Terminal which is already created on Mac. Thanks in advance. Regards, ___ sqlite-users mailing list sqlite-users@sqlite.org

Re: [sqlite] single gdbconn object with multiple threads.

2012-07-23 Thread Durga D
ltiple clients are called. Am I right? Regards, On Mon, Jul 23, 2012 at 8:19 PM, Igor Tandetnik <itandet...@mvps.org> wrote: > On 7/23/2012 10:30 AM, Durga D wrote: > >> Unless your threads do something else in parallel, you could just as well >>>> >>> do all SQ

Re: [sqlite] single gdbconn object with multiple threads.

2012-07-23 Thread Durga D
PM, Igor Tandetnik <itandet...@mvps.org> wrote: > Durga D <durga.d...@gmail.com> wrote: > > I have used same gdbconn for all the threads. In my sample application, > > it working perfectly in wal mode. > > > > Is it correct approach? > > Approach t

[sqlite] single gdbconn object with multiple threads.

2012-07-22 Thread Durga D
Hi all, I developed sample application with below logic: 1. in main(), got the valide gdbconn (type sqlite3*) after sqlite3_open and sqlite3_prepare_v2. 2. wal mode. 3. created 4 threads and passed gdbconn as a argument to threads. 4. Three are reader_threads. each reader

Re: [sqlite] set of db connections

2012-07-17 Thread Durga D
Hi Simon, what you suggest now? sigle object based or set of connections? Thanks, On Mon, Jul 16, 2012 at 6:11 PM, Simon Slavin <slav...@bigfraud.org> wrote: > > On 16 Jul 2012, at 2:59pm, "Igor Tandetnik" <itandet...@mvps.org> wrote: > > > Durga D <d

Re: [sqlite] set of db connections

2012-07-16 Thread Durga D
Hi Michael/Igor, So, I can establish x connections in app initialize time in WAL mode. Based on request (read or write), I can pick the connection and serve. Allows only one write at a time. Is it correct? Thanks in advance. Regards, On Mon, Jul 16, 2012 at 4:43 PM, Igor Tandetnik

Re: [sqlite] set of db connections

2012-07-16 Thread Durga D
Got it. Thank you so much. On Mon, Jul 16, 2012 at 3:24 PM, Simon Slavin <slav...@bigfraud.org> wrote: > > On 16 Jul 2012, at 12:09pm, Durga D <durga.d...@gmail.com> wrote: > > >scenario: while write request is in progress with 100K records > > insertion,

Re: [sqlite] set of db connections

2012-07-16 Thread Durga D
. Regards, On Mon, Jul 16, 2012 at 2:29 PM, Simon Slavin <slav...@bigfraud.org> wrote: > > On 16 Jul 2012, at 7:50am, Durga D <durga.d...@gmail.com> wrote: > > >I am developing readers (> 1) and writer(1) application for sqlite3 > db. > > > >

[sqlite] set of db connections

2012-07-16 Thread Durga D
Hi all, I am developing readers (> 1) and writer(1) application for sqlite3 db. I would like to maintain set of connections in application initialization time. whenever read request comes, serve the request from existing connection object like pool. Here, my doubt is: if app. runs

Re: [sqlite] fetching rows

2012-06-23 Thread Durga D
Thank you(Pavel) for the prompt response. Sqlite does auto commit for every 25k insertions. Do I need to change the number from 25k to x ( for ex: 100)? On Thu, Jun 21, 2012 at 7:54 AM, Pavel Ivanov <paiva...@gmail.com> wrote: > On Wed, Jun 20, 2012 at 11:33 PM, Durga D <durga.d.

[sqlite] fetching rows

2012-06-20 Thread Durga D
Hi All, I have to develop a sqlite application. Within the process, multiple threads are trying to access in write/read mode. Will sqlite supports read and write at a time? scenario: 1. x number of records (x related data) are going to insert in a transaction in ThreadA. still, not

[sqlite] encrypt/decrypt sqlite3 database file or content

2012-06-05 Thread Durga D
Hi All, I am developing sqlite3 based application. I want to create/maintain sqlite3 database in encrypted. Others should not have rights to open this database without key. Is there any sqlite3 api's to do this? Thanks in advance. Regards,

Re: [sqlite] simple like query optimization

2012-01-12 Thread Durga D
Here, a,b,d,e,f,u and v are variable length strings. delimiter '/ ' is constant. On Fri, Jan 13, 2012 at 12:22 PM, Durga D <durga.d...@gmail.com> wrote: > Hi All, > > I have a table like this: > > h t0info( h is primary key, t0info is unique) > ---

[sqlite] simple like query optimization

2012-01-12 Thread Durga D
Hi All, I have a table like this: h t0info( h is primary key, t0info is unique) --- 1/a/d/u 2/a/e/u 3/a/f/u 4/a/g/v 5/a/b/c/d/e/f input is : /a output should be: d, e f, g and b I am doing this way: select t0info from t0 where t0info like '/a%';

Re: [sqlite] primary key autoincrement updation problemincaserefereced

2012-01-12 Thread Durga D
Fixed it. It allows duplicates when stmt reset(sqlite3_reset) missed after sqlite3_step(..) in transaction. Thank you. On Thu, Jan 12, 2012 at 4:27 PM, Simon Slavin <slav...@bigfraud.org> wrote: > > On 12 Jan 2012, at 10:52am, Durga D wrote: > > > I have attach

Re: [sqlite] primary key autoincrement updation problemincaserefereced

2012-01-12 Thread Durga D
, Simon Slavin <slav...@bigfraud.org> wrote: > > On 12 Jan 2012, at 6:05am, Durga D wrote: > > >Insertion time, I am able to get the rowid from > > sqlite3_last_insert_rowid(); > > > > It's working fine. > > > > Now, t0info rec

Re: [sqlite] primary key autoincrement updation problemincaserefereced

2012-01-11 Thread Durga D
Corrected it. Thank you. insert into t1( hh, t1info) values ((select h from t0 where t0info = ?), ?) On Thu, Jan 12, 2012 at 11:35 AM, Durga D <durga.d...@gmail.com> wrote: > Dear Igor, > > Insertion time, I am able to get the rowid from > sqlite3_last_insert_rowid(

Re: [sqlite] primary key autoincrement updation problemincaserefereced

2012-01-11 Thread Durga D
0; Thanks in advance, Durga. On Thu, Jan 12, 2012 at 11:03 AM, Igor Tandetnik <itandet...@mvps.org>wrote: > Durga D <durga.d...@gmail.com> wrote: > > Dear Igor, > > > >If already toinfo record exists, that time how to get the h > > (primary key) (ins

Re: [sqlite] primary key autoincrement updation problem incaserefereced

2012-01-11 Thread Durga D
Dear Igor, If already toinfo record exists, that time how to get the h (primary key) (instead of rowid)? Any shortcut for this? Thanks in advance, Durga. On Wed, Jan 11, 2012 at 7:19 PM, Durga D <durga.d...@gmail.com> wrote: > Thanks alot !!! > > Have a good

Re: [sqlite] primary key autoincrement updation problem incaserefereced

2012-01-11 Thread Durga D
Thanks alot !!! Have a good day. Let me try. On Wed, Jan 11, 2012 at 7:15 PM, Igor Tandetnik <itandet...@mvps.org> wrote: > Durga D <durga.d...@gmail.com> wrote: > > so, first I need to insert in t0 table, then query for value from t0, > then > > update t1 wi

Re: [sqlite] primary key autoincrement updation problem in caserefereced

2012-01-11 Thread Durga D
ding from t0 table. Is there any alternative way to insert? Thanks in advance. On Wed, Jan 11, 2012 at 6:41 PM, Igor Tandetnik <itandet...@mvps.org> wrote: > Durga D <durga.d...@gmail.com> wrote: > > create table if not exists t0 ( h integer primary key autoincrement, > t0info &g

Re: [sqlite] primary key autoincrement updation problem in case refereced

2012-01-11 Thread Durga D
Simon/Jr Please find the attached main.c files. Thanks, Durga On Wed, Jan 11, 2012 at 12:58 PM, Simon Slavin <slav...@bigfraud.org> wrote: > > On 11 Jan 2012, at 6:05am, Durga D wrote: > > > But, sqlite3_step(stmtoft1); is failing always. What might be the wrong &

Re: [sqlite] primary key autoincrement updation problem in case refereced

2012-01-10 Thread Durga D
ter...@gmail.com> wrote: > On 11/01/12 06:29, Durga D wrote: > >> Deleted sqlite data base before executing first approach. >> Again deleted sqlite database before executing second approach. >> > > ok, misread this and thought 'first approach' relevant. > > > >&g

Re: [sqlite] primary key autoincrement updation problem in case refereced

2012-01-10 Thread Durga D
com> wrote: > On 11/01/12 06:05, Durga D wrote: > > if I understand correctly: first you created tables t1 and t2, then you > say 'create if not exist' -- but they already do. instead of (re-)creating > tables t1 and t2, ALTER TABLE statements can be used to modify

[sqlite] primary key autoincrement updation problem in case refereced

2012-01-10 Thread Durga D
First approach: I have created database with below schema: create table if not exists t1 ( i integer primary key autoincrement, t1info text); create table if not exists t2 (ii integer primary key, t2info text, foreign key (ii) references t1 (i) ); I created two prepared statement for t1 and t2.

Re: [sqlite] insert if record not exists without primary key

2012-01-10 Thread Durga D
? On Tue, Jan 10, 2012 at 2:36 PM, Simon Slavin <slav...@bigfraud.org> wrote: > > On 10 Jan 2012, at 8:37am, Durga D wrote: > > > I noticed, with first approach, huge performance hit when database grows. > > for ex: database has 500,000 records. now insert 25,000 within a &g

Re: [sqlite] insert if record not exists without primary key

2012-01-10 Thread Durga D
wrote: > > On 10 Jan 2012, at 7:23am, Durga D wrote: > > > create table if not exists emp(id integer primary key autoincrement, > > col1 text, col2 text, unique (col1, col2)); > > > > here, col1 and col2 should be unique. I tried to insert 1000 records

[sqlite] insert if record not exists without primary key

2012-01-09 Thread Durga D
Hi all, I have emp sqlite table: create table if not exists emp(id integer primary key autoincrement, col1 text, col2 text, unique (col1, col2)); here, col1 and col2 should be unique. I tried to insert 1000 records with unique(col1, col2). It's very slow. So, I choosed id as primary

Re: [sqlite] Is it bug? or need to enable any pragma for not null and unique while creating table

2012-01-02 Thread Durga D
Petite, Thank you for your material. I will go through it. Thanks, Durga. On Tue, Jan 3, 2012 at 1:02 AM, Petite Abeille wrote: > > On Jan 2, 2012, at 5:25 PM, Jay A. Kreibich wrote: > > > Oracle has some syntax short-cuts to deal with this, but they're >

Re: [sqlite] Is it bug? or need to enable any pragma for not null and unique while creating table

2012-01-02 Thread Durga D
, 2012 at 12:31 PM, Simon Slavin <slav...@bigfraud.org> wrote: > > On 2 Jan 2012, at 5:25am, Durga D wrote: > > > "create table if not exists durtree (id integer primary key > autoincrement, > > c1 varchar[260], c2 varchar[260], c3 varchar[260], c4 varchar[260],

Re: [sqlite] Is it bug? or need to enable any pragma for not null and unique while creating table

2012-01-02 Thread Durga D
, Jan 2, 2012 at 9:55 PM, Jay A. Kreibich <j...@kreibi.ch> wrote: > On Mon, Jan 02, 2012 at 07:01:29AM +, Simon Slavin scratched on the > wall: > > > > On 2 Jan 2012, at 5:25am, Durga D wrote: > > > > > "create table if not exists durtree (id intege

Re: [sqlite] search

2012-01-01 Thread Durga D
you have > > You also can use selection too (where condition). > http://en.wikibooks.org/wiki/XQuery/XPath_examples > http://sedna.org > > SQLite with fts is my favorite, but for tree like data structure I > will use xml database. > > -aris > > On 12/28/1

Re: [sqlite] Is it bug? or need to enable any pragma for not null and unique while creating table

2012-01-01 Thread Durga D
Fri, Dec 30, 2011 at 04:10:55PM +0530, Durga D scratched on the wall: > >> Hi all, > >> > >>I have sqlite table with 71 columns. not null for 70 and one is > >> surrogate key(primary key). Sqlite3 3.7.9 doesn't support not null for > 70 > >&

[sqlite] Is it bug? or need to enable any pragma for not null and unique while creating table

2011-12-30 Thread Durga D
Hi all, I have sqlite table with 71 columns. not null for 70 and one is surrogate key(primary key). Sqlite3 3.7.9 doesn't support not null for 70 columns and unique(70 columns). It's worked fine upto 30 columns not null and unique(70 columns). I need 70 columns with unique and not null.

Re: [sqlite] search

2011-12-27 Thread Durga D
gt; > Advanced Analytics Directorate > > Advanced GEOINT Solutions Operating Unit > > Northrop Grumman Information Systems > > ____ > From: sqlite-users-boun...@sqlite.org [sqlite-users-boun...@sqlite.org] > on behalf of Durga D [durga.d...@gmai

Re: [sqlite] search

2011-12-27 Thread Durga D
Mohit, sqlite> .separator / sqlite> create virtual table virfts4 using fts4 (residence); sqlite> insert into virfts4 select * from source sqlite> select count(*) from virfts4 where residence match '/*'; -- result is 0. Please correct it. I think, i am doing

Re: [sqlite] search

2011-12-27 Thread Durga D
, 2011 at 3:38 PM, Kit <kit.sa...@gmail.com> wrote: > 2011/12/27 Durga D <durga.d...@gmail.com>: > > select * from virfts4 where residence match '/*'; -- dint work > > how to get counties names from this db by using query? > > Normalize database to 1NF, e.g. > CRE

Re: [sqlite] search

2011-12-27 Thread Durga D
, 2011 at 2:01 PM, Kit <kit.sa...@gmail.com> wrote: > 2011/12/27 Durga D <durga.d...@gmail.com>: > > HI all, > > I have sqlite database with more than 1000 records. Here, > > residencearea is the primary key. > > /country/state/city/village > >

[sqlite] search

2011-12-26 Thread Durga D
HI all, I have sqlite database with more than 1000 records. Here, residencearea is the primary key. for ex: /country/state/city/village /country/city /country/state/city /country/ country: USA, UK, CHINA Here I want to search based on country and

Re: [sqlite] String field as primarykey

2010-10-12 Thread Durga D
journal file is creating between transactions. On Tue, Oct 12, 2010 at 3:00 PM, Oliver Peters <oliver@web.de> wrote: > Durga D <durga.d...@...> writes: > > [...] > > > But performance issue is there. > > > > Is there anyway to optimize this?

Re: [sqlite] String field as primarykey

2010-10-12 Thread Durga D
ue, Oct 12, 2010 at 3:00 PM, Oliver Peters <oliver@web.de> wrote: > Durga D <durga.d...@...> writes: > > [...] > > > But performance issue is there. > > > > Is there anyway to optimize this? > > > > &g

[sqlite] String field as primarykey

2010-10-12 Thread Durga D
Hi All, I have created a sqlite database with "create table EMP (F1 INTEGER ,F2 TEXT(1120) primary key collate nocase,F3 INTEGER ,LMD TEXT(1120) ,F4 TEXT(1120) ,F5 TEXT(1120));". Here F2(Field2) is primary key. I used transaction queries for every 25,000 records. But performance issue is

Re: [sqlite] "Unable to Open DB" on Win-7 & Vista (64 bitt) on UAC -ON

2010-07-21 Thread Durga D
Try to launch your appliztion with "Run As Administrator"(right click on exe -> Run As..). Note: Take care about fields information for old DB and new DB while opening tables(backward compatibility). For ex: old DB might have x number of fields and new DB might have y number fields where x is not

[sqlite] Bulk Insertions allowing duplicate records even primary key existed

2009-12-28 Thread Durga D
Hi All, I am developing an application with Sqlite3 Database in VC++ 6.0. Here, I tried for bulk insertions with CppSQLite3Statement. But, It's allowing duplicate records in my database even primary key existed. First, I inserted 5 records with insert query and transactions for every