SQL errors for ENUM and INDEX

G

Greg

Hi,

I'm new to access and am trying to create DDL queries to setup some of
my tables. I have hit 2 issues that I need help with where access is
giving an error on the sql. The first problem is caused by a statement
similar to below, Access gives an error on the line with the ENUM
datatype for the adult_type column:

create table adults (
adult_id INT(11) NOT NULL
, primary_name VARCHAR(30) NOT NULL
, adult_type NOT NULL ENUM('PARENT','STAFF','OTHER')
, PRIMARY KEY (adult_id)
, UNIQUE (adult_id)
);

The second problem is caused by a statement similae to below, Access
gives an error on the line with the INDEX on the adult_id column.

create table CHILDREN (
child_id INT(11) NOT NULL
, name VARCHAR(30) NOT NULL
, adult_id INT(11) NOT NULL
, PRIMARY KEY (child_id)
, UNIQUE (child_id)
, INDEX children_N1 (adult_id)
);

Any help is getting these two statements to work in access is much
appreciated. FYI, for the INDEX problem I have been able to get it to
work in a separate CREATE INDEX statement but would really prefer to
have it part of the inital DDL query if possible.

Thanks,
Greg
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top