Re: [SQL] xmlelement name

2013-03-12 Thread Pavel Stehule
Hello 2013/3/12 Ben Morgan : > Hi, > > I'm trying to write a function that will take a name as a text value, > and return an XML element with that name as name, like so: > > create function xpercent(nam text, val int) returns xml as $$ > begin > return ( select xmlelement(name nam, con

[SQL] xmlelement name

2013-03-12 Thread Ben Morgan
Hi, I'm trying to write a function that will take a name as a text value, and return an XML element with that name as name, like so: create function xpercent(nam text, val int) returns xml as $$ begin return ( select xmlelement(name nam, concat(val::text, '%')) ); end; $$ language