User 1791
Would it be possible for a section to be added to the db<>fiddle help with the following information?
Tips about handling db<>fiddle quirks when returning abstract datatypes (Oracle):
Examples:
1. SDO_GEOMETRY datatype (returns an empty dataset).
2. MDSYS.ST_GEOMETRY datatype (returns an empty dataset).
3. UDT (returns an empty dataset).
4. VARRAY datatype (returns an empty dataset).
5. Are there any other datatypes that return confusing values?
Possible solutions here: [db<>fiddle](https://dbfiddle.uk/?rdbms=oracle_18&fiddle=5999895bfdd15f52da32a1ffee065f53). *(Bear in mind I'm not an expert. So some of those proposed workarounds might be misguided.)*
**Would something like that be worth doing?**
----------------------------
Related: [Return a value/row when selecting SDO_GEOMETRY](https://topanswers.xyz/databases?q=2008)
Top Answer
User 1791
One alternative option might be to use the Oracle 21c fiddle, instead of 18c, since 21c has the `JSON_OBJECT` function:
select json_object(some_info)
from some_table
| JSON_OBJECT(SOME_INFO) |
| :-------------------------------------- |
| {"SOME_TEXT":"Foobar","SOME_NUMBER":42} |
[ db<>fiddle](https://dbfiddle.uk/markdown?rdbms=oracle_21&fiddle=026683bdbd8056b3ad84575d27f4f240)
That seems to work. Although, not if we specifically need to test in an older version of Oracle.
I borrowed this answer from a related post: [Results with columns using a custom object type are not displayed (Oracle)](https://topanswers.xyz/fiddle?q=2051)
--------------
**Edit:**
The JSON_ARRAY function is also useful:
```
select
json_array((shape).sdo_ordinates returning clob) as str
from
test_table
```
| STR |
| :-------------------------------- |
| [10,20,30,40,50,60] |
| [70,80,90,100] |
| [110,120,130,140,150,160,170,180] |
https://dbfiddle.uk/?rdbms=oracle_21&fiddle=f8793c649cfeac4a20f3eeb02957d874
[Function to convert varray to delimited string](https://community.oracle.com/tech/developers/discussion/comment/16841078/#Comment_16841078)