Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <procedure name="AddKonturAnalitics">
- <mappings>
- <hibernate-mapping xmlns="urn:nhibernate-mapping-2.2">
- <sql-query name="ExecAddKonturAnalitics">
- exec AddKonturAnalitics @xml=:xml, @analiticsUid=:analiticsUid
- </sql-query>
- </hibernate-mapping>
- </mappings>
- <text>
- <![CDATA[
- create procedure [dbo].[AddKonturAnalitics] (@xml varchar(max), @analiticsUid uniqueidentifier)
- as
- BEGIN
- DECLARE @handle INT
- DECLARE @PrepareXmlStatus INT
- DECLARE @inn varchar(250)
- DECLARE @ogrn varchar(250)
- DECLARE @focusHref varchar(max)
- DECLARE @q1001 bigint
- EXEC @PrepareXmlStatus= sp_xml_preparedocument @handle OUTPUT, @XML
- DECLARE MY_CURSOR CURSOR
- LOCAL STATIC READ_ONLY FORWARD_ONLY
- FOR
- SELECT
- inn as INN,
- ogrn as OGRN,
- focusHref As FocusHref,
- q1001 as Q1001
- FROM OPENXML(@handle, '/ArrayOfanalytics/analytics/analytics', 2)
- WITH (
- inn varchar(250) '../inn',
- ogrn varchar(250) '../ogrn',
- focusHref varchar(max) '../focusHref',
- q1001 bigint)
- OPEN MY_CURSOR
- FETCH NEXT FROM MY_CURSOR INTO @inn, @ogrn, @focusHref, @q1001
- WHILE @@FETCH_STATUS = 0
- BEGIN
- exec [CreateAnaliticsRequest] @inn, @ogrn, @focusHref, @q1001
- FETCH NEXT FROM MY_CURSOR INTO @inn, @ogrn, @focusHref, @q1001
- END
- CLOSE MY_CURSOR
- DEALLOCATE MY_CURSOR
- EXEC sp_xml_removedocument @handle
- END
- ]]>
- </text>
- </procedure>
- ------
- <ArrayOfanalytics xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
- <analytics>
- <inn>9901000362</inn>
- <ogrn>1029900507372</ogrn>
- <focusHref>https://focus.kontur.ru/entity?query=1029900507372</focusHref>
- <analytics>
- <q1001>42</q1001>
- </analytics>
- </analytics>
- </ArrayOfanalytics>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement