Using xml to run db2 commands

Hi,

Strange problem I'm having here and not sure what to do.

I have here a xml that is supposed to execute the next value in the schema but it isn't do the job it's supposed to do. I'm not a dba or a developer so I'm sorry in advance if there are some things i don't understand.
when we run the command manually in db2 it works.

Here is the code for anyone who can help:

<SOAP-ENV:Envelope xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope">
<SOAP-ENV:Body>
<SQLPassthroughExecute userDomain="<DOMAIN>" userID="<UID>" workstationID="<WORKGROUP">
<SQLConnection xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <ID> <DBID> </ID> 
  <Name> <NAME> </Name> 
  <DriverClass>com.ibm.db2.jcc.DB2Driver</DriverClass> 
  <ConnectionURL>V7i6tNnSwrET9apffKem0fev2DgS5IaQHf2sjrmhkEFf9xaOUPiJ92gO3Rfw2F247ZToTwILWEKZPlmDSTp2t9V9dlBoGStOJxXiWVFXiezq6Ar7hauFWbx9JkbZFnlU</ConnectionURL> 
  <Password> <USERPASSWORD> </Password> 
  <Username><uid></Username> 
  </SQLConnection>
  <Statements>insert into <SCHEMA.VALUE> (ID1, ID2, ID3, ID3, ID4, ID5, ID6, ID7, ID8, ID9) VALUES (NEXT VALUE FOR <SCHEMA>.STRESS, 1349, 11, 141, 0.1, 1089, '', '<USERNAME>', CURRENT_TIMESTAMP, 0)</Statements> 
  <StatementDelimiter>|</StatementDelimiter> 
  <Transaction>true</Transaction> 
  <ContinueOnError>false</ContinueOnError> 
  </SQLPassthroughExecute>
  </SOAP-ENV:Body>
  </SOAP-ENV:Envelope>

XML is just (structured) data. It doesn't run anything.

What application are you using to process this XML file?

A new vendor had given us a java application to stress test our server and from what they explained these xml's are supposed to insert into the tables. We modified one line to use the next available line.

not sure if that helps.

Not at all. All that you have told us is that you have an XML file that you modified such that it no longer works correctly (if it ever did) when it is processed by code written in Java that you obtained from a 3rd party.

I could make a wild guess that the text marked in red below (and the spaces surrounding them) needs to be replaced by data appropriate to your environment, but with what have provided, all we can do is make wild guesses:

<SOAP-ENV:Envelope xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope">
<SOAP-ENV:Body>
<SQLPassthroughExecute userDomain="<DOMAIN>" userID="<UID>" workstationID="<WORKGROUP">
<SQLConnection xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <ID> <DBID> </ID> 
  <Name> <NAME> </Name> 
  <DriverClass>com.ibm.db2.jcc.DB2Driver</DriverClass> 
  <ConnectionURL>V7i6tNnSwrET9apffKem0fev2DgS5IaQHf2sjrmhkEFf9xaOUPiJ92gO3Rfw2F247ZToTwILWEKZPlmDSTp2t9V9dlBoGStOJxXiWVFXiezq6Ar7hauFWbx9JkbZFnlU</ConnectionURL> 
  <Password> <USERPASSWORD> </Password> 
  <Username><uid></Username> 
  </SQLConnection>
  <Statements>insert into <SCHEMA.VALUE> (ID1, ID2, ID3, ID3, ID4, ID5, ID6, ID7, ID8, ID9) VALUES (NEXT VALUE FOR <SCHEMA>.STRESS, 1349, 11, 141, 0.1, 1089, '', '<USERNAME>', CURRENT_TIMESTAMP, 0)</Statements> 
  <StatementDelimiter>|</StatementDelimiter> 
  <Transaction>true</Transaction> 
  <ContinueOnError>false</ContinueOnError> 
  </SQLPassthroughExecute>
  </SOAP-ENV:Body>
  </SOAP-ENV:Envelope>

Maybe someone who knows what SOAP means in this context will be able to help you.

thank you. those fields in red have been filled out, I just removed them for confidential reasons.

Sorry I'm not entirely sure how to put it in better words. I've actually never done anything like this before, I'm a sys admin but Trying to help out the team working on this.

Looks like std IBM SOAP: DB2 Database for Linux, UNIX, and Windows

It is unfortunate you used <vvv> form for removed values, since it resembles XML. It is good for man pages, which are older! :smiley:

Typo'd, too. I put in obvious replacement my_* in lower case. The XML seems balanced and all that. I indented it for depth of wrapper elements:

<SOAP-ENV:Envelope xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope">
<SOAP-ENV:Body>
  <SQLPassthroughExecute userDomain="my_domain" userID="my_uid" workstationID="my_workgroup">
    <SQLConnection xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
      <ID>my_dbid</ID> 
      <Name>my_name</Name> 
      <DriverClass>com.ibm.db2.jcc.DB2Driver</DriverClass> 
      <ConnectionURL>V7i6tNnSwrET9apffKem0fev2DgS5IaQHf2sjrmhkEFf9xaOUPiJ92gO3Rfw2F247ZToTwILWEKZPlmDSTp2t9V9dlBoGStOJxXiWVFXiezq6Ar7hauFWbx9JkbZFnlU</ConnectionURL> 
      <Password>my_passwd</Password> 
      <Username>my_username</Username> 
     </SQLConnection>
    <Statements>insert into my_schema.my_table (ID1, ID2, ID3, ID3, ID4, ID5, ID6, ID7, ID8, ID9) VALUES (NEXT VALUE FOR my_schema.STRESS, 1349, 11, 141, 0.1, 1089, '', 'my_username', CURRENT_TIMESTAMP, 0)</Statements> 
    <StatementDelimiter>|</StatementDelimiter> 
    <Transaction>true</Transaction> 
    <ContinueOnError>false</ContinueOnError> 
   </SQLPassthroughExecute>
 </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

PS: Single inserts are atomic, so a transaction is a waste. Does the insert work on the command line 'db2' with these credentials?