SQL>
SQL> CREATE OR REPLACE TYPE address AS OBJECT
2 (line1 VARCHAR2(20),
3 line2 VARCHAR2(20),
4 city VARCHAR2(20),
5 state_code VARCHAR2(2),
6 zip VARCHAR2(13));
7 /
Type created.
SQL>
SQL> DECLARE
2 off_add address :=address('19 J','Reading Rd','Vancouver','NJ','00000');
3 BEGIN
4 DBMS_OUTPUT.PUT_LINE(off_add.line1||' '||off_add.line2);
5 DBMS_OUTPUT.PUT_LINE(off_add.city||', '||off_add.state_code||' '||off_add.zip);
6 END;
7 /
19 J Reading Rd
Vancouver, NJ 00000
PL/SQL procedure successfully completed.
SQL>
SQL>