cancel
Showing results for 
Search instead for 
Did you mean: 

B1if 2.0 Call SQL with multiple queries

alexander_nosov
Explorer
0 Kudos
860

Hi experts!

I've got the following problem, that I cannot solve. I have to execute multiple SQL queries at once in a B1if 2.0 scenario step. According to the documentation I've created the XML structure with the query:

<Envelope xmlns="urn:com.sap.b1i.adapter:jdbcadapter">
        <Body>
            <QueryStatement blockExecution="true" delimiter=";" throwException="false" compatibilityMode="false">
select top 1 CardCode from OCRD
; select top 1 ItemCode from OITM
            </QueryStatement>
        </Body>
    </Envelope>

And I have the Adapter Call of the type JDBC in my step, where I set the XPath Expression as /vpf:Msg/vpf:Body/vpf:Payload[@id='xxx']/jdbc:Envelope.

Here are the results of the call:

<Payload Role="C" id="TestSql">
  <Envelope xmlns="">
    <Body>
      <QueryResult rowCount="1">
        <Row>
          <CardCode>100001</CardCode>
        </Row>
      </QueryResult>
    </Body>
  </Envelope>
</Payload>

whereas I'm expecting two results.

Yes, it works with the SqlStatement (the node must be declared without Envelope/Body), but according to the documentation, it should also be able to execute multiple calls in QueryStatement and in UpdateStatemtent as well.

P.S. I have SBO 9.3 PL 11 and the last B1if.

Accepted Solutions (1)

Accepted Solutions (1)

alexander_nosov
Explorer
0 Kudos

I've ask this question in an SAP Incident and the answer from SAP is: no, it's impossible to run multiple queries within a <QueryStatement> node. They will adjust the documentation accordingly.

Answers (0)