2 replies Latest Post - ‏2013-12-14T23:16:15Z by melman74
5837 Posts

Pinned topic DB2 Command Window with cygwin on Windows

‏2006-08-10T14:21:54Z |
I run windows and prefer to use cygwin. I had DB2 V8 and V7 running fine in a bash shell using the following shortcut.

"C:\Program Files\IBM\SQLLIB\BIN\db2cmd.exe" /i /c C:\cygwin\cygwin.bat

Version 9 starts now with the same shortcut, but I get the following error.
Same error on a local database.

Does anyone have this working.

$ db2 connect to dbname user xxxx
Enter current password for xxxx:

Database Connection Information

Database server = DB2/AIX64 9.1.0
SQL authorization ID = xxxx
Local database alias = xxxx
$ db2 list tables
SQL1024N A database connection does not exist. SQLSTATE=08003
Updated on 2006-08-10T18:27:47Z at 2006-08-10T18:27:47Z by rchase
  • rchase
    364 Posts

    Re: DB2 Command Window with cygwin on Windows

    ‏2006-08-10T18:27:47Z  in response to SystemAdmin

    There is a thread on this same issue in the DB2 Viper forum, here's a link to the original thread:

    here's a quick summary:

    DB2 v9 has a different mechanism to figure out the PPID for a process. Try the following in the bash shell:

    export DB2CLP=**$$**
    then run the DB2 commands

    Ryan Chase
    DB2 Express Community team
    • melman74
      1 Post

      Re: DB2 Command Window with cygwin on Windows

      ‏2013-12-14T23:16:15Z  in response to rchase

      Hi, I'm trying to use this same solution for db210.5 and am getting the same issue, namely that the "db2 connect to sample" immediately followed by "db2 list tables" no longer works as below:

      jeff@hplaptop2013 ~
      $ db2 connect to sample
         Database Connection Information
       Database server        = DB2/NT64 10.5.1
       SQL authorization ID   = JEFF
       Local database alias   = SAMPLE
      jeff@hplaptop2013 ~
      $ db2 list tables
      SQL1024N  A database connection does not exist.  SQLSTATE=08003


      I did put the "export DB2CLP=**$$**" line in my .bashrc.

      Any ideas on how to make this work on cygwin for the latest DB2 express-c for windows?

      Thanks for your help,