calling script using parms

Posted on 2012-08-13
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
    LVL 51

    Accepted Solution

    . /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

    in call script were we call %2 then

    Author Comment

    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

    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

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    Attention: This article will no longer be maintained. If you have any questions, please feel free to mail me. Please see for the updated article. It is avail…
    Little introduction about CP: CP is a command on linux that use to copy files and folder from one location to another location. Example usage of CP as follow: cp /myfoder /pathto/destination/folder/ cp abc.tar.gz /pathto/destination/folder/ab…
    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…
    Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

    755 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

    Need Help in Real-Time?

    Connect with top rated Experts

    23 Experts available now in Live!

    Get 1:1 Help Now