RE: [sqlite] Create table / data types

2006-11-19 Thread RB Smissaert
Yes, SHORT should translate to Integer. How about the syntax with create table? Thanks. RBS -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: 19 November 2006 23:45 To: sqlite-users@sqlite.org Subject: Re: [sqlite] Create table / data types "RB Smissaert"

Re: [sqlite] Create table / data types

2006-11-19 Thread drh
"RB Smissaert" <[EMAIL PROTECTED]> wrote: > I can see that doing this: > > create table ReadCode > (SUBJECT_TYPE varchar > READ_CODE varchar > TERM30 varchar > TERM60 varchar); > > Seems to work just the same as does this: > > create table ReadCode > (SUBJECT_TYPE text >

Re: [sqlite] Create table / data types

2006-11-19 Thread drh
"RB Smissaert" <[EMAIL PROTECTED]> wrote: > > Also, how would I translate these data types of Interbase to SQLite data > types: > > I take it that it will be like this: > > BLOB > BLOB > DATE > TEXT > DOUBLE> REAL > LONG > INTEGER > SHORT > REAL Did you mean "SHORT >

RE: [sqlite] Create table / data types

2006-11-19 Thread RB Smissaert
I can see that doing this: create table ReadCode (SUBJECT_TYPE varchar READ_CODE varchar TERM30 varchar TERM60 varchar); Seems to work just the same as does this: create table ReadCode (SUBJECT_TYPE text READ_CODE text TERM30 text TERM60 text);

Re: [sqlite] Design of application using embedded database

2006-11-19 Thread Roger Binns
[EMAIL PROTECTED] wrote: > In all of the desktop apps that I write, I omit the File->Save > option altogether. Incidentally, this is excellent from a usability point of view. It seems rather ludicrous in this day and age that users of other applications have to know the difference between

Re: [sqlite] Design of application using embedded database

2006-11-19 Thread John Stanton
If you maintain a log of each transaction, perhaps in SQL or some similar form, then you can create the inverse of that to undo or run it again to redo. Each transaction can have its own registration ID. I should anticipate that you would use some form of circular buffer to make the process

Re: [sqlite] Database sync

2006-11-19 Thread John Stanton
Isaac Raway wrote: Well, putting this together I think I may have settled on a solution for the first version of this project: 1) Only a single user will have access to each DB, therefore taking the most recent record from any table will always be the right thing to do. This avoids the

Re: [sqlite] Design of application using embedded database

2006-11-19 Thread Trevor Talbot
Ran wants the transaction journal to be a permanent transaction log, with the ability to explicitly run a rollback operation on it (after the transaction was committed). Unlimited undo support using only the transaction control statements. To answer the question, no, there's no support for

Re: [sqlite] Design of application using embedded database

2006-11-19 Thread Ran
I am not sure what that means. I am looking for undo feature the way it is implemented for example in a drawing application or in a word processor. When the user makes a mistake or change his mind, he can undo several steps and try again. On 11/19/06, Jay Sprenkle <[EMAIL PROTECTED]> wrote: On

Re: [sqlite] Design of application using embedded database

2006-11-19 Thread Ran
What exactly do you mean by "own log of each transaction"? As I explained, I have a complex database with many tables and triggers. It will not be simple to implement undo the way it is explained in the wiki, and I suspect it will cost much in performance (but maybe I am wrong here...). If

Re: [sqlite] Design of application using embedded database

2006-11-19 Thread Jay Sprenkle
On 11/19/06, Ran <[EMAIL PROTECTED]> wrote: I think I didn't explain my question well enough. I know all what you wrote about transactions. The undo functionality I am looking for is over _several_ transactions. Does nested transactions do what you want?

Re: [sqlite] Database sync

2006-11-19 Thread Isaac Raway
Well, putting this together I think I may have settled on a solution for the first version of this project: 1) Only a single user will have access to each DB, therefore taking the most recent record from any table will always be the right thing to do. This avoids the complexity of conflict

Re: [sqlite] Design of application using embedded database

2006-11-19 Thread John Stanton
Ran wrote: I think I didn't explain my question well enough. I know all what you wrote about transactions. The undo functionality I am looking for is over _several_ transactions. I just wonder if it is possible to twist sqlite to keep the journals created during transactions (so to store them

Re: [sqlite] Design of application using embedded database

2006-11-19 Thread Ran
I think I didn't explain my question well enough. I know all what you wrote about transactions. The undo functionality I am looking for is over _several_ transactions. I just wonder if it is possible to twist sqlite to keep the journals created during transactions (so to store them just before

Re: [sqlite] Select name if exists in the group/table

