pass XML as an argument and INSERT (key/value pairs) in postgresql

Поиск
Список
Период
Сортировка
От cesitarps
Тема pass XML as an argument and INSERT (key/value pairs) in postgresql
Дата
Msg-id 1310832875860-4594251.post@n5.nabble.com
обсуждение исходный текст
Список pgsql-general
hola amigos encontre este procedimiento pero quisiera pasarlo a postgresql ,
su ayuda sera de mucha importancia porfavor se los agradecere.

¿ como seria en postgresql ....?

create procedure ParseXML (@InputXML xml)
as
begin
    declare @MyTable table (
        id int,
        value int
    )

    insert into @MyTable
        (id, value)
        select Row.id.value('@id','int'), Row.id.value('@value','int')
            from @InputXML.nodes('/Rows/Row') as Row(id)

    select id, value
        from @MyTable
end
go

/* Create the XML Parameter */
declare @XMLParam xml
set @XMLParam = '<Rows>
                     <Row id="1" value="100" />
                     <Row id="2" value="200" />
                     <Row id="3" value="300" />
                 </Rows>'

/* Call the stored procedure with the XML Parameter */
exec ParseXML @InputXML = @XMLParam


--
View this message in context:
http://postgresql.1045698.n5.nabble.com/pass-XML-as-an-argument-and-INSERT-key-value-pairs-in-postgresql-tp4594251p4594251.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.

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

Предыдущее
От: Michael Nolan
Дата:
Сообщение: Re: Slow query with sub-select
Следующее
От: - -
Дата:
Сообщение: Re: Slow query with sub-select