calling script using parms

Posted on 2012-08-13
Medium Priority
Last Modified: 2012-09-06
Below script  works perfect but i want to do some changes
1) using abc  second line is password i want to encrypt it and call it as parameter
2) "/opt/aa/ third and fourth line i want this call in parms too

How can i convert this script to parameters and also what will execute command to call

# exports data into IXF file.

. /db2_src/db2rind/sqllib/db2profile

db2 connect to autod user mkt_dbo using abc;
db2 EXPORT TO "/opt/aa/abc.ixf"
 OF DEL MESSAGES " /opt/aa/abcerror.txt"
 SELECT aa FROM aa.kk where 1=1  with ur;
db2 connect reset
Question by:sam2929
  • 2
  • 2
LVL 51

Accepted Solution

ahoffmann earned 2000 total points
ID: 38290940
. /db2_src/db2rind/sqllib/db2profile
db2 connect to autod user mkt_dbo using %2;
db2 EXPORT TO "%1/abc.ixf"
 OF DEL MESSAGES "%1/abcerror.txt"
 SELECT aa FROM aa.kk where 1=1  with ur;
db2 connect reset

# call the script then like:  the-script /opt/aa abc

>  is password i want to encrypt
does your db know how to deal with an encrypted passwd?
but before thinking about that: what should be the purpose of encrypting the password here? I don't see any advantage

Author Comment

ID: 38292852
in call script were we call %2 then

Author Comment

ID: 38294454
i get below error

SQL30082N  Security processing failed with reason "24" ("USERNAME AND/OR
SQL1024N  A database connection does not exist.  SQLSTATE=08003
SQL1024N  A database connection does not exist.  SQLSTATE=08003
LVL 51

Expert Comment

ID: 38295443
SQL30082N tells you the reason
did you proper quote the password and ensure that the shell does not change what you keyed in? most likely any other character than a-z and 0-9 needs some kind of special care

Featured Post

Configuration Guide and Best Practices

Read the guide to learn how to orchestrate Data ONTAP, create application-consistent backups and enable fast recovery from NetApp storage snapshots. Version 9.5 also contains performance and scalability enhancements to meet the needs of the largest enterprise environments.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Every server (virtual or physical) needs a console: and the console can be provided through hardware directly connected, software for remote connections, local connections, through a KVM, etc. This document explains the different types of consol…
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Suggested Courses
Course of the Month14 days, 1 hour left to enroll

807 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question