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
XTERMCONTROL(1) 						   User Commands						   XTERMCONTROL(1)

NAME
xtermcontrol - dynamic control of XFree86 xterm properties. SYNOPSIS
xtermcontrol [OPTIONS]... DESCRIPTION
xtermcontrol makes it easy to change colors, title, font and geometry of a running XFree86 xterm(1), as well as to report the current set- tings of the aforementioned properties. Window manipulations de-/iconify, raise/lower, maximize/restore and reset are also supported. To complete the feature set; xtermcontrol lets advanced users issue any xterm control sequence of their choosing. OPTIONS
--fg=COLOR Set foreground color (see also COLOR NAMES). --bg=COLOR Set background color. --colorN=COLOR Set N'th [0-15] color. --highlight=COLOR Set highlight color. --cursor=COLOR Set cursor color. --mouse-fg=COLOR Set mouse pointer foreground color. --mouse-bg=COLOR Set mouse pointer background color. --font=FONT Set font name (see also FONT NAMES). Alternatively it is possible to specify a fontmenu index as '#[0-6]' or navigate the fontmenu by relative sizes as '#+N' or '#-N', where N is an optional integer. --title=STRING Set window title. Note that mechanisms like the bash(1) PROMPT_COMMAND may overwrite the title. --geometry=WIDTHxHEIGHT+XOFF+YOFF Set size and/or position. Through its control sequences the xterm only recognize positive XOFF and YOFF offsets, which are pixels relative to the upper left hand corner of the display. xtermcontrol is therefore unable to handle negative offsets as described in the X(7x) GEOMETRY SPECIFICATIONS and therefore truncates negative values to zero. --get-fg Report foreground color. --get-bg Report background color. --get-colorN Report N'th [0-15] color. --get-highlight Report highlight color. --get-cursor Report cursor color. --get-mouse-fg Report mouse pointer foreground color. --get-mouse-bg Report mouse pointer background color. --get-font Report font. --get-title Report window title. --get-geometry Report size and position. The size of the text area is reported in characters and the position is reported in pixels relative to the upper left hand corner of the display. --maximize Maximize window. --restore Restore maximized window. --iconify Iconify window. --de-iconify De-iconify window. --raise Raise window. --lower Lower window. --reset Full reset. --raw=CTLSEQS Issue raw control sequence (see also XTERM CONTROL SEQUENCES). --file=FILE Force xtermcontrol to read configurations (see also CONFIGURATION) from FILE instead of the standard personal initialization file ~/.xtermcontrol. --force, -f Skip TERM environment variable check. --verbose, -v Print verbose reports. --help, -h Print help message and exit. --version Print the version number and exit. CONFIGURATION
xtermcontrol reads a default, ~/.xtermcontrol, or a user specified configuration file on startup. Each line in the file is either a com- ment or contains an attribute. Attributes consist of a keyword and an associated value: keyword = value # comment The valid keyword/value combinations are: foreground="COLOR" background="COLOR" highlight="COLOR" cursor="COLOR" mouse-foreground="COLOR" mouse-background="COLOR" geometry="WIDTHxHEIGHT+XOFF+YOFF" font="FONT" color0="COLOR" color1="COLOR" color2="COLOR" color3="COLOR" color4="COLOR" color5="COLOR" color6="COLOR" color7="COLOR" color8="COLOR" color9="COLOR" color10="COLOR" color11="COLOR" color12="COLOR" color13="COLOR" color14="COLOR" color15="COLOR" Whitespace is ignored in attributes unless within a quoted value. The character '#' is taken to begin a comment. Each '#' and all remaining characters on that line is ignored. FONT NAMES
xtermcontrol accepts any X(7x) FONT NAMES. Font names like '-adobe-courier-medium-r-normal--10-100-75-75-m-60-iso8859-1' are very cumber- some to write, so it is convenient to make use of aliases, e.g. 'fixed' or '8x13', if present in fonts.alias files of the font directo- ries. COLOR NAMES
xtermcontrol accepts any X(7x) COLOR NAMES. Basically this means that colors are specified by name or rgb value, e.g. 'blue', 'rgb:0000/0000/FFFF' or '#00F'. Colors are typically reported by the xterm in a device-dependent numerical form, e.g. 'rgb:0000/0000/FFFF'. Note that old syntax rgb values should always be quoted to avoid '#' being interpreted as the beginning of a comment by the shell (see also FILES). XTERM CONTROL SEQUENCES
The secret behind xtermcontrol is xterm control sequences. All the possible (there are a plethora of them) control sequences are documented in ctlseqs.txt, found in the xterm(1) distribution (see also FILES). TROUBLESHOOTING
If read/write permissions on the tty's are changed so that special group membership is required to be able to write to the pseudo terminal, the easiest workaround is to install xtermcontrol setuid root. Xterm(1) has three resources, allowWindowOps, allowTitleOps, and allowFontOps, that enables or disables special operations which xtermcon- trol relies on. If any of these resources are set (or defaults) to 'false' xtermcontrol may hang. The resources corresponds to xtermcon- trol options as: allowWindowOps: --raise --lower --restore --maximize --iconify --de-iconify --get-title --geometry --get-geometry allowTitleOps: --title allowFontOps: --font --get-font All three resources can usually be enabled for the current xterm session via a menu; ctrl+rightclick and look for menu item names like 'Allow Window Ops'. To set these resource values persistently you can add the following to either your local ~/.Xdefaults file, or to a system-wide resource file like /etc/X11/app-defaults/XTerm: *VT100.allowWindowOps: true *VT100.allowTitleOps: true *VT100.allowFontOps: true FILES
<XRoot>/X11/rgb.txt Default rgb color name file location. ctlseqs.txt Xterm control sequences documentation. Distributed with xterm from http://dickey.his.com/xterm/ SEE ALSO
xterm(1), X(7x) COPYRIGHT
Copyright (C) 2002-2009 Jess Thrysoee <jess@thrysoee.dk> xtermcontrol 2.10 October 17, 2009 XTERMCONTROL(1)
All times are GMT -4. The time now is 10:49 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy