Okie...I have this book on Proffessional PHP PRogramming and in the section of
PHP & SQL Databases they have given this eg. with the CONSTRAINTS option....it
goes like this.

CREATE TABLE authorsofdoc (
  docid         INTEGER UNSIGNED NOT NULL,
  authorid      INTEGER UNSIGNED NOT NULL,
  constraint pk_authorsofdoc    PRIMARY KEY(docid, authorid)
)

Now what the heck does the 4th line do? i have never seen a syntax like that
in the CREATE TABLE syntax...wats all that 'constraint pk_authorsofdoc' and
after that 'PRIMARY KEY()' option....
infact acording to CREATE TABLE syntax it should be...
CONSTRAINT fk_authorsofdoc      FOREIGN KEY(docid, authorid)

isnt it??? or am i wrong?

duke.


"Cal Evans" <[EMAIL PROTECTED]> wrote:
It's not implemented in MySQL. It's there for compatibility.

In other flavors of SQL, constraints can be placed on relationships to
enforce referential integrity.

Cal
http://www.calevans.com


-----Original Message-----
From: Duke [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 19, 2001 3:36 AM
To: [EMAIL PROTECTED]
Subject: What is CONSTRAINTS for?


In the CREATE TABLE command there is a create_defn. option called ...
CONSTRAINT symbol

what is that for?

and how does that work?

duke.

Website: http://www.ilug-bom.org.in/
Ftp site: ftp.ilug-bom.org.in
Chat: irc.ilug-bom.org.in
Linuxers mailing list: [EMAIL PROTECTED]
http://ilug-bom.org.in/mailman/listinfo/linuxers


____________________________________________________________________
Get free email and a permanent address at http://www.netaddress.com/?N=1

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php



Website: http://www.ilug-bom.org.in/
Ftp site: ftp.ilug-bom.org.in
Chat: irc.ilug-bom.org.in
Linuxers mailing list: [EMAIL PROTECTED]
http://ilug-bom.org.in/mailman/listinfo/linuxers


____________________________________________________________________
Get free email and a permanent address at http://www.netaddress.com/?N=1

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to