If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Parent shell DB connection not passed to sub-shell

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-11-09, 13:20
zlek131 zlek131 is offline
Registered User
 
Join Date: Jan 2004
Posts: 7
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.
Reply With Quote
  #2 (permalink)  
Old 12-12-09, 11:27
wlfischer wlfischer is offline
Registered User
 
Join Date: Dec 2009
Posts: 1
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"?
Reply With Quote
  #3 (permalink)  
Old 12-14-09, 02:41
stolze stolze is offline
Registered User
 
Join Date: Jan 2007
Location: Jena, Germany
Posts: 2,662
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:
Code:
$ . my-script.sh
__________________
Knut Stolze
IBM DB2 Analytics Accelerator
IBM Germany Research & Development
Reply With Quote
  #4 (permalink)  
Old 12-15-09, 14:49
zlek131 zlek131 is offline
Registered User
 
Join Date: Jan 2004
Posts: 7
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.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On