[sqlite] Problem getting trigger to work

2009-07-17 Thread Jim Showalter
I have this simple schema: create table words ( _id integer primary key autoincrement, wordText text not null unique ); I have triggers that work, which I got from http://www.sqlite.org/cvstrac/wiki?p=ForeignKeyTriggers. Now I'm trying to modify the update trigger to prevent saving a

Re: [sqlite] [Columns] Keeping internal + beautified names?

2009-07-17 Thread BareFeet
Hi Gilles, >> SELECT id AS Identification FROM foobar > > Thanks. This is what I already use for displaying the results, but > then I'm stuck when I need to perform INSERT/UPDATES because I need to > get the actual columns names :-/ > > It'd be cool if each column in a table could have an

Re: [sqlite] Heirarchical queries question

2009-07-17 Thread Igor Tandetnik
Swithun Crowe wrote: > Traverse the tree in depth-first order, giving each node the first > coordinate when going down, and the second when going back up. This is known as a nested-set model: http://dev.mysql.com/tech-resources/articles/hierarchical-data.html

Re: [sqlite] Heirarchical queries question

2009-07-17 Thread Swithun Crowe
Hello D I'm trying to get my head around doing hierarchies in SQL. I've been D Googling and it appears Oracle and MS SQL have some extensions to help, but D I'm trying to figure out what can be done with 'plain' SQL. With tree structures in table, I like to use a pair of coordinates (x and y),

[sqlite] SQLite 3.6.16 and the Asynchronous I/O transaction fails with multiple database files

2009-07-17 Thread Alessandro Merolli
I'm trying to use the asynchronous I/O extension with the latest SQLite version for the first time in my project. This project is using database files attached into one database connection. I start a transaction which involves two different database files but, the commit operation is failing

Re: [sqlite] Heirarchical queries question

2009-07-17 Thread Pavel Ivanov
Look here http://www.sqlite.org/lang_expr.html in section "The LIKE and GLOB operators". --- The operand to the right contains the pattern, the left hand operand contains the string to match against the pattern. A percent symbol ("%") in the pattern matches any sequence of zero or more

Re: [sqlite] Heirarchical queries question

2009-07-17 Thread Doug
Wow Pavel, that's a cool approach. I understand the issue about having % in the path (which is a problem I need to work around), but what is special about '_' ? Thanks Doug > -Original Message- > From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users- > boun...@sqlite.org] On

Re: [sqlite] Heirarchical queries question

2009-07-17 Thread Pavel Ivanov
Maybe this: select childs.Path, count(*) from Directory childs, Directory hierarchy where childs.ParentDirID = ? and hierarchy.Path like childs.Path || '%' group by childs.Path You should have indexes on ParentDirID and on Path to make this query somewhat effective. And you shouldn't have '%'

[sqlite] Heirarchical queries question

2009-07-17 Thread Doug
I'm trying to get my head around doing hierarchies in SQL. I've been Googling and it appears Oracle and MS SQL have some extensions to help, but I'm trying to figure out what can be done with 'plain' SQL. Imagine a directory table: CREATE TABLE IF NOT EXISTS Directory ( DirID

[sqlite] Multiple Writers and Database is Locked Problems

2009-07-17 Thread Cole
Hi. Im hoping someone might be able to help me with the problems im having, or suggest a better method of doing what im trying to achieve. Currently im using sqlite3 3.6.10. I don't mind updating or downgrading it if needed. I have a program that I run multiple instances of. When they start,

Re: [sqlite] Is there a substitute for Sqlite3_get_table ?

2009-07-17 Thread Simon Davies
2009/7/17 Atul_Vaidya : > > Hi, . . . > My question is, is it possible in > SQlite to retrieve the data stored in the database in the format in which it > is stored when the data was inserted in it ? for eg: if I store the data as > an Int, will I get it back as

[sqlite] Is there a substitute for Sqlite3_get_table ?

2009-07-17 Thread Atul_Vaidya
Hi, I have recently implemented SQlite into my Application which is an Engineering Analysis Software.I have implemented the DB in such a way that, I use the row_id as a primary integer key using this as an identifier for different fields in the table.Most of the fields in the table are