I want a table like,
no name address
addr1 addr2
So i want columns like addr1,addr2 under address column.
Can one please answer me.
Advance Thanks.
Answer Posted / prabhudatta barick
--CREATE A OBJECT TO HOLD ADDRESS
CREATE OR REPLACE TYPE ADDRESSES AS
OBJECT(ADDRESS1 VARCHAR2(1000),
ADDRESS2 VARCHAR2(1000));
--CREATE TABLE
CREATE TABLE EMP (
EMPNO VARCHAR2 (5),
ENAME VARCHAR2 (30),
ADDR ADDRESSES);
--INSERT DATA
INSERT INTO EMP VALUES(0001,'PRABHUDATTA',ADDRESSES
('BANGALORE','KARNATAKA'));
COMMIT;
--SELECT DATA
SELECT EMPNO, ENAME,A.ADDR.ADDRESS1,A.ADDR.ADDRESS2 FROM
EMP A;
| Is This Answer Correct ? | 3 Yes | 1 No |
Post New Answer View All Answers
What privilege is needed for a user to create indexes in oracle?
What is the difference between formal parameters and actual parameters?
I have a parent program and a child program. I want to write a statement in Exception Block of the parent program so that when the statement in the exception block is executed, the control goes to the next statement in the parent block bypassing the child block.How do i do that?
How to insert multiple rows with one insert statement in oracle?
What is a directory object?
State the various uses of dbcc command?
How to best split csv strings in oracle 9i?
Can a parameter be passed to a cursor?
What is an oracle table?
how to code performance tuning of oracle PL/SQL? can any body send me the perfect answer?
What is a named program unit?
How would you begin to troubleshoot an ORA-3113 error?
what is the difference between data migration and production migration.
How many types of cluster table in Oracle?
What is an Oracle Instance?