2006-11-19 Thread Jay Sprenkle
\On 11/18/06, Micro Mega Dust <[EMAIL PROTECTED]> wrote: Hi, I'm a novice using databases, and I have a doubt about the working of SQL language: I have a system of user group, where each group is a table in sqlite_master, (each table of a group contains the UIDs of the members). But I don't

Re: [sqlite] Why is VACUUM so slow?

2006-11-19 Thread Joe Wilson
I forgot that sqlite page_size is lost during a .dump. The command should actually be: (echo "PRAGMA page_size=8192;" ; sqlite3 your.db .dump) | sqlite3 new.db This runs 4 times faster on my machine with a large database than the command below with a default page_size of 1024. Replace

Re: [sqlite] Design of application using embedded database

2006-11-19 Thread Jay Sprenkle
On 11/18/06, Ran <[EMAIL PROTECTED]> wrote: The way the undo-redo is described in the wiki involves triggers to insert the information of the change in each table to other table which logs the changes. This will have a price in performance. It also complicates things when triggers are already

Re: [sqlite] Select name if exists in the group/table

2006-11-19 Thread Micro Mega Dust
Ok, thank you Trevor Talbot and pepone. onrez. 2006/11/19, Trevor Talbot <[EMAIL PROTECTED]>: On 11/19/06, Micro Mega Dust <[EMAIL PROTECTED]> wrote: > I tried this query... > CREATE TABLE test ('foo', 'bar', UNIQUE('foo', 'bar')); > > I think that it work. It allow duplicate data in each

Re: [sqlite] Syntax Error

2006-11-19 Thread John Stanton
Clara Kinner wrote: Ah yes! I tried a dos prompt last night, but it wouldn't work... didn't like the directory or something odd. I moved the sqlite3 program to the C:\ dir and it worked.But now I have no idea where it created the test.db! Haha... Thank you for your help! Clara Trevor

Re: [sqlite] Syntax Error

2006-11-19 Thread Clara Kinner
Ah yes! I tried a dos prompt last night, but it wouldn't work... didn't like the directory or something odd. I moved the sqlite3 program to the C:\ dir and it worked.But now I have no idea where it created the test.db! Haha... Thank you for your help! Clara Trevor Talbot wrote: On

Re: [sqlite] Why is VACUUM so slow?

2006-11-19 Thread Joe Wilson
on Sat, 18 Nov 2006 06:55:34 -0800 P Kishor wrote: >didn't try any of your tricks, but can confirm that VACUUM is very >slow on a similar db I have... > >table1 -- 210k rows x 6 cols, 4 indexes, 1 pk >table2 -- 36k rows x 6 cols, 4 indexes, 1 pk >table3 -- 16k rows x 6

Re: [sqlite] Database sync

2006-11-19 Thread John Stanton
Isaac Raway wrote: I am looking at a design that will require syncing a disconnected SQLite DB file on client's machines to a central server. The version of the DB on the server will also be modified periodically, so there is a chance that new records will be created in either and also updated.

Re: [sqlite] Select name if exists in the group/table

2006-11-19 Thread Trevor Talbot
On 11/19/06, Micro Mega Dust <[EMAIL PROTECTED]> wrote: I tried this query... CREATE TABLE test ('foo', 'bar', UNIQUE('foo', 'bar')); I think that it work. It allow duplicate data in each column, but not in both simultaneously. It is correct? This feature, it demonstrates than using a single

Re: [sqlite] Select name if exists in the group/table

2006-11-19 Thread Micro Mega Dust
2006/11/19, Trevor Talbot <[EMAIL PROTECTED]>: Why would that happen? This table exists only to express a single relationship between a user and a group. You would not insert duplicate data. It can be enforced with a UNIQUE constraint. How to avoid the duplicate data? Until this moment, I

Re: [sqlite] Syntax Error

2006-11-19 Thread Martin Jenkins
Hi Clara, Sometimes confusion arises because SQLite can refer to both a library which implements SQL and a shell which allows command line access to that library. There's a short tutorial on using the shell at http://www.sqlite.org/sqlite.html and several on SQLite's SQL syntax at

Re: [sqlite] Syntax Error

2006-11-19 Thread Trevor Talbot
On 11/18/06, Clara Kinner <[EMAIL PROTECTED]> wrote: I've just started using SQL, and was recommended this program by a co-worker... so I tried the sqlite3 test.db command to start up my new DB, but when I hit enter, it returns with a ...> prompt, so when enter, or end test.db with a ";", I get

Re: [sqlite] Select name if exists in the group/table

2006-11-19 Thread Trevor Talbot
On 11/18/06, Micro Mega Dust <[EMAIL PROTECTED]> wrote: I create a separate table for each group, in order to avoid redundant data in the table. Your solution is interesting, but I think that allow redundancy in "GroupUsers". For example: +---+-+ |userId | groupIp |