473,388 Members | 1,370 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

Automated db2 commands in a shell script

13
Hello,

I posted this problem already in the linux section but without positive result. Perhaps someone here has experienced the smae problem.

I am pretty new with writing shell scripts and trying to use a script to perform some db2 commands on a CentOS 4 system. I get a problem when I put in my shell-file 'myscript.sh' the command:

Expand|Select|Wrap|Line Numbers
  1. db2 -tf somefile.sql
  2.  
When executing, I get a DB2 error:

Expand|Select|Wrap|Line Numbers
  1. DB21004E You cannot specify both an input file and a command when invoking the Command Line Processor.
  2.  
I discovered, using the debug command $ sh -x myscript.sh, that the shell adds some end of line symbols or something that ruin the command, since the output gives:

Expand|Select|Wrap|Line Numbers
  1. + db2 -tf ctb2.sql $'\r'
  2.  
Did anyone face similar problems once and know how to solve it? Thanks in advance, Siebbel.
Mar 29 '07 #1
1 7258
Hello,

I posted this problem already in the linux section but without positive result. Perhaps someone here has experienced the smae problem.

I am pretty new with writing shell scripts and trying to use a script to perform some db2 commands on a CentOS 4 system. I get a problem when I put in my shell-file 'myscript.sh' the command:

Expand|Select|Wrap|Line Numbers
  1. db2 -tf somefile.sql
  2.  
When executing, I get a DB2 error:

Expand|Select|Wrap|Line Numbers
  1. DB21004E You cannot specify both an input file and a command when invoking the Command Line Processor.
  2.  
I discovered, using the debug command $ sh -x myscript.sh, that the shell adds some end of line symbols or something that ruin the command, since the output gives:

Expand|Select|Wrap|Line Numbers
  1. + db2 -tf ctb2.sql $'\r'
  2.  
Did anyone face similar problems once and know how to solve it? Thanks in advance, Siebbel.
Try
Expand|Select|Wrap|Line Numbers
  1. db2 -tvf somefile.sql
Apr 2 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Will Seay | last post by:
At the end of this message I've pasted a script we're trying to modify slightly. I don't believe it is VBscript or javascript but these are the closest groups I could find with my limited...
12
by: Moosebumps | last post by:
So, after reading some messages about os.system, and looking at the popen stuff and trying it a bit, I still have not found a way to keep a command window open for several commands (on Windows...
1
by: Mike Kamzyuk | last post by:
Hello all. This topic has been covered on google groups before, but I couldn't find a good response. I have a shell command I wish to execute from c# (or vb or your favorite .net language). I...
2
by: timdoyle05 | last post by:
Hi, I have a question relating to how Unix commands can be issued from Python programs. Im am currently writing a large test script in python and I need this script to call three other separate...
0
by: David Roche | last post by:
Hello, I searched all through Google Groups, Google, and the Postgres docs, but to no avail. I hope someone can help me out here! I have a file that contains SQL, and some Postgres-specific...
1
by: moishyyehuda | last post by:
Hi #1 How do I open a script from another script. #2 when I run the script how can I supply commands to the script. #3 how do I find the what commands the script needs. The thing is like...
3
by: aj | last post by:
DB2 LUW 8.2 FP14 Red Hat AS 2.1 I am using a response file w/ db2setup to install DB2. I then want to install the latest fixpak in the same automated way. Is there any way to use a response...
1
by: Riccardo Maria Bianchi | last post by:
Hello! :) I'm trying to run shell commands both with os.system() and subprocess.Popen() class. But I can't run aliases or function defined in my .bashrc file, like in the login interactive...
0
by: xahlee | last post by:
Here's a little tutorial that lets you write emacs commands for processing the current text selection in emacs in your favorite lang. Elisp Wrapper For Perl Scripts...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.