Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Subquery not allowed here
mike schrieb:
> I have 2 tables and I want to make sure that a value from tableb is
> included in tablea before it is entered.
>
> tables defined as:
>
> create tablea as
> (
> SUPPLIER_ID INTEGER NOT NULL,
> SUPPLIER_NAME VARCHAR(50) NOT NULL,
> SUPPLIER_LOCATION VARCHAR(50) NOT NULL
> )
>
> create tableb
> (
> LDAP_UID VARCHAR(40) NOT NULL,
> ACCESS_ID INTEGER NOT NULL,
> LM_FLAG CHAR(1) NOT NULL,
> SUPPLIER_ID INTEGER
> )
>
> I can't use a reference from tableb to tablea because the supplier_id
> could be null in tableb, but nulls can not exist in tablea
>
But if you make a supplier_id in tableb not null, then foreign key
should be sufficient.
Best regards
Maxim Received on Mon Aug 29 2005 - 17:25:05 CDT
![]() |
![]() |