Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
Database Servers
DB2InformixIngresMS SQLOraclePervasive.SQLPostgreSQLProgressSybase
Desktop Databases
FileMakerFoxProMS AccessParadox
General
General DB TopicsDatabase Theory
Related Topics
Java Development.NET DevelopmentVB DevelopmentMore Topics ...

Database Forum / DB2 Topics / March 2006

Tip: Looking for answers? Try searching our database.

Shell Script eroor while using db2 export

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
bikkaran@in.ibm.com - 27 Mar 2006 16:23 GMT
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
bikkaran@in.ibm.com - 27 Mar 2006 16:31 GMT
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"
Hemant Shah - 27 Mar 2006 16:32 GMT
> Hi I have a function as below...
>
[quoted text clipped - 5 lines]
>
> SQL_CODE=$(db2 -ec +o $1)
                       ^^
                       Shouldn't this be $VAR1

> if [[ $SQL_CODE != 0 && $SQL_CODE != 100 && $SQL_CODE != 437 ]]
> then
[quoted text clipped - 15 lines]
>
> Bikash

Signature

Hemant Shah                           /"\  ASCII ribbon campaign
E-mail: NoJunkMailshah@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.

Hemant Shah - 28 Mar 2006 19:50 GMT
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)

> Hi I have a function as below...
>
[quoted text clipped - 24 lines]
>
> Bikash

Signature

Hemant Shah                           /"\  ASCII ribbon campaign
E-mail: NoJunkMailshah@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.

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.