469,926 Members | 1,791 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,926 developers. It's quick & easy.

db2 & perl

Hi all,

i want so run a sql-script with user and password parameter.
My sql-script looks like:

--
connect to TEST user TestUser using TestPw
list applications for database TEST show detail
terminate
exit
--

How could I use the script with variable user and password? This
parameter should be in a seperate file.

Thanks...
Stefan

Jun 27 '06 #1
4 1345
@echo off
SET DB_NAME=MYDB
SET USER_NAME=USER
SET PASSWORD=USER_PASSWORD

db2 CONNECT TO %DB_NAME% user %USER_NAME% USING %PASSWORD%
db2 list applications for database %DB_NAME% show detail
db2 terminate
it may help u a bit

Jun 27 '06 #2
does it work as well when I switch the user befor?
"su - dbuser"

situ schrieb:
@echo off
SET DB_NAME=MYDB
SET USER_NAME=USER
SET PASSWORD=USER_PASSWORD

db2 CONNECT TO %DB_NAME% user %USER_NAME% USING %PASSWORD%
db2 list applications for database %DB_NAME% show detail
db2 terminate
it may help u a bit


Jun 27 '06 #3

did u mean if u alreday have one previous connection??
yes it works i think

Jun 27 '06 #4
Ian
Stefan wrote:
Hi all,

i want so run a sql-script with user and password parameter.
My sql-script looks like:

--
connect to TEST user TestUser using TestPw
list applications for database TEST show detail
terminate
exit
--


What does this have to do with perl (i.e. your subject, "db2 & perl")?

Jun 27 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Stephen Ferg | last post: by
29 posts views Thread by Bart Nessux | last post: by
19 posts views Thread by John Keeling | last post: by
4 posts views Thread by Xah Lee | last post: by
2 posts views Thread by Xah Lee | last post: by
1 post views Thread by Justin Kozuch | last post: by
6 posts views Thread by Mark Rae | last post: by
30 posts views Thread by fritz-bayer | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.