Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SQL Developer doesn't display XML

Oracle's SQL Developer doesn't display the content of XML columns when the datatype XMLType is used. The first lines are displayed ok (if Preferences > Database > Advanced > Display XML Value in Grid is ticked), but once you doubleclick on the little yellow pencil, the "View Value" window remains empty. Curiously, it works if you store the XML in a clob.

CREATE TABLE t (x XMLTYPE, c CLOB);
INSERT INTO t VALUES (XMLTYPE('<x/>'), '<x/>');
COMMIT;
SELECT * FROM t;

empty view value in Oracle 18.1

After a lot of internet search, I found a post by thatJeffSmith saying that it's a known bug and will be fixed soon. And yes, it is working again from version 19.1 onwards. However, at work we are stuck with version 18.2 for a while. So, is there a workaround in 18?

Version    XML View Value
17.3.0.271 ok
17.4.0.355 ok
18.1.0.095 empty
18.2.0.183 empty
19.1.0.094 ok
19.2.1.247 ok
19.4.0.354 ok (but needs modern JDK)

This is how it looks in 19.1:

view values is ok in 19.1

Secondly, I couldn't find a list of bugs for SQL Developer, or a list of fixed bugs, or old release notes. Currently, Oracle's download page lists only the latest three releases 19.1, 19.2 and 19.4, so it's impossilbe to find out when this bug was fixed.

like image 504
wolφi Avatar asked May 15 '20 20:05

wolφi


People also ask

Why SQL Developer is not showing tables?

The answer is simple – you can't see any tables, because you don't OWN any tables.

How do I enable schema browser in SQL Developer?

Schema Browser – Scan the database To open, right-click on the connection name and select Schema Browser. It also helps to browse through other schemas based on the permissions granted in the database.


1 Answers

The proper solution is an upgrade to version 19 (or theoretically downgrade to 17).

If you are stuck in Version 18, there is a workaround:

SELECT t.x.getClobVal() FROM t t;

For some strange reason, the table alias is required.

like image 55
wolφi Avatar answered Nov 15 '22 07:11

wolφi