Re: Re[2]: [sqlite] Re: Re: Handling null characters in blob data

2006-11-14 Thread Gussimulator
What kind of compression algorithm leaves out null characters? every char will be taking a byte, its just stupid. - Original Message - From: "Shivshankar Subramani - TLS , Chennai" <[EMAIL PROTECTED]> To: Sent: Wednesday, November 15, 2006 2:02 AM Subject:

RE: Re[2]: [sqlite] Re: Re: Handling null characters in blob data

2006-11-14 Thread Shivshankar Subramani - TLS , Chennai
Hi Teg, Can u please send me the sample code Thanks in advance With Regards, SHIVSHANKER S. HCL Technologies Limited, Chennai-600058 Tel: +91-44-43935000 Extn-5029 Mobile-9884656906 Email: [EMAIL PROTECTED] -Original Message- From: Teg [mailto:[EMAIL PROTECTED] Sent:

Re: [sqlite] Query planner confusion

2006-11-14 Thread drh
Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: > I've hit a case where SQLite is selecting a suboptimal index for my query and > I want to do something to tell it to use a different index. I'm familiar > with the "+" trick to confuse the optimizer but I can't see how it would > apply to this

[sqlite] Query planner confusion

2006-11-14 Thread Jean-Paul Calderone
I've hit a case where SQLite is selecting a suboptimal index for my query and I want to do something to tell it to use a different index. I'm familiar with the "+" trick to confuse the optimizer but I can't see how it would apply to this case. The basic problem is that the index I do not want

[sqlite] REGEXP implementation with pcre

2006-11-14 Thread Alexey Tourbin
Hello, I've just written sqlite3 loadable module which implements REGEXP operator with Perl-Compatible Regular Expressions library. It has LRU cache for compiled regular expressions, so it is probably fast. $ cflags=`pkg-config --cflags sqlite3 libpcre` $ libs=`pkg-config --libs sqlite3

[sqlite] fts2 selecting terms

2006-11-14 Thread Vikram Bhandoh
Hi, firstly I want to say thanks for this terrific extension and product. I'm amazed at what it can do and how quick it is. I'm using fts2 to index some documents. And I want to get a list of all the distinct terms that are in those documents. Is there a seperate table which holds the terms or

[sqlite] Importing text file via .bat file

2006-11-14 Thread RB Smissaert
Have figure out now what the quickest way is to move data from Interbase to a SQLite db file: IB to ADO recordset Recordset to text Import the text file with the .import command. Now I am trying to figure out how to automate the last step with a .bat file. What I got sofar is: Have a SQL file

Re[2]: [sqlite] Re: Re: Handling null characters in blob data

2006-11-14 Thread Teg
Hello Chennai, Tuesday, November 14, 2006, 9:20:10 AM, you wrote: SSTC> Hi, SSTC> Actually im trying to store a compressed value,which has lots of null SSTC> characters.When I try to store it into the database as a blob item ,only the SSTC> characters before null gets stored rest does not.I

[sqlite] Re: converting from mysql?

2006-11-14 Thread A. Pagaltzis
* Gussimulator <[EMAIL PROTECTED]> [2006-11-12 18:00]: > what are the available tools to convert a mysql db onto this > engine ( sqlite3 ) ? thanks - i can take scripts (php, phyton, > perhaps ruby although i dont have it installed now) but any > tool for windows would suffice too! SQL databases

Re: [sqlite] converting from mysql?

2006-11-14 Thread Gussimulator
anyone? - Original Message - From: "Gussimulator" <[EMAIL PROTECTED]> To: Sent: Sunday, November 12, 2006 1:54 PM Subject: [sqlite] converting from mysql? what are the available tools to convert a mysql db onto this engine ( sqlite3 ) ? thanks - i can

Re: [sqlite] Database Locked

2006-11-14 Thread John Stanton
You have to find what is locking the database and unlock it. Lloyd wrote: I have tracked down the problem and found th following. I have a select statement which stores the result set in a pointer variable. If the result set of select statement is empty, the program executes, otherwise it

Re: [sqlite] Re: Re: Handling null characters in blob data

2006-11-14 Thread John Stanton
You are making an error in the way you handle the compressed data in your program and pass it to the Sqlite API. Read up on the Sqlite API and it will be clear. Basically if you are handling a buffer of binary data you identify it by a descriptor of some sort, a pointer and a length. If you

Re: [sqlite] SQL tree and deepness level

2006-11-14 Thread Dennis Cote
Robert Zajda wrote: I have a table CREATE TABLE acategories { id integer not null primary key category string parent_category integer references acategories.id ) query: SELECT a.id AS 'id', a.category AS 'Category', b.category AS 'Parent category' FROM acategories AS a LEFT

Re: [sqlite] Re: (New SQLite user) - ANSI Datatypes

2006-11-14 Thread Mario Figueiredo
Thanks both. Probably the SQLite Manager is getting that information from the table schema. But most important is the newly acquired knowledge that SQLite does ignore the lenght restriction. That information is actually already in the documentation. But the third party software was generating

Re: [sqlite] SQL tree and deepness level

2006-11-14 Thread Christian Smith
Robert Zajda uttered: Hello I have a table CREATE TABLE acategories { id integer not null primary key category string parent_category integer references acategories.id ) query: SELECT a.id AS 'id', a.category AS 'Category', b.category AS 'Parent category' FROM acategories AS a

[sqlite] Re: Re: Re: Handling null characters in blob data

2006-11-14 Thread Igor Tandetnik
Shivshankar Subramani - TLS , Chennai <[EMAIL PROTECTED]> wrote: Actually im trying to store a compressed value,which has lots of null characters.When I try to store it into the database as a blob item ,only the characters before null gets stored rest does not. What makes you think so? How do

RE: [sqlite] INSERT INTO with SELECT

2006-11-14 Thread RB Smissaert
Thanks and in fact I had a look at your text importer about an hour ago. Couldn't figure out the parameters though. How would these be if I wanted to do this. Import a text file called ReadCode.txt to a database called ReadCode.db Database has one table called ReadCode with these fields:

Re: [sqlite] Database Locked

2006-11-14 Thread Lloyd
Thanks Clay Dowling, Yes there is a function for fanalize function. Now the problem is solved. On Tue, 2006-11-14 at 08:02 -0500, Clay Dowling wrote: > Lloyd, > > You need at some point to call the sqlite3_finalize function. I don't use > wxSqlite, but if it's not handled by the destructor of

[sqlite] Re: (New SQLite user) - ANSI Datatypes

2006-11-14 Thread Igor Tandetnik
Mario Figueiredo <[EMAIL PROTECTED]> wrote: Are ANSI datatypes recognized? I'm particularly interested in CHAR(X) and VARCHAR(X). And they seem to work in a way I can't understand. A column declared with any type that has "char" in it has string affinity. The length restriction is ignored -

Re: [sqlite] INSERT INTO with SELECT

2006-11-14 Thread Jay Sprenkle
On 11/13/06, RB Smissaert <[EMAIL PROTECTED]> wrote: OK, thanks for the reply. I am using the same construction to write directly from Interbase to Access and that works fine. I'm surprised. Learn something every day! I can make an ADO recordset first from the Interbase data and write that

Re: [sqlite] LEFT OUTER JOIN + INNER JOIN problem

2006-11-14 Thread gabor
[EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: =?UTF-8?B?R8OhYm9yIEZhcmthcw==?= <[EMAIL PROTECTED]> wrote: select * from role LEFT OUTER JOIN person_role on role.id = person_role.role_id INNER JOIN person on person_role.person_id = person.id Your work-around is to say "CROSS JOIN" here

Re: [sqlite] using auto increment in java

2006-11-14 Thread Mario Frasca
On 11/11/2006 10:16 PM, Will Leshner wrote: You should be able to get the last inserted rowid using the last_insert_rowid() function in a query: SELECT last_insert_rowid(); sorry for the slow reaction, but I had to check my own code first... On Fri, 28 Jul 2006 16:47:21 +0200, Nemanja

Re: [sqlite] Re: Migration from sqlite2 to sqlite3 -> no tablename in p3 of Open* rows when explaining sql?

2006-11-14 Thread Mario Wolff
2006/11/14, Igor Tandetnik <[EMAIL PROTECTED]>: I trust you have read http://sqlite.org/opcode.html . For OpenRead and OpenWrite, P2 identifies the root page of the table to open. The root pages for each table and index can be found in sqlite_master table. Oh no, Murphy got me! I´ve testet

Re: Re: [sqlite] Database Corruption and fix suggsted

2006-11-14 Thread jayanth KP
Hi Richard, It is a linux platform compiled with glibc library. And os.c is not changed. Regards Jayanth On Tue, 14 Nov 2006 [EMAIL PROTECTED] wrote : >"jayanth KP" <[EMAIL PROTECTED]> wrote: > > > > 2.) I compiled sqlite 2.8.13 for a proprietary platform that we are using > > for

[sqlite] Trouble ensuring partial uniqueness in trigger

2006-11-14 Thread A.J.Millan
Let's say: CREATE TABLE tableA ( Id TEXT, Cl INTEGER ... ); I need the following conditions: a: Both fields, Id and Cl, can be NULL b: If Id is not null, then the pair Id - Cl must be unique. I use a TRIGGER for BEFORE INSERT on tableA that works pretty well for the

Re: [sqlite] Migration from sqlite2 to sqlite3 -> no tablename in p3 of Open* rows when explaining sql?

2006-11-14 Thread drh
"Mario Wolff" <[EMAIL PROTECTED]> wrote: > Hello Group, > i try to migrate my (alpha-state) project from sqlite2 to sqlite3. To > realize table based acl's i call explain and take the > OpenRead/OpenWrite lines and check for p3 entry which gives the > affected table. With sqlite3 the p3 is not

Re: [sqlite] LEFT OUTER JOIN + INNER JOIN problem

2006-11-14 Thread drh
[EMAIL PROTECTED] wrote: > =?UTF-8?B?R8OhYm9yIEZhcmthcw==?= <[EMAIL PROTECTED]> wrote: > > > > select * from role > > LEFT OUTER JOIN person_role on role.id = person_role.role_id > > INNER JOIN person on person_role.person_id = person.id Your work-around is to say "CROSS JOIN" here instead of

Re: Re: [sqlite] Database Corruption and fix suggsted

2006-11-14 Thread jayanth KP
Hi Richard, Thanks.. As you said. Now I tried to open the database that is not corrupted with sqlite 2.8.13 (that we have). I have an intresting observation. 1.) I compiled sqlite 2.8.13 for PC (little endian) and ran sqlite binary on the directory that had the journal also. RESULT:

