ORACLE SQL experts: please help

From: <jmohsin_at_my-dejanews.com>
Date: Sun, 02 Aug 1998 21:30:34 GMT
Message-ID: <6q2lpq$t66$1_at_nnrp1.dejanews.com>



Hi,

[Quoted] [Quoted] I had a rather simple question pertaining to "create table". I am unable to DISABLE a constraint that refers to a yet-to-be-created table.

In the SQL below, I am trying to create a table called "EMPLOYEE" that has a foreign key from a currently non-existant table called DEPARTMENT. Because DEPARTMENT does not exist, I am trying to use the DISABLE clause for CONSTRAINT FK_DEP. The idea is that I will create DEPARTMENT later and then ENABLE the FK_DEP constraint.

I get the following error:
CONSTRAINT FK_DEP FOREIGN KEY (DNO) REFERENCES DEPARTMENT(DNUMBER) DISABLE)

                                               *
ERROR at line 8:
ORA-00942: table (DEPARTMENT) or view does not exist

Here is the SQL I used:
CREATE TABLE EMPLOYEE (
FULLNAME VARCHAR2(15),
LASTNAME VARCHAR2(15),
SSN CHAR(9) NOT NULL,
ADDRESS VARCHAR2(30),
DNO INT NOT NULL,
CONSTRAINT PK_EMP PRIMARY KEY(SSN) DISABLE, CONSTRAINT FK_DEP FOREIGN KEY (DNO) REFERENCES DEPARTMENT(DNUMBER) DISABLE); [Quoted] Please post responses here.

[Quoted] [Quoted] -----== Posted via Deja News, The Leader in Internet Discussion ==----- http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum Received on Sun Aug 02 1998 - 23:30:34 CEST

Original text of this message