RE: [sqlite] Difference between Transaction Journal and Checkpoint Journal

2004-03-24 Thread Peter Pistorius
I'm going to make an assumption here, but it might make sense that the
three are related to each other.

Ie: A "journal" entry points to a entry in the "transaction journal,"
and "checkpoint journal."

--

Journal: A mechanism which tracks changes made to data in the database
between checkpoints.
 

-Original Message-
From: Rohit Nadhani [mailto:[EMAIL PROTECTED] 
Sent: Thursday, March 25, 2004 8:33 AM
To: [EMAIL PROTECTED]
Subject: [sqlite] Difference between Transaction Journal and Checkpoint
Journal

Hello,

I was going thru the pager source code ( pager.c ). The comments include
references to "Journal", "Transaction Journal", "Checkpoint Journal".
What is the difference between the three? Am I missing something?

Regards,

Rohit


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[sqlite] Difference between Transaction Journal and Checkpoint Journal

2004-03-24 Thread Rohit Nadhani
Hello,

I was going thru the pager source code ( pager.c ). The comments include
references to "Journal", "Transaction Journal", "Checkpoint Journal". What
is the difference between the three? Am I missing something?

Regards,

Rohit


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: [sqlite] mySQL to SQLite conversion question

2004-03-24 Thread Peter Pistorius
1) adrsId INTEGER PRIMARY KEY

If you insert a null value in "adrId," or not insert anything at all,
then it will auto incremement.

2) You will not require NOT NULL, think about it.

3) I've found a really good e-book on advanced databasing, you can pick
up a free copy here:
http://216.197.101.104/emarketing/registration_form.cfm?pid=1=1=5

You'll have to give them some personal information, but I really think
it's worth it.

Regards,
PeterP

 

-Original Message-
From: rich coco [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, March 24, 2004 11:58 PM
To: [EMAIL PROTECTED]
Subject: [sqlite] mySQL to SQLite conversion question


I see that the auto_increment keyword is not supported by SQLite:

addressid bigint(20) unsigned NOT NULL auto_increment,
.
.
.
PRIMARY KEY (addressid)

I understand that I have to move the 'unsigned' keyword (before
'bigint') but I do not know how to get the auto_increment semantic under
SQLite.

I found in the 'Datatypes in SQLite' manual page (in Section 2.0) the
comment:

"INTEGER PRIMARY KEY columns can be used to implement the
  equivalent of AUTOINCREMENT."

Is the following the proper re-write to get the precise semantic I am
seeking?

addressid INTEGER PRIMARY KEY NOT NULL

Can I then omit the subsequent "PRIMARY KEY (addressid)" line?

Is "NOT NULL" no longer needed?

Can someone recommend a good SQL book (I am not a DB guy)?
There are so many out there and I'd like to purchase just one, so I need
to get it right the first time. I found on-line manuals by DB engine
providers - eg, http://www.mysql.com/doc/en/SQL_Syntax.html - but I do
not know when I may be looking at specialized extentions (eg, mySQL's
REGEXP and auto_increment keywords). I'd like to have my own reference.

Tia,

- rich

--
rich coco
[EMAIL PROTECTED]
781.736.1200  x165
Starbak Inc.
29 Sawyer Rd.
Waltham, MA 02453


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[sqlite] mySQL to SQLite conversion question

2004-03-24 Thread rich coco
I see that the auto_increment keyword is not supported by SQLite:

addressid bigint(20) unsigned NOT NULL auto_increment,
.
.
.
PRIMARY KEY (addressid)
I understand that I have to move the 'unsigned' keyword
(before 'bigint') but I do not know how to get the auto_increment
semantic under SQLite.
I found in the 'Datatypes in SQLite' manual page (in Section 2.0)
the comment:
"INTEGER PRIMARY KEY columns can be used to implement the
  equivalent of AUTOINCREMENT."
Is the following the proper re-write to get the precise semantic
I am seeking?
	addressid INTEGER PRIMARY KEY NOT NULL

Can I then omit the subsequent "PRIMARY KEY (addressid)" line?

Is "NOT NULL" no longer needed?

Can someone recommend a good SQL book (I am not a DB guy)?
There are so many out there and I'd like to purchase just one,
so I need to get it right the first time. I found on-line manuals
by DB engine providers - eg, http://www.mysql.com/doc/en/SQL_Syntax.html -
but I do not know when I may be looking at specialized extentions
(eg, mySQL's REGEXP and auto_increment keywords). I'd like to
have my own reference.
Tia,

- rich

--
rich coco
[EMAIL PROTECTED]
781.736.1200  x165
Starbak Inc.
29 Sawyer Rd.
Waltham, MA 02453
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


[sqlite] Text(3)

2004-03-24 Thread aducom
For the users using the Delphi components there is a property in 
TASQLiteTable and TASQLiteQuery to set or reset the 'typeless' property.
Setting this property to 'false' (typed) means that all data-aware 
components of Delphi will react on the defined type (must be delphi 
compatible) and length, forcing correct data to be entered.

Albert Drent
sqlite.aducom.com



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [sqlite] Text(3)

2004-03-24 Thread ben . carlyle
"Anabell Chan" <[EMAIL PROTECTED]>
24/03/2004 05:23 PM
Please respond to anabell

 
To: <[EMAIL PROTECTED]>
cc: 
Subject:[sqlite] Text(3)


> Firstly, how do I define a string table field with constraints on its 
size?
> For example Text(3), string of three characters.  Secondly, how is it
> enforced during updates?  Many thanks!

Sqlite will make you work a little to enforce contraints like this. If you 
really want to, here's how:

CREATE TABLE foo (a); -- we want a to be at most three characters long
CREATE TRIGGER foo_a_insert_constraint BEFORE INSERT ON foo
BEGIN
SELECT RAISE(ABORT, "a is too long") WHERE length(NEW.a) > 3;
END;
CREATE TRIGGER foo_a_update_constraint BEFORE UPDATE OF a ON foo
BEGIN
SELECT RAISE(ABORT, "a is too long") WHERE length(NEW.a) > 3;
END;

sqlite> INSERT INTO foo VALUES("abcd");
SQL error: a is too long
sqlite> INSERT INTO foo VALUES("abc");
sqlite>

Adjust table and column names, and string length to suit. See 
http://sqlite.org/lang.html#createtrigger for reference material. This 
approach can be taken to check a wide variety of constraints. If you can 
define a WHERE clause that can detect a problem, you can abort the 
offending operation using a couple of triggers.

Does anyone have a more succinct version of the above?

Benjamin.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]