473,396 Members | 1,683 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,396 software developers and data experts.

Shell Script eroor while using db2 export


Hi I have a function as below...

function PerformQuery3
{
$VAR1 = 'export to $1 of ixf messages $2.out "select * from $3"'

echo $VAR1

SQL_CODE=$(db2 -ec +o $1)
if [[ $SQL_CODE != 0 && $SQL_CODE != 100 && $SQL_CODE != 437 ]]
then
#print -u9 " Error: $2 failed with SQLcode $SQL_CODE"
echo "Program abnormally ended - please check logfile $LOGFILE"
exit 1
else
echo " $2 exported succesfully"
fi

}


I am passing the following parameter to it

PerformQuery3 ZPSST_LICDATA.ixf ZPSST_LICDATA pads006.ZPSST_LICDATA
But it fails .....Can some one please help me .....
Its extremely urgent for me...

Bikash

Mar 27 '06 #1
3 2512
Probably the mistake is in VAR1 .....I am unable to build the query to
export data ..

export to filename.ixf of ixf "select * from schemaname.tabname"

Mar 27 '06 #2
While stranded on information super highway bi******@in.ibm.com wrote:

Hi I have a function as below...

function PerformQuery3
{
$VAR1 = 'export to $1 of ixf messages $2.out "select * from $3"'

echo $VAR1

SQL_CODE=$(db2 -ec +o $1) ^^
Shouldn't this be $VAR1

if [[ $SQL_CODE != 0 && $SQL_CODE != 100 && $SQL_CODE != 437 ]]
then
#print -u9 " Error: $2 failed with SQLcode $SQL_CODE"
echo "Program abnormally ended - please check logfile $LOGFILE"
exit 1
else
echo " $2 exported succesfully"
fi

}


I am passing the following parameter to it

PerformQuery3 ZPSST_LICDATA.ixf ZPSST_LICDATA pads006.ZPSST_LICDATA
But it fails .....Can some one please help me .....
Its extremely urgent for me...

Bikash


--
Hemant Shah /"\ ASCII ribbon campaign
E-mail: No************@xnet.com \ / ---------------------
X against HTML mail
TO REPLY, REMOVE NoJunkMail / \ and postings
FROM MY E-MAIL ADDRESS.
-----------------[DO NOT SEND UNSOLICITED BULK E-MAIL]------------------
I haven't lost my mind, Above opinions are mine only.
it's backed up on tape somewhere. Others can have their own.
Mar 27 '06 #3

Looks like it is a shell script, but you are using Perl syntax for variable
assignment, try following:

VAR1="export to $1 of ixf messages $2.out \"select * from $3\""

echo $VAR1

SQL_CODE=$(db2 -ec +o $VAR1)
While stranded on information super highway bi******@in.ibm.com wrote:

Hi I have a function as below...

function PerformQuery3
{
$VAR1 = 'export to $1 of ixf messages $2.out "select * from $3"'

echo $VAR1

SQL_CODE=$(db2 -ec +o $1)
if [[ $SQL_CODE != 0 && $SQL_CODE != 100 && $SQL_CODE != 437 ]]
then
#print -u9 " Error: $2 failed with SQLcode $SQL_CODE"
echo "Program abnormally ended - please check logfile $LOGFILE"
exit 1
else
echo " $2 exported succesfully"
fi

}


I am passing the following parameter to it

PerformQuery3 ZPSST_LICDATA.ixf ZPSST_LICDATA pads006.ZPSST_LICDATA
But it fails .....Can some one please help me .....
Its extremely urgent for me...

Bikash


--
Hemant Shah /"\ ASCII ribbon campaign
E-mail: No************@xnet.com \ / ---------------------
X against HTML mail
TO REPLY, REMOVE NoJunkMail / \ and postings
FROM MY E-MAIL ADDRESS.
-----------------[DO NOT SEND UNSOLICITED BULK E-MAIL]------------------
I haven't lost my mind, Above opinions are mine only.
it's backed up on tape somewhere. Others can have their own.
Mar 28 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Jorgen Grahn | last post by:
I couldn't think of a good solution, and it's hard to Google for... I write python command-line programs under Win2k, and I use the bash shell from Cygwin. I cannot use Cygwin's python package...
9
by: Tommy Lu | last post by:
Hi, wondering if there is a way to interact the shell command with the C# program? For example, if I type c:\>ver it then suppose to return the version of the OS I am currently using... or ...
0
by: paulhjwu | last post by:
Hi, I have problems running a couple of shell scripts from PHP. I found a similar posting, so I posted my question to the original author. But unfortunately the original author is not at the...
6
by: vito | last post by:
how to config the linux to know the path of /usr/bin/php so no need to type it before running a php script every time?
0
by: chettiar | last post by:
Hi, I am new to shell scripting. I need to use the db2_all command in a shell script can someone help. I need to use the following command in the shell script: db2_all <<-0< db2 conncet to...
9
by: sohan | last post by:
Hi, I want to know how to connect and execute a db2 query from inside a UNIX shell script. Details: We have a unix shell script. We need to execute multiple db2 sql queries from this shell...
4
by: Siebbel | last post by:
Dear all, I am trying to write a shell script that creates a ssh tunnel to a remote server and checks out a module from a CVS repository. The problem is that the tunnel creation blocks the...
1
by: pssraju | last post by:
Hi, I am not sure whether I am posting it in right location as i cant see any shell scripting forum here. Below script works perfectly fine from command line, but when I run through browser I am...
2
by: scott.hafeman | last post by:
Hi, Is it worthwhile maintaining a production application setup script in Python as opposed to shell-script? The main goal of this setup script is to sniff a user's environment and export...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.