Jump to content

Filter XML SQL query result


DEV T

Recommended Posts

I have an XML column:

 

<xmlList> <XMLEntity> <sug>ACHR</sug></XMLEntity><XMLEntity> <sug>DOA</sug></XMLEntity></xmlList>

 

The sug can hold only a enum memeber(ACHER or DOA). I would like to check if there is a sug without one of these values.

In this way I get the sug node where they are not from enum values:

 

SELECT XMLSERIALIZE(XMLQUERY ('//xmlList/XMLEntity/sug[.!=ACHER" and .!="DOA]'passing KTOVET ) as char large object) as XXXFROM "TABLE"

 

The result is OK, but wherever the sug is ACHER or DOA I get empty line. How can I avoid the empty lines from result?

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...