Re: [sqlite] Database Locked

2006-11-14 Thread Clay Dowling
Lloyd, You need at some point to call the sqlite3_finalize function. I don't use wxSqlite, but if it's not handled by the destructor of the recordset then there should be a method, possibly called finalize or close, that needs to be called. I recommend consulting the documentation for wxSQLite

[sqlite] Re: Migration from sqlite2 to sqlite3 -> no tablename in p3 of Open* rows when explaining sql?

2006-11-14 Thread Igor Tandetnik
Mario Wolff wrote: i try to migrate my (alpha-state) project from sqlite2 to sqlite3. To realize table based acl's i call explain and take the OpenRead/OpenWrite lines and check for p3 entry which gives the affected table. With sqlite3 the p3 is not set! I trust you have read

Re: [sqlite] LEFT OUTER JOIN + INNER JOIN problem

2006-11-14 Thread Kees Nuyt
On Tue, 14 Nov 2006 13:17:17 +0100, you wrote: >Gábor Farkas wrote: > >> i think it should only output the first row ( "5|admin|1|5|1|john" ) > >tried what you describe and get the answer you expect, not the one you got: [...] >using debian 3.1, sqlite3 3.3.8, >the same also on Mac OS X,

RE: [sqlite] LEFT OUTER JOIN + INNER JOIN problem

