Sponsored Content
Top Forums UNIX for Advanced & Expert Users Using xml to run db2 commands Post 302821353 by techy1 on Friday 14th of June 2013 12:07:34 PM
Old 06-14-2013
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:

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="<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>

 

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
MYSQLDIFF(1p)						User Contributed Perl Documentation					     MYSQLDIFF(1p)

NAME
mysql-schema-diff - compare MySQL database schemas SYNOPSIS
mysql-schema-diff [B<options>] B<database1> B<database2> mysql-schema-diff --help DESCRIPTION
mysql-schema-diff is a Perl script front-end to the CPAN <http://www.perl.com/CPAN> module MySQL::Diff <http://search.cpan.org/search?module=MySQL::Diff> which compares the data structures (i.e. schema / table definitions) of two MySQL <http://www.mysql.com/> databases, and returns the differences as a sequence of MySQL commands suitable for piping into mysql which will transform the structure of the first database to be identical to that of the second (c.f. diff and patch). Database structures can be compared whether they are files containing table definitions or existing databases, local or remote. N.B. The program makes no attempt to compare any of the data which may be stored in the databases. It is purely for comparing the table definitions. I have no plans to implement data comparison; it is a complex problem and I have no need of such functionality anyway. However there is another program coldiff <http://rossbeyer.net/software/mysql_coldiff/> which does this, and is based on an older program called datadiff which seems to have vanished off the 'net. For PostgreSQL there are similar tools such as pgdiff <http://pgdiff.sourceforge.net/> and apgdiff <http://apgdiff.startnet.biz/>. EXAMPLES
# compare table definitions in two files mysql-schema-diff db1.mysql db2.mysql # compare table definitions in a file 'db1.mysql' with a database 'db2' mysql-schema-diff db1.mysql db2 # interactively upgrade schema of database 'db1' to be like the # schema described in the file 'db2.mysql' mysql-schema-diff -A db1 db2.mysql # compare table definitions in two databases on a remote machine mysql-schema-diff --host=remote.host.com --user=myaccount db1 db2 # compare table definitions in a local database 'foo' with a # database 'bar' on a remote machine, when a file foo already # exists in the current directory mysql-schema-diff --host2=remote.host.com --password=secret db:foo bar OPTIONS
More details to come; for now run "mysql-schema-diff --help". INTERNALS
For both of the database structures being compared, the following happens: o If the argument is a valid filename, the file is used to create a temporary database which "mysqldump -d" is run on to obtain the table definitions in canonicalised form. The temporary database is then dropped. (The temporary database is named "test_mysqldiff_temp_something" because default MySQL permissions allow anyone to create databases beginning with the prefix "test_".) o If the argument is a database, "mysqldump -d" is run directly on it. o Where authentication is required, the hostname, username, and password given by the corresponding options are used (type "mysql-schema-diff --help" for more information). o Each set of table definitions is now parsed into tables, and fields and index keys within those tables; these are compared, and the differences outputted in the form of MySQL statements. BUGS, DEVELOPMENT, CONTRIBUTING See <http://software.adamspiers.org/wiki/mysqldiff>. COPYRIGHT AND LICENSE
Copyright (c) 2000-2011 Adam Spiers. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. SEE ALSO
MySQL::Diff, MySQL::Diff::Database, MySQL::Diff::Table, MySQL::Diff::Utils, mysql, mysqldump, mysqlshow AUTHOR
Adam Spiers <mysqldiff@adamspiers.org> perl v5.14.2 2012-04-06 MYSQLDIFF(1p)
All times are GMT -4. The time now is 07:11 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy