If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

-540 THE DEFINITION OF TABLE table-name
IS INCOMPLETE BECAUSE IT LACKS
A PRIMARY INDEX OR A REQUIRED
UNIQUE INDEX

Explanation:

An attempt was made to use table table-name in a
CREATE or ALTER statement to define a foreign key or
a clone table, or it was referenced in an SQL
manipulative statement. However, the current status of
the table is incomplete, so it cannot be used as
specified. The definition of the table may be incomplete
because the table was defined with a PRIMARY KEY
clause, a UNIQUE clause, or a ROWID column with
the GENERATED BY DEFAULT attribute. The
definition of the table is incomplete, and it cannot be
used until a unique index is defined for:
v the primary key (the primary index)
v a ROWID column
v for each set of columns in any UNIQUE clause (the
required unique indexes).
An attempt was made to use the table in a FOREIGN
KEY clause or in an SQL manipulative statement.

System action:

The statement cannot be executed.

Programmer response:

Define a primary index or a required unique index on
the table before referencing it.