2006-11-14 Thread RB Smissaert
> This is fixed in 3.3.6. 3.3.8 is current. A very basic question: What do these figure refer to? I can see the commandline SQLite utility, but no other .exe files. I am connecting in VB/VBA with a third-party dll. Do I have to do anything when there is an update in SQLite? Great software this

Re: [sqlite] LEFT OUTER JOIN + INNER JOIN problem

2006-11-14 Thread Mario Frasca
Gábor Farkas wrote: i think it should only output the first row ( "5|admin|1|5|1|john" ) tried what you describe and get the answer you expect, not the one you got: sqlite> select * from role ...> LEFT OUTER JOIN person_role on role.id = person_role.role_id ...> INNER JOIN person on

[sqlite] LEFT OUTER JOIN + INNER JOIN problem

2006-11-14 Thread Gábor Farkas
hi, consider the following sql: CREATE TABLE "person" ( "id" integer, "name" varchar ); CREATE TABLE "role" ( "id" integer, "name" varchar ); CREATE TABLE "person_role" ( "person_id" integer, "role_id" integer, UNIQUE ("person_id", "role_id") ); insert into person

Re: [sqlite] (New SQLite user) - ANSI Datatypes

2006-11-14 Thread claudio benghi
Hi, I dont' know what SQLite Administrator is doin during the output but I think SQLite stores the data as you inserted it. About this you cold read faq #3 at http://www.sqlite.org/faq.html#q3 Regards, Claudio On 11/14/06, Mario Figueiredo <[EMAIL PROTECTED]> wrote: Hello everyone, I plan

