0

I am having a hard time getting an output from a table.

Here is the table creation

CREATE OR REPLACE TYPE FULL_MAILING_ADDRESS AS OBJECT 
( STREET VARCHAR2(80),
  CITY   VARCHAR2(80),
  STATE  CHAR(2),
  ZIP    VARCHAR2(10));

CREATE TABLE CUSTOMER 
     (
        FULL_ADDRESS    FULL_MAILING_ADDRESS
     );

  INSERT INTO CUSTOMER  VALUES (FULL_MAILING_ADDRESS('55 SOUTH','ARLINGTON','VA','2222'));

when I do select on the table I don't get the values instead I get

[ORACLE.FULL_MAILING_ADDRESS]
William Robertson
  • 15,273
  • 4
  • 38
  • 44
tita
  • 107
  • 1
  • 5
  • What do you like to get instead? – Wernfried Domscheit Jan 25 '18 at 15:51
  • 4
    `select * ...` depends on client application you use, but You can simply quote columns you want to see: `select c.full_address.street, c.full_address.city from customer c`. – Ponder Stibbons Jan 25 '18 at 16:06
  • 3
    By the way, I know I'm always on about this but [`CHAR` isn't as useful as you think it is](https://stackoverflow.com/a/42165653/230471). You should use `VARCHAR2` for all string columns unless they need to be `CLOB`. – William Robertson Jan 25 '18 at 16:12
  • How do i display all the values without specifying a specific one? I was to fetch everything from the table. – tita Jan 25 '18 at 16:27
  • Another possibility is `select XMLTYPE(FULL_ADDRESS) from customer` – Wernfried Domscheit Jan 25 '18 at 16:30
  • As @PonderStibbons mentioned, the behavior of `select *` will depend on your IDE. If it isn't doing what you want with the object type column, then you can switch to another. If switching to another IDE isn't an option, then you need to list all the fields which you want to see by name in you select list.. – Chris Hep Jan 25 '18 at 16:54

0 Answers0