1

Topic: Number conversion in json

Oracle 12.2
Number conversion in json

select json_object (key ' x1 ' value 0.0133, key ' x2 ' value 0.133) from dual t

Let's transform as today it would be desirable more, where the leader 0 got to?

{"x1":.0133, "x2":0.133}

Clearly that is possible to_char, but same it is wrong...

2

Re: Number conversion in json

To itself spiteful  - who drags acquired  in  earlier than through pair-triple major versions?
It while even own syntax do not withstand:

SQL> select banner from v$version;
BANNER
----------
Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production
SQL> select json_object (' x1 ' is 0.0133) jo from dual t;
JO
--
{"x1":.0133}
SQL> select json_object (' x1 ' value ' 0.0133 ' format JSON) jo from dual t;
JO
--
{"x1": 0.0133}
SQL> select json_object (' x1 ' value 0.0133 format JSON) jo from dual t;
==> ORA-00932: inconsistent datatypes: expected CHAR got NUMBER

3

Re: Number conversion in json

You are far from the people, therefore and comments are not present...

4

Re: Number conversion in json

Yes, for some reason returns in LAX a format. I inscribed FORMAT JSON STRICT, but exchanged nothing. Wrote to the dude from  which is engaged in it. We will wait.

5

Re: Number conversion in json

Vint, there is a tablet: Patch 27486853: MERGE REQUEST ON TOP OF 12.2.0.1.0 FOR BUGS 27450783 27459909

6

Re: Number conversion in json

Shtock;
Thanks, delivered - works. Only a tablet for Linuha. For Windows is not present and not  smile

7

Re: Number conversion in json

Use force of belief, the Manhole!

8

Re: Number conversion in json

andrey_anonymous wrote:

SQL> select json_object (' x1 ' value 0.0133 format JSON) jo from dual t;
==> ORA-00932: inconsistent datatypes: expected CHAR got NUMBER

I do not understand, what for here "format JSON"?

9

Re: Number conversion in json

[quote = - Eugene-] what for here "format JSON"?

We honor to dock:

wrote:

FORMAT JSON
This clause is optional and is provided for semantic clarity .