Обсуждение: help with pgxml_xpath

Поиск
Список
Период
Сортировка

help with pgxml_xpath

От
"Jeff MacDonald"
Дата:
Hi,

I have a table where a typical query looks like this.

cfm=> SELECT loginid,userdata FROM urdr_users where id = 110;
 loginid |                  userdata
---------+---------------------------------------------
 110     | <opt dob="1900-01-01" dft_entityid="74" />

I need to extract the dft_entityid from the xml, i've done this.

cfm=> SELECT loginid,pgxml_xpath(userdata,'//@dft_entityid/','','') FROM
urdr_users where id = 110;
 loginid |    pgxml_xpath
---------+--------------------
 110     |  dft_entityid="74"

That is as close as i can get.. I'd like to be able to extract just the 74.

Any help would be greatly appreciated.

Thanks.

Jeff.