on 2013 May 22 9:38 AM
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 ?
Request clarification before answering.
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;
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
54 | |
6 | |
6 | |
5 | |
5 | |
5 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.