aspose file tools*
The moose likes JDBC and the fly likes SQL Recursion Question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "SQL Recursion Question" Watch "SQL Recursion Question" New topic
Author

SQL Recursion Question

Dom Lassy
Ranch Hand

Joined: May 05, 2006
Posts: 181
I could use some help figuring out the sql for a problem. Currently, there are 2 tables:
Domain, which has columns domainID, and parentDomainID. ParentDomainID references another Domain record.
EndUser, which has a column parentDomainID.

I have a procedure where I am looping over domainIDs (variable @currentDomainID). I need to do now is update all EndUser records that are in the currentDomainID or where the any parent of the endUser parentDomainID is the @parentDomainID.

In pseudocode what I need to do is this:

Any help would be appreciated.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: SQL Recursion Question