Reputation: 157
hi i'm using oracle 11g to create a table with Object-Relational Features but its not creating the table for some reason
here what i have
create type Name as object (
firstname varchar2(20),
surname varchar2(20))
final
create type Address as object (
street varchar2(20),
city varchar2(20),
postal_code varchar2(8))
not final
and for the table
create table people (
(pname Name,
paddress Address,
dateOfBirth date);
yet its not creating the table, i know its probably something simple and straight forward but i just cant seam to get it to create the table, if somebody could point me in the right direction to get it to create the table that would be great
also when i try create the table i get the following error
ORA-00904: "%s: invalid identifier"
*Cause:
*Action:
Vendor code 904Error at line:2 colimn:2
Upvotes: 0
Views: 138
Reputation: 8159
You can try this:
CREATE TYPE Name as object (firstname varchar2(20), surname varchar2(20)) FINAL;
CREATE TYPE Address as object (street varchar2(20), city varchar2(20), postal_code varchar2(8)) NOT FINAL;
CREATE TABLE people (pname Name, paddress Address, dateOfBirth date);
Upvotes: 2
Reputation: 256
try this
create type Name as object (
firstname varchar2(20),
surname varchar2(20))
final );
create type Address as object (
street varchar2(20),
city varchar2(20),
postal_code varchar2(8))
not final);
Upvotes: 1