Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/opencv/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Sql 那么…我不明白你是怎么把它定义为基于集合的操作的。基于集合的操作处理数据检索和聚合,而不是转换。在绝大多数情况下,将此逻辑推入数据库是不合适的,因为转换应该在持久层的上下文之外进行。这让我想到层次嵌套的XML,它具有更复杂的多表数据源。。。 <GPA_Sql_Xml - Fatal编程技术网

Sql 那么…我不明白你是怎么把它定义为基于集合的操作的。基于集合的操作处理数据检索和聚合,而不是转换。在绝大多数情况下,将此逻辑推入数据库是不合适的,因为转换应该在持久层的上下文之外进行。这让我想到层次嵌套的XML,它具有更复杂的多表数据源。。。 <GPA

Sql 那么…我不明白你是怎么把它定义为基于集合的操作的。基于集合的操作处理数据检索和聚合,而不是转换。在绝大多数情况下,将此逻辑推入数据库是不合适的,因为转换应该在持久层的上下文之外进行。这让我想到层次嵌套的XML,它具有更复杂的多表数据源。。。 <GPA,sql,xml,Sql,Xml,那么…我不明白你是怎么把它定义为基于集合的操作的。基于集合的操作处理数据检索和聚合,而不是转换。在绝大多数情况下,将此逻辑推入数据库是不合适的,因为转换应该在持久层的上下文之外进行。这让我想到层次嵌套的XML,它具有更复杂的多表数据源。。。 <GPAutoActions> <createDispute> <transaction> <defaultKey> <custNo>10000000-AD</cus


那么…我不明白你是怎么把它定义为基于集合的操作的。基于集合的操作处理数据检索和聚合,而不是转换。在绝大多数情况下,将此逻辑推入数据库是不合适的,因为转换应该在持久层的上下文之外进行。这让我想到层次嵌套的XML,它具有更复杂的多表数据源。。。
<GPAutoActions>
 <createDispute>
  <transaction>
    <defaultKey>
      <custNo>10000000-AD</custNo>
      <invNo>28893848</invNo>
    </defaultKey>
  </transaction>
  <reason>405</reason>
  <amount>185.17</amount>  
  <pnote>Notes</pnote>
  <owner>LARRYGIST</owner>
 </createDispute>
</GPAutoActions>
custno          invno    reason amount  pnote   owner
117455521-AD    28894882    405 972.04  Note    LARRYGIST
128623268-AD    28887277    405 182.99  Note    LARRYGIST
131537715-AD    28893848    405 185.17  Note    LARRYGIST
189063783-AD    28927273    405 777.49  Note    LARRYGIST
Select 1 as TAG
, null as parent
, null as 'createDispute!1!'
, null as 'transaction!2!Element'
, null as 'defaultKey!3!'
, null as 'defaultKey!3!custno!Element'
, null as 'defaultKey!3!InvNo!Element'
, null as 'reason!4!'
UNION ALL
Select 2 as Tag
, 1 as Parent
, Null
, NULL
, null
, null
, null
, null
Union ALL
Select 3 as Tag
, 2 as Parent
, Null
, NULL
, null
, custno
, InvNo
, null
FROM [GetPaid_Sandbox].[dbo].[DisputeData]
Union ALL
Select 4 as Tag
, 2 as Parent
, Null
, NULL
, null
, null
, null
, reason
FROM [GetPaid_Sandbox].[dbo].[DisputeData]
for XML EXPLICIT
<createDispute>
  <transaction>
    <defaultKey>
      <custno>117455521-AD</custno>
      <InvNo>28894882</InvNo>
    </defaultKey>
    <defaultKey>
      <custno>128623268-AD</custno>
      <InvNo>28887277</InvNo>
    </defaultKey>
    <defaultKey>
      <custno>131537715-AD</custno>
      <InvNo>28893848</InvNo>
    </defaultKey>
    <defaultKey>
      <custno>189063783-AD</custno>
      <InvNo>28927273</InvNo>
    </defaultKey>
    <reason>405</reason>
    <reason>405</reason>
    <reason>405</reason>
    <reason>405</reason>
  </transaction>
