Sponsored Content
Top Forums UNIX for Advanced & Expert Users Using xml to run db2 commands Post 302821499 by DGPickett on Friday 14th of June 2013 03:12:16 PM
Old 06-14-2013
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! Smilie

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:
Code:
<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?
 

10 More Discussions You Might Find Interesting

1. IP Networking

Run commands on a UNIX with NT

Hi I'm trying to automatically run a command on a UNIX (AIX) machine from a Windows NT 4 machine. I can do this manually using the 'rexec' or 'rsh' command but I need an automatic login (on the AIX). In the manual I've found that there should be a '.rhosts' file on the Unix machine in the... (1 Reply)
Discussion started by: Mark Detrez
1 Replies

2. UNIX for Dummies Questions & Answers

XML Translator to run in UNIX

Hello, newbie (non-techie) here. I'm a business analyst for a software company in the Bay Area. A project I just got assigned to involved researching for an enterprise version of a XML translator that will run on UNIX. I'm looking for something that won't be too costly to purchase as the... (4 Replies)
Discussion started by: Antsy
4 Replies

3. Shell Programming and Scripting

Run SQL queries in DB2 and output to file

Hi, I new to Unix and scripting. Following is my requirement. Can someone tell me whether its possible or not. Also please let me know how to proceed further if this is possible. List of queries are stored in a file. For example, I have to run a query like this: Select * from &XYZ where... (0 Replies)
Discussion started by: simhasuri
0 Replies

4. UNIX for Dummies Questions & Answers

Cannot run commands

It would be helpful if someone could help me out here. The problem I have been having is that I cannot run some commands which are valid - whenever I try to run the command I get the message "command not found". Now, if I run the same command as root it executes. These commands do not have to be... (5 Replies)
Discussion started by: BigTool4u2
5 Replies

5. Shell Programming and Scripting

Run several commands at a time

Hello guys, I am new at shell scripting and I want to create a script that runs several commands at a time, ie: uptime, w, df -h and so on and send the output of this commands to a text file so it can be send via email at a certain time using crontab. Any help will be much appreciated! (4 Replies)
Discussion started by: agasamapetilon
4 Replies

6. Shell Programming and Scripting

Run a shell script from one host which connext to remote host and run the commands

I want to write a script which would run from one host say A and connect to other remote host B and then run rest of commands in that host. I tried connecting from A host to B with SSH but after connecting to host B it just getting me inside Host B command prompt. Rest of the script is not running... (6 Replies)
Discussion started by: SN2009
6 Replies

7. Shell Programming and Scripting

Run DB2 export command in loop

Hi All, I have list of 100 table names in a file, how to read table name from and pass to DB2 export command and run for all tables in loop. Please help me with script. db2 EXPORT TO ~/data_export/<table name from file>.ixf OF IXF MESSAGES messages.txt "SELECT * FROM ITG.<Table Name... (4 Replies)
Discussion started by: srimitta
4 Replies

8. Shell Programming and Scripting

Assigning value of a select count(*) from tablename ( run on db2 ) to a unix variable

Hi All, I have browsed through the forums for a similar topic, but there is no topic which explains about this problem, when the backend is DB2. I want to assign the output of a select count(*) from tablename to a unix variable in a shell script. I am using ksh. The database used to... (3 Replies)
Discussion started by: Siddarth
3 Replies

9. UNIX for Dummies Questions & Answers

Run multiple commands

Hi All, Is it possible to run second/multiple commands at a time in script before the completion/return of first command? Pls reply. (5 Replies)
Discussion started by: cns1710
5 Replies

10. Shell Programming and Scripting

Problem running db2 commands in awk

Hi , I am trying to use the below in awk but failed, any one assist please, awk '{ print $0; if ( $0 ~ /LOADTMP1/ ) { print $4; Table_name=system($( db2 -x "SELECT TRIM(TD.BSCHEMA) || '.' || TRIM(TD.BNAME) AS TABLE_NAME FROM SYSCAT.TABDEP TD WHERE TD.BTYPE='T' AND... (2 Replies)
Discussion started by: Nandy
2 Replies
set_color(1)							       fish							      set_color(1)

NAME
set_color - set_color - set the terminal color set_color - set the terminal color Synopsis set_color [-v --version] [-h --help] [-b --background COLOR] [COLOR] Description Change the foreground and/or background color of the terminal. COLOR is one of black, red, green, brown, yellow, blue, magenta, purple, cyan, white and normal. o -b, --background Set the background color o -c, --print-colors Prints a list of all valid color names o -h, --help Display help message and exit o -o, --bold Set bold or extra bright mode o -u, --underline Set underlined mode o -v, --version Display version and exit Calling set_color normal will set the terminal color to whatever is the default color of the terminal. Some terminals use the --bold escape sequence to switch to a brighter color set. On such terminals, set_color white will result in a grey font color, while set_color --bold white will result in a white font color. Not all terminal emulators support all these features. This is not a bug in set_color but a missing feature in the terminal emulator. set_color uses the terminfo database to look up how to change terminal colors on whatever terminal is in use. Some systems have old and incomplete terminfo databases, and may lack color information for terminals that support it. Download and install the latest version of ncurses and recompile fish against it in order to fix this issue. Version 1.23.1 Sun Jan 8 2012 set_color(1)
All times are GMT -4. The time now is 05:36 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy