If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ANSI SQL > Inserting Values into Oracle Objects

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-09-03, 15:28
amitj50 amitj50 is offline
Registered User
 
Join Date: Sep 2003
Location: York, England
Posts: 2
Post Inserting Values into Oracle Objects

Hi
I have a bit of a problem that needs to be sorted out urgently, so please if any one can help pls get back to me at amitj50@yahoo.com thanks

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XX
SCHEEMA DEFINITIONS
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XX


CREATE TYPE email_va AS VARRAY(5)OF varchar2(50)

CREATE TYPE tel_fax_va AS VARRAY(5)OF varchar2(15)

CREATE OR REPLACE TYPE address_ty AS OBJECT (
street varchar2(30),
city varchar2(20),
postCode char(8))

CREATE OR REPLACE TYPE contact_ty AS OBJECT (
tel tel_fax_va,
fax tel_fax_va,
email email_va)

CREATE OR REPLACE TYPE person_ty AS OBJECT (
title varchar2(3),
firstName varchar2(30),
lastName varchar2(30),
contact contact_ty,
address address_ty)


CREATE OR REPLACE TYPE employee_ty AS OBJECT (
empNo number,
person person_ty,
salary number(6,2),
commission number(6,2),
pic BLOB,
department REF department_ty)

CREATE OR REPLACE TYPE department_ty AS OBJECT (
deptNo number(4,0),
deptName varchar2(30),
address address_ty)

CREATE OR REPLACE TYPE manager_ty AS OBJECT (
MgrNo number,
Department REF department_ty,
Employee REF employee_ty)

CREATE TABLE Department_oTab OF Department_ty
(deptNo PRIMARY KEY,
CONSTRAINT conDName CHECK (deptName IS NOT NULL),
CONSTRAINT conPcode CHECK (address.postCode IS NOT NULL)
) OBJECT ID PRIMARY KEY

CREATE TABLE Employee_oTab OF Employee_ty
(empNo PRIMARY KEY,
FOREIGN KEY (Department) REFERENCES Department_oTab,
CONSTRAINT conEmpFName CHECK (person.firstName IS NOT NULL),
CONSTRAINT conEmpLName CHECK (person.lastName IS NOT NULL)
) OBJECT ID PRIMARY KEY

CREATE TABLE Manager_oTab OF Manager_ty
(mgrNo PRIMARY KEY, FOREIGN KEY (Department) REFERENCES Department_oTab, FOREIGN KEY (Employee) REFERENCES Employee_oTab)
OBJECT ID PRIMARY KEY;

The problem I am having is inserting values into the manager table
Could any one please let me know how I am supposed do this?
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On