settign DB2 environment under Windows without using db2cw.bat

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • toralf

    settign DB2 environment under Windows without using db2cw.bat

    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

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

    toralf wrote:
    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.

    Comment

    • toralf

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


      yep, found this in the mean while


      --
      MfG/Sincerely

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


      Comment

      • Jan M. Nelken

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

        toralf wrote:
        What version of DB2 you are using?

        Jan M. Nelken

        Comment

        • toralf

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

          Darin McBride wrote:
          toralf wrote:
          >
          >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.ht m

          --
          MfG/Sincerely

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


          Comment

          • toralf

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

            Jan M. Nelken wrote:
            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


            Comment

            • Jan M. Nelken

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

              toralf wrote:
              Jan M. Nelken wrote:
              >
              >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

              Comment

              Working...