Re: [sqlite] Newbie sqlite questions: check existence of column

2006-11-14 Thread Florent THIERY
My idea was to fill up that base, and afterwards exploit the data: i want to be able to find the most recurrent profiles. Are there complex statistical tools that would work with sqlite's data format ? Or am i forced (as i suppose) to do everything? I'm particularly looking for

Re: [sqlite] Newbie sqlite questions: check existence of column

2006-11-14 Thread Trevor Talbot
On 11/14/06, Florent THIERY <[EMAIL PROTECTED]> wrote: If i follow your saying, it would be best to create a new table when i encounter a new file-structure scheme, but keep a general purpose table with minimal and univeral information. Just to clarify, for simple key-value style headers I

RE: [sqlite] Re: Re: Handling null characters in blob data

2006-11-14 Thread Shivshankar Subramani - TLS , Chennai
Hi, Actually im trying to store a compressed value,which has lots of null characters.When I try to store it into the database as a blob item ,only the characters before null gets stored rest does not.I want to store the entire compressed buffer. Is it possible? BLOB Data stored in the table

[sqlite] (New SQLite user) - ANSI Datatypes

2006-11-14 Thread Mario Figueiredo
Hello everyone, I plan to incorprorate SQLite with my C++ projects. I have read the documentation on how it manages datatypes and I believe I understood it. However I still have a few doubts that don't seem to be covered by the documentation. Are ANSI datatypes recognized? I'm particularly

[sqlite] Re: Re: Handling null characters in blob data

2006-11-14 Thread Igor Tandetnik
Shivshankar Subramani - TLS , Chennai <[EMAIL PROTECTED]> wrote: I did follow the procedure to store the blob data.I have no problem in excuting it but my problem is that when my data is of the below type in memory [snip] Where there are lots of null character in the buffer the sqlite fails

[sqlite] SQL tree and deepness level

