Re: Addition of constraint during creation of table

From: mcstock <mcstockspamplug_at_spamdamenquery.com>
Date: Thu, 27 Nov 2003 16:25:02 -0500
Message-ID: <ZI6dnZidoepX9luiRVn-jg_at_comcast.com>


reference the CREATE TABLE statement in the SQL manual for the 2 possible syntaxes -- one of which is very similar to the alter table add constraint syntax

also look into options such as DISABLED

also be ready for some strong opinions on whether you should include the constraints in the CREATE TABLE

  • Mark Stock

"ponnurangam k" <ponguru_at_yahoo.com> wrote in message news:d4c2c513.0311271151.bcfb931_at_posting.google.com...
| Hi All,
|
| I have few tables (abc, def) with with a specific structure and I need
| to add constratint to the table I do it with
|
| alter table abc
| add constraint abc_columnname_fk
| foreign key (columnname) references dec(columnname);
|
| But my question is how to create a table with this constraint embedded
| in the create table statement itself ? same, as in
|
| CREATE TABLE abc
| (columna PRIMARY KEY,
| Column2 CHAR(50) ???????????? );
|
| Can I embed the constraint during creation of the table only ?
|
| Can somebody please throw light or solution
|
| I am stuck with this problem.
|
| Thanks in advance,,
|
| PK
Received on Thu Nov 27 2003 - 22:25:02 CET

Original text of this message