Skip to Main Content

Database Software

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!

updating a node leads to ORA-21500: internal errorcode, arguments: [%s], [%s], [%s], [%s], [%s], [%s

CarstenDDJul 3 2019 — edited Jul 4 2019

Hello,

I am using Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production and try to update a single node in a xml-file. I have a simple example

WITH testdata(xmlfile) AS (

SELECT xmltype(

'<pubDat>

      <bNumber>string</bNumber>

      <fld>string</fld>

      <dbInstance>string</dbInstance>

</pubDat>')

FROM dual)

SELECT XMLQUERY(

    'copy $tmp := .

     modify replace value of node $tmp/pubDat/bNumber with "test"

     return $tmp

    '

PASSING xmlfile RETURNING CONTENT)

FROM testdata

All attempts lead to ORA-21500: internal errorcode, arguments:...

I've tried

...

SELECT XMLQUERY(

    'copy $tmp := $p1

     modify replace value of node $tmp/pubDat/bNumber with $p2

     return $tmp

    '

PASSING xmlfile as "p1",

'test' as "p2"

RETURNING CONTENT)

FROM testdata

...

as well, but the errormessage stays the same. I'm a little bit confused because I don't have a clue what is wrong with this little example.

Thanks a lot in advance for any help.

Regards Carsten

This post has been answered by CarstenDD on Jul 4 2019
Jump to Answer

Comments

mNem

Works for me on 18.3... and https://livesql.oracle.com.

SQL> select banner_full from v$version
  2  /

BANNER_FULL
--------------------------------------------------------------------------------
Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production
Version 18.3.0.0.0

SQL> ed
Wrote file afiedt.buf

  1  WITH testdata(xmlfile) AS
  2  (
  3  SELECT xmltype(
  4  '<pubDat>
  5        <bNumber>string</bNumber>
  6        <fld>string</fld>
  7        <dbInstance>string</dbInstance>
  8  </pubDat>')
  9  FROM dual)
10  SELECT
11  XMLQUERY(
12      'copy $tmp := .
13       modify replace value of node $tmp/pubDat/bNumber with "test"
14       return $tmp
15      '
16  PASSING xmlfile RETURNING CONTENT
17  ) newxml
18* FROM testdata
SQL> /

NEWXML
--------------------------------------------------------------------------------
<pubDat>
  <bNumber>test</bNumber>
  <fld>string</fld>
  <dbInstance>string</dbInstance>
</pubDat>

_jum

Both queries work fine for me too with Oracle Database 12c Standard Edition Release 12.1.0.2.0.

CarstenDD

Hello mNem,

thanks for your test and telling me where you did it. After trying different things I found out that my problem has to do with the usage of SQL-Detective as SQL-tool.

Regards Carsten

CarstenDD

Hello _jum,

thanks for your test and telling me where you did it. After trying different things I found out that my problem has to do with the usage of SQL-Detective as SQL-tool.

Regards Carsten

CarstenDD
Answer

Hello all,

the reason for the error is the usage of SQL-Detective which seems to send some strange data to the Oracle-DB. After using SQL-Developer everythings works fine. Thanks for the tester to give me the idea to change my SQL-Tool.

Regards Carsten

Marked as Answer by CarstenDD · Sep 27 2020
1 - 5

Post Details

Added on Jul 3 2019
5 comments
1,335 views