Re: [sqlite] SQL to renumber values in a column?

2005-05-09 Thread Gabor Szabo
On 5/9/05, Brown, Dave <[EMAIL PROTECTED]> wrote: > > The question I have is: If a row gets deleted, how do I sequentially reorder > the remaining > rows? For example: > > Start with this: > a, 1 > b, 2 > c, 3 > d, 4 > > now delete the row with 'b': > > a, 1 > c, 3 > d, 4 > > I'm trying to fig

[sqlite] Kexi 0.9 beta 1 released

2005-05-09 Thread Jarosław Staniek
For original announcement with links see http://www.kexi-project.org/wiki/wikiview/index.php?0.9Beta1Announcement == Kexi 0.9 beta 1 Announcement == Kexi Team Ships Beta Release of Major Enhancements to Free Integrated Database Environment May 9, 2005 (The INTERNET). The Kexi Team today announced t

[sqlite] avoiding triggers within triggers ?

2005-05-09 Thread Gabor Szabo
While playing around with the extension of the order_number question Dave posted I got stuck at some point. I have 3 triggers on a table for INSER/DELETE and UPDATE. all 3 of them do further UPDATEs on the same table. How can I make sure that these UPDATEs won't fire the UPDATE trigger again ? Can

Re: [sqlite] SQL to renumber values in a column?

2005-05-09 Thread Jay Sprenkle
On 5/8/05, Brown, Dave <[EMAIL PROTECTED]> wrote: > That's not what I want, though. I want to UPDATE the actual values in the > order_number column so they end up as 1, 2, 3 instead of 1, 3, 4. > > So I want the result of a "select * from table order by order_number" to > give me: > a, 1 > c, 2 >

Re: [sqlite] Merging databases

2005-05-09 Thread Jay Sprenkle
> Trivial. Don't use sqlite's "integer primary key", but instead globally > unique identifiers. > > http://cr.yp.to/proto/maildir.html Nice link, thanks! > > Has good hints on where to get your globally unique identifiers. > > Or translate the original keys to globally unique identifiers withi

[sqlite] view and column naming problem in sqlite3

2005-05-09 Thread David M. Cook
I have a view CREATE VIEW flat_recording_view as select r.recording_id, c.composer_name, w.title, r.description, l.label_name, d.catalog_no from composer c join work w on (c.composer_id=w.composer_id) join recording r on (w.work_id=r.work_id) join disc d on (r.disc_id=d.disc_id) join label l on (l

[sqlite] Data tipe

2005-05-09 Thread Sombra
There is any Datatypes for Data (year, moth,day ) in version 2.8.16 of SQLite? Thanks SB

Re: [sqlite] view and column naming problem in sqlite3

2005-05-09 Thread David M. Cook
On Mon, May 09, 2005 at 08:20:14AM -0700, David M. Cook wrote: > CREATE VIEW flat_recording_view as select r.recording_id, c.composer_name, > SQL error: no such column: composer_name > > Aliasing the column names in the view using the 'as' syntax didn't help. I guess I mistyped my query, aliasi

Re: [sqlite] Data tipe

2005-05-09 Thread Martin Engelschalk
Sombra schrieb: There is any Datatypes for Data (year, moth,day ) in version 2.8.16 of SQLite? Thanks SB No, there isn't. you can save a time_t or even a COleDateTime::m_dt in the database. Yours Martin

[sqlite] enum return type idea for sqlite3 functions

2005-05-09 Thread Helmut Tschemernjak
Hello, I like to recommend to use an enum for the return code of all sqlite3 functions., E.g.: typedef enum { SQLITE_OK = 0,/* Successful result */ SQLITE_ERROR= 1,/* SQL error or missing database */ SQLITE_INTERNAL = 2,/* An internal logic error in S

[sqlite] Multiuser SQLITE_LOCKED error syncronization idea

2005-05-09 Thread Helmut Tschemernjak
Hello, sqlite3 3.2.1 gives SQLITE_LOCKED errors if one process updates the database and another accesses it. Most retries will fail if the other processes is working e.g. many inserts. Here is my idea: Keep a list of up to 32 pid_t of waiting processes in the database file. After one statement

Re: [sqlite] Multiuser SQLITE_LOCKED error syncronization idea

2005-05-09 Thread Ara.T.Howard
On Mon, 9 May 2005, Helmut Tschemernjak wrote: Hello, sqlite3 3.2.1 gives SQLITE_LOCKED errors if one process updates the database and another accesses it. Most retries will fail if the other processes is working e.g. many inserts. Here is my idea: Keep a list of up to 32 pid_t of waiting processes

[sqlite] Can I bind a sql parameter to a filed name?

2005-05-09 Thread liigo
when i use this code: (Omit some code...such as sqite3_stmt) sqlite3_prepare("select * from table1 where $fieldname = $fieldvalue") sqlite3_bind_text("$fieldname", "id"); //the "id" is a field of table1, this line maybe got error. sqlite3_bind_int("$fieldvalue", 5); sqlite3_step(); ... I wonder

Re: [sqlite] request for additions to sqlite 3.xx

2005-05-09 Thread basil thomas
> What's the objection to reading your SQL source out of the database and > preparing it at program startup? I have no objection to reading the sql on startup as that is what we are currently doing. I just want all data access code inside of the database instead of my source code. Does anyone else

[sqlite] Ticket 1224: config.h

2005-05-09 Thread Christian Smith
On Wed, 27 Apr 2005, Christian Smith wrote: >On Tue, 26 Apr 2005, D. Richard Hipp wrote: > >>On Tue, 2005-04-26 at 17:49 +0100, Christian Smith wrote: >>> Just created ticket #1224 to remove config.h from build, but there appears >>> to be no way to attach a patch to the ticket itself. Have I miss