[sqlite] Using binding in sqlite insert statements

2014-12-09 Thread Prakash Premkumar
Hi, I'm trying to use the sqlite_bind function calls to pass values to the insert queries in sql. Here's the code I'm trying to execute: http://pastebin.com/kMvAHsrk I get an error after the sqlite3_step() function call : The error message is Unknown error. Can you kindly help me fix this ?

Re: [sqlite] Using binding in sqlite insert statements

2014-12-09 Thread Prakash Premkumar
Thanks a lot for your reply Simon. It was returning SQLITE_DONE. (But I have checked for SQLITE_OK in my code). It's fixed now Thank you Prakash On Tue, Dec 9, 2014 at 5:02 PM, Simon Davies simon.james.dav...@gmail.com wrote: On 9 December 2014 at 10:56, Prakash Premkumar prakash.p

[sqlite] SQLite where clause tree

2014-11-10 Thread Prakash Premkumar
The where clause in sqlite is encoded as a tree Let's say I have select statement like : SELECT * from employee where salary = 3+5*4+3; The tree which takes care of operator precedence is : = /\ salary+

Re: [sqlite] Inmemory database in sqlite

2014-10-17 Thread Prakash Premkumar
, although many efforts have been made to develop non-volatile RAM chips. Source: Wikipedia Il 17/ott/2014 11:48 Prakash Premkumar prakash.p...@gmail.com ha scritto: Hi, Does in memory database in sqlite have journal files associated with it ? If there's a system failure before

Re: [sqlite] Inmemory database in sqlite

2014-10-17 Thread Prakash Premkumar
/overview.htm#TTCIN129 Does sqlite's in memory db have this feature ? Thanks Prakash On Fri, Oct 17, 2014 at 11:54 AM, Prakash Premkumar prakash.p...@gmail.com wrote: Is features like WAL (https://www.sqlite.org/wal.html) not available for in memory databases ? Thanks Prakash On Fri, Oct 17

Re: [sqlite] Inmemory database in sqlite

2014-10-17 Thread Prakash Premkumar
go corrupt. So you can go all the ways from no acid (data and journal in ram), to aci database (syncronous=normal) to fully acid. If you increase cache size enough you'll have the same as a in memory database Il 17/ott/2014 14:15 Prakash Premkumar prakash.p...@gmail.com ha scritto: Hi, Let's

Re: [sqlite] sqlite Query Optimizer

2014-10-16 Thread Prakash Premkumar
Thanks a lot for your time. Regards Prakash On Wed, Oct 15, 2014 at 5:36 PM, Simon Slavin slav...@bigfraud.org wrote: On 15 Oct 2014, at 12:54pm, Prakash Premkumar prakash.p...@gmail.com wrote: I'm trying to understand the sqlite select query optimizer. It works by assigning costs

Re: [sqlite] sqlite Query Optimizer

2014-10-16 Thread Prakash Premkumar
...@bigfraud.org wrote: On 16 Oct 2014, at 7:50am, Prakash Premkumar prakash.p...@gmail.com wrote: Does sqlite implement the pointers in the System R Algorithm ? SQLite does not implement the System R Algorithm, so no, it doesn't implement the pointers from System R. It implements the algorithms

[sqlite] Granularity of Locks in sqlite

2014-10-16 Thread Prakash Premkumar
Hi, From what I understand from reading the followig doc: http://www.sqlite.org/lockingv3.html sqlite supports only file level locking.Is there any attempts to improve the granularity of locking to table level or row level ? Thanks a lot. Prakash ___

[sqlite] Inmemory database in sqlite

2014-10-16 Thread Prakash Premkumar
Hi, Does in memory database in sqlite have journal files associated with it ? If there's a system failure before an in memory database is backed up ? Will there be data loss ? Or Can you kindly tell me how sqlite handles this ? Thanks Prakash ___

Re: [sqlite] Inmemory database in sqlite

2014-10-16 Thread Prakash Premkumar
Prakash On Fri, Oct 17, 2014 at 10:27 AM, Igor Tandetnik i...@tandetnik.org wrote: On 10/17/2014 12:48 AM, Prakash Premkumar wrote: Does in memory database in sqlite have journal files associated with it ? No. The journal is in memory, too. If there's a system failure before an in memory

[sqlite] sqlite Query Optimizer

2014-10-15 Thread Prakash Premkumar
Hi, I'm trying to understand the sqlite select query optimizer. It works by assigning costs to each relation in FROM clause. As far as I understand, it primarily uses the logarithmic estimate of the number of rows in the relation. Query optimization algorithms like IBM System R algorithm assigns

[sqlite] struct SrcList