2006-11-14 Thread Robert Zajda
Hello I have a table CREATE TABLE acategories { id integer not null primary key category string parent_category integer references acategories.id ) query: SELECT a.id AS 'id', a.category AS 'Category', b.category AS 'Parent category' FROM acategories AS a LEFT JOIN acategories

Re: [sqlite] Database Locked

2006-11-14 Thread Lloyd
I have tracked down the problem and found th following. I have a select statement which stores the result set in a pointer variable. If the result set of select statement is empty, the program executes, otherwise it gives a Database Locked error. How can I solve this problem ? Thanks again,

[sqlite] Migration from sqlite2 to sqlite3 -> no tablename in p3 of Open* rows when explaining sql?

2006-11-14 Thread Mario Wolff
Hello Group, i try to migrate my (alpha-state) project from sqlite2 to sqlite3. To realize table based acl's i call explain and take the OpenRead/OpenWrite lines and check for p3 entry which gives the affected table. With sqlite3 the p3 is not set! Sqlite2: sqlite> explain select * from

Re: [sqlite] Database Corruption and fix suggsted

2006-11-14 Thread drh
"jayanth KP" <[EMAIL PROTECTED]> wrote: > > 2.) I compiled sqlite 2.8.13 for a proprietary platform that we are using for > development(little endian) and ran sqlite binary on the directory that had > the journal also. > > RESULT: > --- > The file is getting corrupted. > > > Please can

Re: [sqlite] Newbie sqlite questions: check existence of column

2006-11-14 Thread Florent THIERY
If i follow your saying, it would be best to create a new table when i encounter a new file-structure scheme, but keep a general purpose table with minimal and univeral information. That's a great idea :) Thanks It allows me to distinguish clearly the types of organization. Will require more

Re: [sqlite] LEFT OUTER JOIN + INNER JOIN problem

2006-11-14 Thread drh
=?UTF-8?B?R8OhYm9yIEZhcmthcw==?= <[EMAIL PROTECTED]> wrote: > > select * from role > LEFT OUTER JOIN person_role on role.id = person_role.role_id > INNER JOIN person on person_role.person_id = person.id > WHERE person.id=1; > > 5|admin|1|5|1|john > 6|devel > > i think it should only output

Re: [sqlite] Newbie sqlite questions: check existence of column

2006-11-14 Thread Trevor Talbot
On 11/14/06, Florent THIERY <[EMAIL PROTECTED]> wrote: Is it best: - to create the table on-the-go: whenever a new column is needed, i add it and fill the data. The previous entries (which never needed this column) are NULL ? - my second option is to parse a lot of files and decide i have quite

Re: [sqlite] Newbie sqlite questions: check existence of column

2006-11-14 Thread Florent THIERY
Thanks First i realized i hadn't the latest sqlite (gotta upgrade)... My project starts well ;) I wanted to know: Is it best: - to create the table on-the-go: whenever a new column is needed, i add it and fill the data. The previous entries (which never needed this column) are NULL ? - my

[sqlite] Database Locked

2006-11-14 Thread Lloyd
Hi, I have opened a database, created tables and inserted data to it in a single transaction. Then I have closed the data base. Then I reopened the database and tried to update the table entries. But it throws an exception called Database Locked. Where can be the mistake? I am using wxSqlite3

Re: [sqlite] Re: Trouble with Trigger

2006-11-14 Thread A.J.Millan
Igor: Your answer includes two points that I consider very illustrative, at least for my. Although I am relatively new in this forum, I believe that your interventions always mean interesting. Greetings. A. J. Millan - Original Message - From: "Igor Tandetnik" <[EMAIL PROTECTED]> To:

Re: [sqlite] Trouble with Trigger

2006-11-14 Thread A.J.Millan
Dennis: Thanks for unveil (to me) that interesting page. Greetings A. J. Millan - Original Message - From: "Dennis Cote" <[EMAIL PROTECTED]> To: Sent: Tuesday, November 14, 2006 12:57 AM Subject: Re: [sqlite] Trouble with Trigger > A.J.Millan wrote: > > I