Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2002
    Location
    INDIA
    Posts
    24

    Red face Unanswered: Unable to create constraint

    I need to create the following table :

    create table employee
    (
    name char(35) not null constraint n124_159,
    usertype char(1) not null constraint n124_160,
    ddate char(52) not null constraint n124_161)

    I obtained the above create statement from a remote server using
    dbschema -d <database> -t employee.

    I first created the table without the constraints.

    Now I am unable to add the constraint using
    'Alter table employee add constraint n124_159'

    How to create it ?

    Also what is the meaning the constraint as given in the table?

    Any suggestions will be highly appreciated.

    Thanks & regards


  2. #2
    Join Date
    Oct 2002
    Posts
    52
    Hi

    The constraint n124_159 is internal number the the server uses to manage the constraints. Not null is not a regular constraint and can't be named by user (only unique, primary key, refernce and check can be named).

    so the proper way to define this table will be:

    create table employee
    (
    name char(35) not null ,
    usertype char(1) not null ,
    ddate char(52) not null )

    Hope I helped
    Dafna

  3. #3
    Join Date
    Mar 2002
    Posts
    112

    re

    You haven't to name the 'not null' constraint , Informix can manage

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •