vinita Vigine Murugiah wrote:


Egor Egorov wrote:

On Thursday 16 January 2003 00:12, vinita Vigine Murugiah wrote:

Rafal Jank wrote:

On Wed, 15 Jan 2003 11:02:44 +1100

vinita Vigine Murugiah <[EMAIL PROTECTED]> wrote:

HI
  I'm not sure what is wrong with my CREATE TABLE syntax, Please advice

There is no index on ifname in table equipment_interfaces.

Well.. Then how come  Foreign key equipID in table equipment_interfaces
worked?? There is no INDEX on equipID in table equipment??

equipID is a PRIMARY KEY ;)
Well!!! ifname also a Primary key!!

ysql> CREATE TABLE equipment_interfaces (
    ->         equipID   CHAR(20) NOT NULL,
    ->         ifName   CHAR(20) NOT NULL,
    ->         ifType   ENUM("10Mbs","100Mbs","1Gb","CDDI","FDDI"),
    ->         ifNet   CHAR(50),
    ->         ifIPv4addr   CHAR(20),
    ->         INDEX (equipID),
    ->         FOREIGN KEY (equipID) REFERENCES equipment (equipID) ON
DELETE CASCADE,
    ->         PRIMARY KEY (equipID, ifName)
    -> ) TYPE=INNODB;
Query OK, 0
rows affected (0.01 sec)



mysql> CREATE TABLE equipment (
  ->         equipID   CHAR(20)  NOT NULL,
  ->         assetNumber   CHAR(20),
  ->         serialNumber   CHAR(50),
  ->         description   BLOB,
  ->         barcode   CHAR(20),
  ->         room   CHAR(20),
  ->         area   CHAR(20),
  ->         owner   CHAR(100),
  ->         createDate   DATE,
  ->         PRIMARY KEY (equipID)
  -> ) TYPE=INNODB;
Query OK, 0 rows affected (0.00 sec)

[skip]



--


warm regards
Vinita Vigine Murugiah
Email : [EMAIL PROTECTED]			Ph : (03) 8344 1273


--


warm regards
Vinita Vigine Murugiah
Email : [EMAIL PROTECTED]			Ph : (03) 8344 1273




---------------------------------------------------------------------
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