Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2004

    Unanswered: Parent shell DB connection not passed to sub-shell

    We have recently upgraded from AIX 5.2 to 5.3 and from DB2 UDB 8.2 FP16 to 9.5 FP4. Unchanged code that use to work just fine seems to have issues now. Specifically, we have Korn shells that establish a DB2 connection and then call sub-shells that run various SQL and depend on the previously established connection in the parent shell. The issue is that the parent db connection appears to be NOT available or is not being passed down to child sub-shell. The error returned to by the sub-shell is:

    "SQL1024N A database connection does not exist. SQLSTATE=08003"

    This is unchanged code that has worked perfectly fine for years.

    Any ideas? Thank you in advance, Matt.

  2. #2
    Join Date
    Dec 2009
    I had the same issue on Solaris (V8 and V9) and Windows V9, where V8 did work.

    Maybe you can call scripts with "." instead of "sh"/"bash"?

  3. #3
    Join Date
    Jan 2007
    Jena, Germany
    I dimly recall that I tried to reuse a shell's connection in a subshell as well in DB2 V8 - it didn't work. I had to call the shell script in the context of the current shell as wlfischer said:
    $ .
    Knut Stolze
    IBM DB2 Analytics Accelerator
    IBM Germany Research & Development

  4. #4
    Join Date
    Jan 2004
    Thanks guys. Glad to hear that others have come across the same issue and it's not just our env. I think we'll fix this issue by a adding a connect/disconnect to the subshells.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts