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&cid=1&id=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]