Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
Database Servers
DB2InformixIngresMS SQLOraclePervasive.SQLPostgreSQLProgressSybase
Desktop Databases
FileMakerFoxProMS AccessParadox
General
General DB TopicsDatabase Theory
Related Topics
Java Development.NET DevelopmentVB DevelopmentMore Topics ...

Database Forum / DB2 Topics / June 2006

Tip: Looking for answers? Try searching our database.

db2 & perl

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Stefan - 27 Jun 2006 08:53 GMT
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
situ - 27 Jun 2006 11:46 GMT
@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
Stefan - 27 Jun 2006 12:11 GMT
does it work as well when I switch the user befor?
"su - dbuser"

situ schrieb:

> @echo off
> SET DB_NAME=MYDB
[quoted text clipped - 6 lines]
>
> it may help u a bit
situ - 27 Jun 2006 12:25 GMT
did u mean if u  alreday have one previous connection??
yes it works i think
Ian - 27 Jun 2006 13:48 GMT
> Hi all,
>
[quoted text clipped - 7 lines]
> exit
> --

What does this have to do with perl (i.e. your subject, "db2 & perl")?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.