Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Re: Oracle Data Types Constraints

Re: Oracle Data Types Constraints

From: <prince_kumar_at_my-deja.com>
Date: 2000/06/29
Message-ID: <8jgmr4$52h$1@nnrp1.deja.com>#1/1

Hi:

U can have a CHECK constraint similar to the following

"Constraint FirstName_must CHECK (manager.first_name IS NOT NULL)"

Regds,
Prince.

In article <8jgimq$24q$1_at_nnrp1.deja.com>,   telogan_at_my-deja.com wrote:
> How can I make a single element of a user type required?
>
> The following is found in Oracle's Documentation to illustrate my
> question.
>
> CREATE TYPE Person AS OBJECT (
> first_name VARCHAR2(15),
> last_name VARCHAR2(15),
> birthday DATE,
> home_address REF Address, -- shared with other Person objects
> phone_number VARCHAR2(15))
> /
>
> CREATE TABLE department (
> dept_name VARCHAR2(20),
> manager Person,
> location VARCHAR2(20))
> /
>
> What would I do if I wanted to manager.make first_name and
> manager.last_name required in the
> department table?
>
> I found that I can add any constraint other than not null to a
 specific
> component.
>
> CREATE TABLE department (
> dept_name VARCHAR2(20),
> manager Person,
> location VARCHAR2(20),
> Constraint ATest UNIQUE (manager.first_name, manager.last_name))
> /
>
> I realize that 'create table of' will allow 'not null' constraints to
> be implemented without hassle
> but then I would lose the benefit of inheritance if I had to create a
> new data type for
> every table.
>
> Thanks in advance for your expert help!
>
> Todd Logan
> DBA
> toddl_at_farmclub.com
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
>

Sent via Deja.com http://www.deja.com/
Before you buy. Received on Thu Jun 29 2000 - 00:00:00 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US