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 ? asked 22 May '13, 08:38 Jaak Thijs Mark Culp |
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; answered 22 May '13, 09:03 Mark Culp It works. Thanks !
(22 May '13, 09:27)
Jaak Thijs
|