Re: xpath

Поиск
Список
Период
Сортировка
От Otandeka Simon Peter
Тема Re: xpath
Дата
Msg-id efc321cd1002100034v1682c10dubd9c5056243c41fc@mail.gmail.com
обсуждение исходный текст
Ответ на xpath  (Allan Kamau <kamauallan@gmail.com>)
Ответы Re: xpath  (Allan Kamau <kamauallan@gmail.com>)
Re: xpath  (Allan Kamau <kamauallan@gmail.com>)
Список pgsql-general
Allan,

Postgres is very strict on variable types and char conversion.  I have a feeling you are trying to access data from a varchar feild using an integer...

Can you paste here your schema for that table?

P.

On Wed, Feb 10, 2010 at 11:06 AM, Allan Kamau <kamauallan@gmail.com> wrote:
Hi,
I am running postgreSQL-8.4.2. I have a table that stores a single xml
document per row in one of it's fields. I would like to use xpath to
retrieve portions of these xml documents.
Is there a way to do so. (I am running postgreSQL 8.4.2 configured
(built) with --with-libxml and --with-libxslt options)

I have looked at 'xpath' but I am unable to get it work for table fields.

The command below works.
SELECT xpath('/doc/name/@first','<doc><name first="David"
last="Marston"/>...</doc>');

The command below seems not to execute successfully
SELECT a.id,xpath('/doc/name/@first',a.xml_payload) FROM
staging.simple_table a WHERE a.id=1;

HINT:  No function matches the given name and argument types. You
might need to add explicit type casts.


Allan.

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

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

Предыдущее
От: "Davor J."
Дата:
Сообщение: Re: R: One column to multiple columns based on constraints?
Следующее
От: Carsten Kropf
Дата:
Сообщение: Extending SQL in C using VARIABLE length type