Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Unique REF Cursor
e.cunibil_at_gmail.com wrote:
> Hello,
>
>
> I am an IT Student and we learn using Oracle.
> I have a little problem with a REF I want to be unique.
> Let see my problem :
>
> CREATE TYPE T_Group AS object (
> groupName VARCHAR2(30)
> );
> CREATE TYPE T_People AS object (
> num INTEGER,
> name VARCHAR2(30)
> );
> CREATE TYPE T_Student AS object (
> whoIs REF T_People,
> studentGroup REF T_Group
> );
>
> CREATE TABLE Group OF T_Group (
> CONSTRAINT pk_group PRIMARY KEY (groupName)
> );
> CREATE TABLE People OF T_People (
> CONSTRAINT pk_people PRIMARY KEY (num)
> );
> CREATE TABLE Student OF T_Student (
> CONSTRAINT un_whois_student UNIQUE(whoIs),
> CONSTRAINT notnull_group_student CHECK (studentGroup IS NOT NULL)
> );
>
>
> Unique constraint are forbidden on REF fields so do you know a way to
> make this field unique ?
>
>
> Thanks a lot !
One thought:
select count(*)
from v$reserved_words
where keyword IN ('GROUP');
-- Daniel A. Morgan University of Washington damorgan_at_x.washington.edu (replace x with u to respond) Puget Sound Oracle Users Group www.psoug.orgReceived on Fri Jun 16 2006 - 10:39:20 CDT