</createDispute>
Select 1 as TAG
, null as parent
, custno + '_' + cast(invno as varchar(50)) as 'createDispute!1!'
, null as 'transaction!2!reason!Element'
, null as 'transaction!2!amount!Element'
, null as 'transaction!2!pnote!Element'
, null as 'transaction!2!owner!Element'
, null as 'defaultKey!3!custno!Element'
, null as 'defaultKey!3!InvNo!Element'
FROM [GetPaid_Sandbox].[dbo].[DisputeData]
UNION ALL
Select 2 as Tag
, 1 as Parent
, custno + '_' + cast(invno as varchar(50))
, reason
, amount
, pnote
, [owner]
, null
, null
FROM [GetPaid_Sandbox].[dbo].[DisputeData]
Union ALL
Select 3 as Tag
, 2 as Parent
, custno + '_' + cast(invno as varchar(50))
, NULL
, NULL
, NULL
, NULL
, custno
, InvNo
FROM [GetPaid_Sandbox].[dbo].[DisputeData]
Union ALL
ORDER BY custno + '_' + cast(invno as varchar(50))
for XML EXPLICIT
SELECT custno AS [transaction/defaultKey/custNo]
      ,invno AS  [transaction/defaultKey/invNo]
      ,reason
      ,amount
      ,pnote
      ,[owner]
FROM @mockup 
WHERE invno=28893848
FOR XML PATH('createDispute'),ROOT('GPAutoActions');
<GPAutoActions>
  <createDispute>
    <transaction>
      <defaultKey>
        <custNo>131537715-AD</custNo>
        <invNo>28893848</invNo>
      </defaultKey>
    </transaction>
    <reason>405</reason>
    <amount>185.1700</amount>
    <pnote>Note</pnote>
    <owner>LARRYGIST</owner>
  </createDispute>
</GPAutoActions>
SELECT outerTable.invno
,(
    SELECT innerTable.custno AS [transaction/defaultKey/custNo]
          ,innerTable.invno AS  [transaction/defaultKey/invNo]
          ,innerTable.reason
          ,innerTable.amount
          ,innerTable.pnote
          ,innerTable.[owner]
    FROM @mockup AS innerTable
    WHERE innerTable.invno=outerTable.invno
    FOR XML PATH('createDispute'),ROOT('GPAutoActions'),TYPE
 )
 FROM @mockup AS outerTable;
<?xml version="1.0"?>
<GPAutoActions>
  <createDispute>
    <transaction>
      <defaultKey xmlns="">
        <custno>117455521-AD</custno>
        <invno>28894882</invno>
      </defaultKey>
    </transaction>
    <reason>405</reason>
    <amount>972.04</amount>
    <pnote>Dispute Reason: Inbound email from John requesting that account be cancelled, providing letter of cancellation. Attachments: Yes</pnote>
    <owner>LARRYGIST</owner>
  </createDispute>
  <createDispute>
    <transaction>
      <defaultKey xmlns="">
        <custno>128623268-AD</custno>
        <invno>28887277</invno>
      </defaultKey>
    </transaction>
    <reason>405</reason>
    <amount>182.99</amount>
    <pnote>Dispute Reason: Inbound email from Catherine requesting cancelation of services. Attachments: Yes</pnote>
    <owner>LARRYGIST</owner>
  </createDispute>
  <createDispute>
    <transaction>
      <defaultKey xmlns="">
        <custno>131537715-AD</custno>
        <invno>28893848</invno>
      </defaultKey>
    </transaction>
    <reason>405</reason>
    <amount>185.17</amount>
    <pnote>Dispute Reason: Syed stated that he canceled his Tyco contract a long time ago. Syad stated that he doesn't have an email address and didn't want to send CR a cancellation notice.  Attachments: No</pnote>
    <owner>LARRYGIST</owner>
  </createDispute>
  <createDispute>
    <transaction>
      <defaultKey xmlns="">
        <custno>189063783-AD</custno>
        <invno>28927273</invno>
      </defaultKey>
    </transaction>
    <reason>405</reason>
    <amount>777.49</amount>
    <pnote>Dispute Reason: Spoke to Grant stated moved out of building on 12 01 2017. Stated company that bought building decided not to go with Tyco and Tyco came and picked up the equipment. Attachments: No</pnote>
    <owner>LARRYGIST</owner>
  </createDispute>
</GPAutoActions>