Sign In | Register Now About Bytes | Help | Site Map
Connecting Tech Pros Worldwide

settign DB2 environment under Windows without using db2cw.bat

Question posted by: toralf (Guest) on August 8th, 2008 09:15 AM
Hello,

I've to script sth under Windows and would like to set the DB2
environment w/o that batch file to stay at my bash prompt. How can I do
that ?


--
MfG/Sincerely

Toralf Förster
pgp finger print: 7B1A 07F4 EC82 0F90 D4C2 8936 872A E508 7DB6 9DA3


Darin McBride's Avatar
Darin McBride
Guest
n/a Posts
August 8th, 2008
02:45 PM
#2

Re: settign DB2 environment under Windows without using db2cw.bat
toralf wrote:
Quote:
Hello,
>
I've to script sth under Windows and would like to set the DB2
environment w/o that batch file to stay at my bash prompt. How can I do
that ?


I think the safest way to do that is not to do it. Instead, run db2cw from
a cmd prompt, and then from there, run bash. That way, bash will merely
inherit the environment instead of having to figure it out yourself. Also,
if db2cw.bat is updated in a fix pack or something, your environment will
stay up to date (i.e., the next time you run it, just like everyone else).

Or, if this is all scripting, just write a batch file around your shell
script which merely calls db2cw first, and then runs bash with your current
script. This is what, as an example, C programs would have to do if they
can't just set the environment themselves: they rely on the user having set
up the DB2 environment first.

toralf's Avatar
toralf
Guest
n/a Posts
August 11th, 2008
05:45 PM
#3

Re: settign DB2 environment under Windows without using db2cw.bat

yep, found this in the mean while
http://bytes.com/forum/thread495149.html

--
MfG/Sincerely

Toralf Förster
pgp finger print: 7B1A 07F4 EC82 0F90 D4C2 8936 872A E508 7DB6 9DA3



Jan M. Nelken's Avatar
Jan M. Nelken
Guest
n/a Posts
August 12th, 2008
02:15 AM
#4

Re: settign DB2 environment under Windows without using db2cw.bat
toralf wrote:


What version of DB2 you are using?

Jan M. Nelken

toralf's Avatar
toralf
Guest
n/a Posts
August 13th, 2008
09:05 AM
#5

Re: settign DB2 environment under Windows without using db2cw.bat
Darin McBride wrote:
Quote:
toralf wrote:
>
Quote:
>Hello,
>>
>I've to script sth under Windows and would like to set the DB2
>environment w/o that batch file to stay at my bash prompt. How can I do
>that ?

>
I think the safest way to do that is not to do it. Instead, run db2cw from
a cmd prompt, and then from there, run bash. That way, bash will merely
inherit the environment instead of having to figure it out yourself. Also,
if db2cw.bat is updated in a fix pack or something, your environment will
stay up to date (i.e., the next time you run it, just like everyone else).
>
Or, if this is all scripting, just write a batch file around your shell
script which merely calls db2cw first, and then runs bash with your current
script. This is what, as an example, C programs would have to do if they
can't just set the environment themselves: they rely on the user having set
up the DB2 environment first.


You're right, in the mean while l found
Ihttp://bytes.com/forum/thread495149.htm

--
MfG/Sincerely

Toralf Förster
pgp finger print: 7B1A 07F4 EC82 0F90 D4C2 8936 872A E508 7DB6 9DA3



toralf's Avatar
toralf
Guest
n/a Posts
August 13th, 2008
09:05 AM
#6

Re: settign DB2 environment under Windows without using db2cw.bat
Jan M. Nelken wrote:
Quote:
toralf wrote:
>

>
What version of DB2 you are using?
>

Database server = DB2/NT 8.2.0

--
MfG/Sincerely

Toralf Förster
pgp finger print: 7B1A 07F4 EC82 0F90 D4C2 8936 872A E508 7DB6 9DA3



Jan M. Nelken's Avatar
Jan M. Nelken
Guest
n/a Posts
August 13th, 2008
02:45 PM
#7

Re: settign DB2 environment under Windows without using db2cw.bat
toralf wrote:
Quote:
Jan M. Nelken wrote:
>
Quote:
>toralf wrote:
>>

>What version of DB2 you are using?
>>

Database server = DB2/NT 8.2.0
>



Ah - in that case you have to use my solution you found earlier. In
Version 9 you could use SET DB2CLP=**$$** and use ordinatory Command
Window to issue DB2 commands - hence you could use all scripting tools
Windows have (for example PowerShell from Microsoft.

Keep in mind that support for V8 may end in April 2009.


Jan M. Nelken

 
Not the answer you were looking for? Post your question . . .
189,878 Experts ready to help you find a solution.
Sign up for a free account, or Login (if you're already a member).

Latest Articles: Read & Comment
  • Didn't find the answer you were looking for?
    Post Your Question
  • Top Community Contributors