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.

 
Go Back  dBforums > Database Server Software > Informix > Unable to create constraint

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-06-02, 20:15
Ramesh Ramesh is offline
Registered User
 
Join Date: Aug 2002
Location: INDIA
Posts: 24
Red face 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

Reply With Quote
  #2 (permalink)  
Old 12-08-02, 02:44
thedafna thedafna is offline
Registered User
 
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
Reply With Quote
  #3 (permalink)  
Old 12-08-02, 10:18
dananio dananio is offline
Registered User
 
Join Date: Mar 2002
Posts: 112
re

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

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On