> hi newsgroup,
> is there a way to pass a parameter (e.g. password) to a db2script?
[quoted text clipped - 7 lines]
> 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/developerworks/db2/library/techarticle/dm-
0508fosdick/index.html?ca=drs-
and
Script for DB2 Universal Database using REXX: Quick DB2 UDB scripting
at
http://www-128.ibm.com/developerworks/db2/library/techarticle/dm-
0508fosdick1/index.html?ca=drs-
Offcourse other scripting languages can do (almost) the same or more
then rexx.
Peter Postlbauer - 05 Apr 2006 08:27 GMT
> > hi newsgroup,
> > is there a way to pass a parameter (e.g. password) to a db2script?
[quoted text clipped - 3 lines]
> 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
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
situ - 05 Apr 2006 16:39 GMT
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