help with pgxml_xpath

Поиск
Список
Период
Сортировка
От Jeff MacDonald
Тема help with pgxml_xpath
Дата
Msg-id HJEPJELDKPJEEIIFNLNHEEDOCAAA.jeff@interchange.ca
обсуждение исходный текст
Список pgsql-general
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.


В списке pgsql-general по дате отправления:

Предыдущее
От: "Nigel J. Andrews"
Дата:
Сообщение: Re: referential integrity violation
Следующее
От: darthxiong@libero.it
Дата:
Сообщение: plpgsql and escape