cancel
Showing results for 
Search instead for 
Did you mean: 

BYTE ORDER MARK OFF

Former Member
2,920

I want to use the option 'byte order mark off' in an openxml-query.

example :

select * from openxml(test_xml,'//*')
with (T_ID bigint '@mp:id')
option (byte order mark off)

syntax-error near 'order'

I use sql anywhere 12.0.1 (3840)

What is the correct syntax ?

Accepted Solutions (0)

Answers (1)

Answers (1)

MarkCulp
Participant

According to the 12.0.1 documentation for openxml() you need to use Syntax 2 if you want to specify an OPTION clause and therefore you need to preface your test_xml value with either USING FILE or USING VALUE. In my tests I have verified that without the USING FILE or USING VALUE I get the same syntax error but after adding a prefix I no longer do.

You also need to give a name to your derived table which is created using openxml().

So assuming your variable test_xml has your XML data then try:

select * 
  from openxml( USING VALUE test_xml, '//*' )
          with ( T_ID bigint '@mp:id' )
        option ( byte order mark off )
            as dt;
Former Member
0 Kudos

It works. Thanks !