473,396 Members | 2,055 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.

db2cmd.....

hi newsgroup,
is there a way to pass a parameter (e.g. password) to a db2script?
Example:
db2cmd /c db2 -t -fscript.clp

script.clp:
----------
connect to mydatabase user myself using password;
export to mytable.ixf of ixf messages mytable.msg select * from mytable;
connect reset;
-----------

thanx for any hint, peter
Apr 5 '06 #1
4 9812
In article <e0**********@newsreader1.utanet.at>, pe**************@apk.at
says...
hi newsgroup,
is there a way to pass a parameter (e.g. password) to a db2script?
Example:
db2cmd /c db2 -t -fscript.clp

script.clp:
----------
connect to mydatabase user myself using password;
export to mytable.ixf of ixf messages mytable.msg select * from mytable;
connect reset;
-----------


No, unfortunately it isn't.
I always use rexx scripts to run the DB2 commmands. If you want/need to
get used to rexx and DB2 you can find two articles at developersworld at
the following (wrapped) links:

Script for DB2 Universal Database using REXX: Learn REXX fast
at
http://www-128.ibm.com/developerwork...echarticle/dm-
0508fosdick/index.html?ca=drs-

and

Script for DB2 Universal Database using REXX: Quick DB2 UDB scripting
at
http://www-128.ibm.com/developerwork...echarticle/dm-
0508fosdick1/index.html?ca=drs-

Offcourse other scripting languages can do (almost) the same or more
then rexx.

Apr 5 '06 #2
"Gert van der Kooij" <no****@nl.invalid> schrieb im Newsbeitrag
news:MP************************@news.xs4all.nl...
In article <e0**********@newsreader1.utanet.at>, pe**************@apk.at
says...
hi newsgroup,
is there a way to pass a parameter (e.g. password) to a db2script?
Example:
db2cmd /c db2 -t -fscript.clp


No, unfortunately it isn't.
I always use rexx scripts to run the DB2 commmands. If you want/need to


many thanx for your hint (and help), so I'll use rexx
regards, peter
Apr 5 '06 #3
ivb
If you concrete task is secure password: (for Windows):

file starter.bat:
db2cmd -c script.bat %1

file script.bat:
db2 connect to MYDB user db2admin using %1
db2 -td@ -f script1.sql -z log.out
db2 -td@ -f script2.sql -z log.out
db2 QUIT

Apr 5 '06 #4
check it out

SET DB_NAME=%1
SET USER_NAME=%2
SET PASSWORD=%3

db2 CONNECT TO %DB_NAME% user %USER_NAME% USING %PASSWORD%
db2 -vf cr_loy_ddl.sql -t +o -l cr_loy_ddl.log

this one i ran it through batch file

Apr 5 '06 #5

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

Similar topics

7
by: rhjaisingh | last post by:
Folks, I need to create a batch file that will do the following - Establish a DB2 instance Connect to a certain database Get data using an sql and output it to a file So, this is what I...
4
by: reachsamdurai | last post by:
Hello, Can you please let me know the procedure to reach db2 command prompt from a cygwin window (hence without using Start-> Run -> db2cmd method). I'm planning to write shell scripts which...
0
by: wb5plj | last post by:
Hi I am having a problem passing some sql to the db2cmd via ant. This is very confusing as I am doing this exact thing elseware with no problem (just differant sql, and I have verified the sql is...
1
by: udbadmin | last post by:
Where do you get examples for running db2 udb commands from db2cmd command line editor. Any good sites ...? Need help with db2cmd commands - How to connect to the database using db2cmd? How to...
6
by: Mesan | last post by:
Does anyone have an idea what it takes to administer DB2 through PowerShell? I want to write some scripts to automate my common DB2 management tasks and I'd really like to be able to use...
0
by: DeepthiSem | last post by:
Hi Everyone I have an issue in running the DB2 command script using Batch file from Windows application. From my application i am calling the batch file which inturn runs the Db2cmd prompt . ...
2
by: Azahary | last post by:
Hi, I'm using DB2v8.1.7 on window XP. I got DB2CMD.EXE -> 5 SQL1042C An unexpected system error occurred. when try to execute DB2 command on CLP. Is there any solution for this problem...
1
by: Cragu | last post by:
Hi Gurus, I'm trying to extract the data from DB2 datas. I used DB2CMD to connect from the CMD prompt from there I'm running a batch file. In that batch file, I will connect to the database...
0
by: KUMARJIT BASAK | last post by:
I can run this attached code separately from db2cmd with proper configuration, but failed to call it from db2cmd. Need urgent help
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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.