Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

PL/SQL Object Type to XML with Attribute and Values

Apex_NoobJan 16 2020 — edited Jan 20 2020

Hi,

I have to create XML with too many level of nesting. For that we found creating PL/SQL object type and converting it to xml is convenient and the code is more readable. However we are facing an issue, when we have to generate both value and attribute for a tag.

Example using object I am able to generate below xml:-

1.   <Charge><Amount>200</Amount></Amount>      -----> Amount tag without attribute

create or replace type "Charge" as object("Amount" number);

2.   <Charge><Amount ccy="USD"/> </Charge>         ------> Amount Tag with attribute

create or replace type "Charge" as object("@Amount" number);

However, I am not able to create object to generated below xml

3.  <Charge> <Amount ccy="USD">200</Amount></Charge>

How, to create PL/SQL Object type so that it should be able to generate tag with both attribute and value as in point 3.

Thanks and Regards,

Shijesh

Comments

Isn't the legend in approx_percentile picture incorrect?

Shouldn't it be "Exact | Deterministic | Non-deterministic"?

Dude!

Isn't the legend in approx_percentile picture incorrect?

Shouldn't it be "Exact | Deterministic | Non-deterministic"?

You missed an 'n' in Loooooooooooooooog Names

Hendrik Schmidt

Hello,

for the link: "here's the script" I receive Page Not Found error

Non-deterministic results are around 5x faster than deterministic. And nearly 15x faster than exact results. So if an estimate is all you need, you can save yourself a lot of time using approx_percentile. If you want to check this for yourself, here's the script I used.

Evening,

I'm working on mvc projects using mean stack how can i integrate these projects without using mongodb. take for example using sql server..any tips will be helpful.

Peter Schlaeger

Hallo

I must worn everyone for trusting in Oracle Json Support. I have very very very painfull experiences  with Json in Oracle.

In 12.1 it took more than one year and lots of support calls before I was able to use it without bugs ( including full database crashes ).

And now I test on 12.2 and I am again back at the state  where I was in March 2016. Again the same bugs and the solution still not include in any windows bundle patch.

So I suggest that everyone should carefully test his Oracle Version and Patch level if it is capable of running Json without bugs before you decide to use Json.

blessed DBA

We are going start some project on this JSON So it is more useful for us

martin_olivia

The Oracle Database 12c is a high-performance, enterprise-class database.

1 - 7

Post Details

Added on Jan 16 2020
10 comments
1,319 views