create or replace type MYUDT as object
(
-- Author : HELMUT
-- Created : 8/20/2008 10:36:10 AM
-- Purpose : example user defined type
-- Attributes
SILLY NUMBER,
FOO VARCHAR2(200)
-- Member functions and procedures
)
Create a table like normal:
-- Create table
create table DUMMYTABLE
(
USERTYPECOLUMN MYUDT
)
;
You can then insert into the table like so:
INSERT INTO DUMMYTABLE (USERTYPECOLUMN) VALUES ( MYUDT(10,'Obamarama') );
and read from the table like so:
SELECT USERTYPECOLUMN.FOO FROM DUMMYTABLE WHERE USERTYPECOLUMN.SILLY > 5;
No comments:
Post a Comment