?
Solved

calling script using parms

Posted on 2012-08-13
4
Medium Priority
?
499 Views
Last Modified: 2012-09-06
Hi,
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
parameters



#
# 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
0
Comment
Question by:sam2929
  • 2
  • 2
4 Comments
 
LVL 51

Accepted Solution

by:
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
0
 

Author Comment

by:sam2929
ID: 38292852
Thanks
in call script were we call %2 then
0
 

Author Comment

by:sam2929
ID: 38294454
i get below error

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

Expert Comment

by:ahoffmann
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
0

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