2014-10-06 Thread Prakash Premkumar
Hi, struct SrcList has a field int iCursor, if I'm manually filling up this struct ,can I assign any integral value to iCursor,so that this value can be used by OpenRead or OpenReadWrite opcode when it accesses this particular table ? Thanks Prakash

Re: [sqlite] struct SrcList

2014-10-06 Thread Prakash Premkumar
it is an index into a table of cursors required for processing the statement and there will be assertions to satisfy. -Ursprüngliche Nachricht- Von: Prakash Premkumar [mailto:prakash.p...@gmail.com] Gesendet: Montag, 06. Oktober 2014 11:59 An: General Discussion of SQLite Database Betreff: [sqlite

[sqlite] Performance gain in SQLite

2014-10-06 Thread Prakash Premkumar
Will I get any performance benefits if I directly generate the Vdbe program instead of generating the sql string ? My application emits out sql strings for execution. Instead if I generate the Vdbe program myself , will I get performance benefits since, I am bypassing the parser. Thanks Prakash

Re: [sqlite] Vdbe Program Generation

2014-10-05 Thread Prakash Premkumar
Thanks a lot for your reply Kees, sqlite3_prepare calls other functions, can you kindly tell me which is the exact function that does the conversion ? Thanks Prakash On Fri, Oct 3, 2014 at 7:37 PM, Kees Nuyt k.n...@zonnet.nl wrote: On Fri, 3 Oct 2014 18:39:29 +0530, Prakash Premkumar

Re: [sqlite] Vdbe Program Generation

2014-10-05 Thread Prakash Premkumar
Thanks a lot Clemens Regards Prakash On Sun, Oct 5, 2014 at 2:56 PM, Clemens Ladisch clem...@ladisch.de wrote: Prakash Premkumar wrote: On Fri, Oct 3, 2014 at 7:37 PM, Kees Nuyt k.n...@zonnet.nl wrote: On Fri, 3 Oct 2014 18:39:29 +0530, Prakash Premkumar prakash.p...@gmail.com wrote

[sqlite] Vdbe Program Generation

2014-10-03 Thread Prakash Premkumar
Can you please tell me which function is sqlite actually generates the Vdbe program for a give sql string ? Thanks Prakash ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Results of Joins in sqlite

2014-09-24 Thread Prakash Premkumar
which table. Thanks Prakash On Wed, Sep 24, 2014 at 11:03 AM, Prakash Premkumar prakash.p...@gmail.com wrote: Hi, Let's say I have tables T1,T2 and T3 with 2 columns each and I am joining them. The result rows will have 8 columns each. Let's say an output of the join is: r11,r21,r31 r11

Re: [sqlite] Results of Joins in sqlite

2014-09-24 Thread Prakash Premkumar
rows(one pointer per row). The end data structure will look like a graph. I want the API to return this graph./ is there an alternative ? API call : graph* sqlite3_join(select_stmt*) Thanks Prakash On Wed, Sep 24, 2014 at 12:45 PM, Clemens Ladisch clem...@ladisch.de wrote: Prakash Premkumar

Re: [sqlite] Results of Joins in sqlite

2014-09-24 Thread Prakash Premkumar
your structure by binding the rowid received and executing the appropriate SELECT ...t1 fields FROM t1 where t1.rowid=?; SELECT ...t2 fields FROM t2 where t2.rowid=?; SELECT ...t3 fields FROM t3 where t3.rowid=?; -Ursprüngliche Nachricht- Von: Prakash Premkumar [mailto:prakash.p

Re: [sqlite] Results of Joins in sqlite

2014-09-24 Thread Prakash Premkumar
and works first? -Ursprüngliche Nachricht- Von: Prakash Premkumar [mailto:prakash.p...@gmail.com] Gesendet: Mittwoch, 24. September 2014 12:54 An: General Discussion of SQLite Database Betreff: Re: [sqlite] Results of Joins in sqlite Thanks a lot Hick,for your approach

Re: [sqlite] Expose struct Mem and struct Vdbe to other application

2014-09-23 Thread Prakash Premkumar
that you really need to change the approach or acquire a different tool. Maybe you are trying to nail it with a set of pliers. Doable, but not as neat as using a hammer in the first place, and also hard on the pliers. -Ursprüngliche Nachricht- Von: Prakash Premkumar [mailto:prakash.p

[sqlite] Results of Joins in sqlite

2014-09-23 Thread Prakash Premkumar
Hi, Let's say I have tables T1,T2 and T3 with 2 columns each and I am joining them. The result rows will have 8 columns each. Let's say an output of the join is: r11,r21,r31 r11,r21,r32 r11,r21,r33 where r1i is the i th row in T1, r2i is the i th row in T2 and r3i is the ith row in T3: sqlite

Re: [sqlite] Definition of struct sqlite3_stmt

2014-09-22 Thread Prakash Premkumar
Thanks Clemens and hick On 22 Sep 2014 14:22, Clemens Ladisch clem...@ladisch.de wrote: Prakash Premkumar wrote: Can you please tell me where is the definition of the struct sqlite3_stmt ? There is no definition of struct sqlite3_stmt. Search for this instead: /* ** An instance

[sqlite] Expose struct Mem and struct Vdbe to other application

2014-09-22 Thread Prakash Premkumar
Hi, Let's assume I am writing a c code which directly invokes the sqlite_step statement. After the execution of the statement, I would like to access the pResultRow of Vdbe (which obtained by pVbe = (Vdbe*) pStmt ). How can I expose the struct Vdbe,Mem and the likes to external applications.

Re: [sqlite] Expose struct Mem and struct Vdbe to other application

2014-09-22 Thread Prakash Premkumar
Nachricht- Von: Prakash Premkumar [mailto:prakash.p...@gmail.com] Gesendet: Montag, 22. September 2014 15:37 An: General Discussion of SQLite Database Betreff: [sqlite] Expose struct Mem and struct Vdbe to other application Hi, Let's assume I am writing a c code which directly invokes

[sqlite] Definition of struct sqlite3_stmt

2014-09-21 Thread Prakash Premkumar
Hi, Can you please tell me where is the definition of the struct sqlite3_stmt ? A search in sqlite3.c yields on the typedef statement of the struct , typedef struct sqlite3_stmt sqlite3_stmt; Thanks for your help. ___ sqlite-users mailing list

[sqlite] Number of registers/Mem in sqlite Vdbe

2014-09-19 Thread Prakash Premkumar
Can you kindly tell me where in the source code is the number of registers for Vdbe allocated ? Thanks Prakash ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

[sqlite] Generating VDBE program

2014-09-18 Thread Prakash Premkumar
? Can you point me to the portion of the source code which makes this decision? Can you kindly explain me the concept? Thanks for you help. Regards, Prakash Premkumar ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin

Re: [sqlite] Generating VDBE program

2014-09-18 Thread Prakash Premkumar
Thanks for your reply. I would like to know how the register allocation decision is made and the part of the code which does it . can you please help me find that? Thanks On 18 Sep 2014 20:20, Richard Hipp d...@sqlite.org wrote: On Thu, Sep 18, 2014 at 10:10 AM, Prakash Premkumar prakash.p

Re: [sqlite] Generating VDBE program

2014-09-18 Thread Prakash Premkumar
machine remember this allocation ? Thanks for your help On Fri, Sep 19, 2014 at 9:46 AM, Richard Hipp d...@sqlite.org wrote: On Fri, Sep 19, 2014 at 12:10 AM, Prakash Premkumar prakash.p...@gmail.com wrote: Thanks for your reply. I would like to know how the register allocation decision

Re: [sqlite] Generating VDBE program

2014-09-18 Thread Prakash Premkumar
The opcode I'm interested in is 10 column 2 1 3 00 On 19 Sep 2014 10:11, Richard Hipp d...@sqlite.org wrote: On Fri, Sep 19, 2014 at 12:35 AM, Prakash Premkumar prakash.p...@gmail.com wrote: Let's take this example explain select * from employee,company,location where location.name

Re: [sqlite] Generating VDBE program

2014-09-18 Thread Prakash Premkumar
The schema is as follows : create table employee (name text,age int); create table location (name text,addr text); create table company (name text,cname text); Thanks On Fri, Sep 19, 2014 at 10:13 AM, Richard Hipp d...@sqlite.org wrote: On Fri, Sep 19, 2014 at 12:35 AM, Prakash Premkumar

Re: [sqlite] Generating VDBE program

2014-09-18 Thread Prakash Premkumar
Thanks a lot Richard for your help. I apologize for not including the script. I will make it a point to add the scripts from hereon. On Fri, Sep 19, 2014 at 10:30 AM, Richard Hipp d...@sqlite.org wrote: You start by presenting us with a stand-alone script that we can run to see your question.

[sqlite] Set compile time option

2014-09-15 Thread Prakash Premkumar
Hi, How do I set the sqlite compile time option SQLITE_DEBUG ? Can you please specify how I should set it in the command line ? Thanks Prakash ___ sqlite-users mailing list sqlite-users@sqlite.org

[sqlite] SQL Query to Vdbe Instructions

2014-09-15 Thread Prakash Premkumar
Hi, Can you please tell me which function/set of functions convert the SQL query to Vdbe program ? Thanks Prakash ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users