Using XMLNAMESPACES with XMLEMENT - Mailing list pgsql-general

From Garfield Lewis
Subject Using XMLNAMESPACES with XMLEMENT
Date
Msg-id 64818D06-4BD8-4D81-9C23-6BD392B85E20@lzlabs.com
Whole thread Raw
Responses Re: Using XMLNAMESPACES with XMLEMENT
Re: Using XMLNAMESPACES with XMLEMENT
List pgsql-general

Hi All,

 

I am attempting to port the following statement from DB2z to Postgres:

 

SELECT e.empno, e.firstnme, e.lastname,

          XMLELEMENT ( NAME "foo:Emp",

            XMLNAMESPACES('http://www.foo.com' AS "foo"),

            XMLATTRIBUTES(e.empno as "serial"),

                          e.firstnme,

                          e.lastname ) AS "Result"

       FROM EMP e

       WHERE e.edlevel = 12;

 

The NAMESPACES function is not supported by Postgres in the XMLELEMENT function. Is there any way to get this to work? I’ve looked at the WITH syntax but it doesn’t look like that will be helpful here.

 

Regards,

Garfield

pgsql-general by date:

Previous
From: Israel Brewster
Date:
Subject: Re: Faster distinct query?
Next
From: Rob Sargent
Date:
Subject: Re: Using XMLNAMESPACES with XMLEMENT