Showing TYPE’d Column Values in SQL Developer

thatjeffsmith SQL Developer 3 Comments

Tell Others About This Story:

Someone on the innerwebs asked how to show the data inside their user defined TYPE’d column in a table when querying it with SQL Developer.

Here’s their code:

CREATE OR REPLACE TYPE ANSCHRIFT_T AS OBJECT (STRASSE CHAR(12), HAUSNR CHAR(3));
 
CREATE TABLE VERTRETER(V_NR NUMBER(4) PRIMARY KEY, ANSCHRIFT ANSCHRIFT_T);
 
INSERT INTO VERTRETER VALUES (1, ANSCHRIFT_T('TESTWEG','14'));
INSERT INTO VERTRETER VALUES (2, ANSCHRIFT_T('BLA BLA WEG', '25'));
 
SELECT V_NR, ANSCHRIFT FROM VERTRETER;

Run the query. Get the results.

Double-click on the Cell to expose the values.

Double-click on the Cell to expose the values.

Or, in the preferences, enable this:

Turn this on.

Turn this on.

Run the query again.

Better? Well, you don't have to double-click on the cell to see the data.

Better? Well, you don’t have to double-click on the cell to see the data.

Tell Others About This Story:

Comments 3

  1. Thanks, that was helpful. I never thought about this feature before, but it comes in handy. And you could do the same with XML – legend… wait for it…. 😉

    1. thatjeffsmith Post
      Author

Leave a Reply

Your email address will not be published. Required fields are marked *