Skip to Content.
Sympa Menu

grouper-users - Re: [grouper-users] creating empty groups from an SQL source

Subject: Grouper Users - Open Discussion List

List archive

Re: [grouper-users] creating empty groups from an SQL source


Chronological Thread 
  • From: Jeff McCullough <>
  • To: Gouper Users List <>
  • Subject: Re: [grouper-users] creating empty groups from an SQL source
  • Date: Mon, 10 Oct 2016 14:31:47 -0700
  • Ironport-phdr: 9a23:ivQgpBXsi/9CGYViGp0VHE+3aADV8LGtZVwlr6E/grcLSJyIuqrYZhWEt8tkgFKBZ4jH8fUM07OQ6P+wHzFbqs/c+Fk5M7VyFDY9wf0MmAIhBMPXQWbaF9XNKxIAIcJZSVV+9Gu6O0UGUOz3ZlnVv2HgpWVKQka3HUNPK+/0Ao/fidisn6D3osWLIlYAuD3oTrRvNBis5TjKu9MNya9jMbp5nhTTpWZQdv4T2HhlP0m7nhDg69228YI5tSlcpqRy2dRHVPDYcqo2BZlTJykiN2co682j4RvOQwWK7VMWX38Vnx5FEk7I4AysDcS5iTfzqucogHrSBsbxV71hHG36t6o=

Okay. The select statement with no returns works just fine, and yes, I get your idea if we need to run the query ongoing.  I especially like the finger crossing clause. :)

Thank you..

On Oct 10, 2016, at 11:45 AM, Hyzer, Chris <> wrote:

You need the grouperLoaderQuery to return no rows.  Then see if the grouperLoaderGroupQuery will create the empty groups.  Note, this will remove all members from those groups obviously.  Is this a one time load or ongoing?  If one time, maybe make a GSH script from SQL, detailed from GSH wiki page.  If ongoing, and you want groups members to be removed, then keep going with grouper loader.  If you want ongoing and members to stay intact, then it is a little more interesting.  You need a grouperLoaderQuery to return the grouper members of groups i.e. a select with where clause from grouper_memberships_lw_v, know what I mean?  J  And cross your fingers for no race conditions J
 
Thanks
Chris
 
 
From:  [] On Behalf Of Jeff McCullough
Sent: Monday, October 10, 2016 2:40 PM
To: Shilen Patel <>
Cc: Gouper Users List <>
Subject: Re: [grouper-users] creating empty groups from an SQL source
 
I had thought that might be possible, but tried moving the select from grouperLoaderQuery to grouperLoaderGroupQuery. 
 
 
I get this error:
 
// Error: unable to evaluate command: Sourced file: inline evaluation of: ``loaderRunOneJob(group);'' : Error invoking compiled command: : Error in compiled command: java.lang.RuntimeException: java.lang.RuntimeException: Invalid query, must start with select:  order by group_name


java.lang.RuntimeException: Invalid query, must start with select:  order by group_name
        at edu.internet2.middleware.grouper.app.loader.db.GrouperLoaderResultset.<init>(GrouperLoaderResultset.java:404)


-------
        if (!query.toLowerCase().trim().startsWith("select")) {
                throw new RuntimeException("Invalid query, must start with select: " + query);
        }
———


I realized after a bit that what it means is that there isn’t a select statement in grouperLoaderQuery. As I read further, the grouperLoaderGroupQuery appeared to be an additional query that was only used as a way to add more descriptive information as well as permissions to the group. Given that, I went back to trying to find a way to load the empty groups independently of the grouperLoaderGroupQuery. If grouperLoaderGroupQuery is the way to do it, then I’m still missing what select statement needs to go in the grouperLoaderQuery?
 
Thank you,
Jeff
 
On Oct 10, 2016, at 5:07 AM, Shilen Patel <> wrote:
 
You should be able to do it by specifying a grouperLoaderGroupQuery that contains all the groups.
 
 
Thanks!
 
- Shilen
 
On 10/9/16, 11:59 PM, "Jeff McCullough" <> wrote:
 
I’ve been playing around with SQL_SIMPLE and GROUP_LIST for grouper loader connections. I’d like to create a list of title code groups that are empty to start, and then some are populated with current accounts. The empty to start part is necessary for creating title code groups for various jobs on campus. Some of the title codes are not currently being used, but they may in the future. We want to create title code based nested groups for various job types. We are hoping to hand this off to the HR group, since they are the authorities as title code groupings may change over time. They will want to add all the nested title code groups at once rather than having to worry about adding them later when someone new is using a previously unused title code. 
 
I can’t see a easy way to directly create them besides using SQL_GROUP_LIST and using a select statement like:
 
select ‘0’ as subject_id, group_name, etc…
 
against a view that has a list of all possible title codes. The ‘0’ is unresolved, but it does create an empty group. Is there another way to do this? I haven’t seen it in the documentation, though there are discussions about creating org trees and class lists of nested groups. Maybe I’m missing the obvious. Who knows.
 
Thanks,
Jeff




Archive powered by MHonArc 2.6.19.

Top of Page