Home » SQL & PL/SQL » Client Tools » Insert XML with > (Oracle 11)
Insert XML with > [message #549273] Thu, 29 March 2012 06:30 Go to next message
aucrun
Messages: 114
Registered: February 2011
Senior Member
Hi,

I'm trying to insert an XML into an XMLType with the following value:

insert into Table1(
code, xmlColumn) VALUES 
(1, '<script> &gt; </script>');


the question is I need to have &gt; in the text, but Oracle insists in putting it like <script> > </script>.
What do I have to do to solve this?

Thanks!
Re: Insert XML with &gt; [message #549275 is a reply to message #549273] Thu, 29 March 2012 06:36 Go to previous messageGo to next message
muralikri
Messages: 638
Registered: August 2011
Location: chennai
Senior Member

i tried like.. it's working for me.

 set define off;
insert into po_xml_tab VALUES (1, '<script> &gt; </script>');
Re: Insert XML with &gt; [message #549276 is a reply to message #549275] Thu, 29 March 2012 06:37 Go to previous messageGo to next message
aucrun
Messages: 114
Registered: February 2011
Senior Member
I've tried, but it doesn't work ...

It returns me, allways the same result:
<script> > </script>
Re: Insert XML with &gt; [message #549278 is a reply to message #549276] Thu, 29 March 2012 06:46 Go to previous messageGo to next message
muralikri
Messages: 638
Registered: August 2011
Location: chennai
Senior Member

Check now..

SQL> set define off;

SQL> insert into hpgl.soln_po_xml_tab VALUES (1, '<script> &gt; </script>');

1 row created.

SQL> commit;

Commit complete.

SQL> select * from hpgl.soln_po_xml_tab;
      POID
----------
PODOC
-----------------------------
         1
<script>&gt; </script>
Re: Insert XML with &gt; [message #549281 is a reply to message #549276] Thu, 29 March 2012 06:52 Go to previous messageGo to next message
Michel Cadot
Messages: 65389
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
What is your client tool (name and version), the one you do the insert.

Regards
Michel
Re: Insert XML with &gt; [message #549283 is a reply to message #549281] Thu, 29 March 2012 06:54 Go to previous messageGo to next message
aucrun
Messages: 114
Registered: February 2011
Senior Member
Within SQL Plus it works fine ... and when I make the SELECT to the table it returns me the corrrect value: '<script> &gt; </script>'

But when I get to SQL Developer it returns me '<script> > </script>'

I don't understand, What is happening? Do I have '<script> &gt; </script>' or '<script> > </script>' at that column?
Re: Insert XML with &gt; [message #549285 is a reply to message #549281] Thu, 29 March 2012 06:54 Go to previous messageGo to next message
aucrun
Messages: 114
Registered: February 2011
Senior Member
Michel Cadot wrote on Thu, 29 March 2012 06:52
What is your client tool (name and version), the one you do the insert.

Regards
Michel


I am trying to use SQL Developer 3.0.04

[Updated on: Thu, 29 March 2012 06:55]

Report message to a moderator

Re: Insert XML with &gt; [message #549288 is a reply to message #549285] Thu, 29 March 2012 06:58 Go to previous messageGo to next message
Michel Cadot
Messages: 65389
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
So I move the question to the Client Tool forum as it is not a SQL issue but seems to be a SQL Developer one.

Regards
Michel
Re: Insert XML with &gt; [message #549290 is a reply to message #549288] Thu, 29 March 2012 07:00 Go to previous messageGo to next message
aucrun
Messages: 114
Registered: February 2011
Senior Member
Ok, thanks!

But can anyone of you explain me this? If the client returns me one value, but the SQL Plus returns me the right one, in which should I believe?

Do I really have the '&gt;' or '>' at that column?
Re: Insert XML with &gt; [message #549299 is a reply to message #549290] Thu, 29 March 2012 07:36 Go to previous messageGo to next message
Michel Cadot
Messages: 65389
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
To answer this question, insert it in SQL Developer and query it from SQL*Plus.
O, tricker one, dump the content of column using DUMP function.

Regards
Michel
Re: Insert XML with &gt; [message #549306 is a reply to message #549299] Thu, 29 March 2012 07:51 Go to previous messageGo to next message
aucrun
Messages: 114
Registered: February 2011
Senior Member
Michel Cadot wrote on Thu, 29 March 2012 07:36
To answer this question, insert it in SQL Developer and query it from SQL*Plus.
O, tricker one, dump the content of column using DUMP function.

Regards
Michel


It works fine, but shows me the wrong value with SQL Developer.

Lets take a look at what I've done:
1- Inserted the value using SQL Developer
2- Selecting the value from SQL Developer returns me: '<script> > </scrip>'
3- Selecting the value from SQL Plus returns me: '<script> &gt; </script>'

So, what may be the conclusions?

Thanks!
Re: Insert XML with &gt; [message #549320 is a reply to message #549306] Thu, 29 March 2012 08:40 Go to previous messageGo to next message
Michel Cadot
Messages: 65389
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
The conclusion is there is a bug in SQL Developer.

Regards
Michel
Re: Insert XML with &gt; [message #549404 is a reply to message #549320] Fri, 30 March 2012 05:15 Go to previous messageGo to next message
aucrun
Messages: 114
Registered: February 2011
Senior Member
I find it awkward.

The &lt; and &amp; values are inserted correctly and displayed correctly under SQL Developer... only the &gt; is not!

Strange.

Thanks to all!
Re: Insert XML with &gt; [message #549405 is a reply to message #549404] Fri, 30 March 2012 05:23 Go to previous messageGo to next message
cookiemonster
Messages: 13017
Registered: September 2008
Location: Rainy Manchester
Senior Member
I suugest you download the latest version (3.1.07.42 by the looks of it) and see if that fixes the problem.
Re: Insert XML with &gt; [message #549406 is a reply to message #549405] Fri, 30 March 2012 05:41 Go to previous messageGo to next message
aucrun
Messages: 114
Registered: February 2011
Senior Member
Thanks for the suggestion.
I've installed the new version of SQL Developer and had run the same Insert.

The result was the same... the visualization in SQL Developer gets me the same '<script> > </script>'

If I insert, for instance '<script> &lt; &gt; </script>' it shows me '<script> &lt; > </script>' when I make an select onto that record.

Strange!
Re: Insert XML with &gt; [message #549407 is a reply to message #549406] Fri, 30 March 2012 05:41 Go to previous message
cookiemonster
Messages: 13017
Registered: September 2008
Location: Rainy Manchester
Senior Member
Then I suggest you raise it as a bug with oracle.
Previous Topic: display clob column in text file in sqlplus
Next Topic: pl/sql developer showing access violation at address 67614564 in module 'ORA-805.dll' (merged 2)
Goto Forum:
  


Current Time: Sun Feb 25 14:22:29 CST 2018

Total time taken to generate the page: 0.01506 seconds