First, What database are you using? ( It looks like you may be using Oracle, but it would be nice to be sure)
Second, What is it you are trying to do? Are you trying to get a list of all users that are in a specific group or a list of users that are all in a specific set of groups? Third, Remember the group list field in Remedy is a string of group IDs and the IDs can be in any order. Fred -----Original Message----- From: Action Request System discussion list(ARSList) [mailto:[email protected]] On Behalf Of remedy.help Sent: Tuesday, February 16, 2010 3:42 PM To: [email protected] Subject: Re: SQL help needed ** the error points to the Fetch statement Fetch C1 into froup_id,group_name It will be great if somebody has done sql manipulations on the C104 filed of the t9(User Form) On Tue, Feb 16, 2010 at 3:37 PM, Joe D'Souza <[email protected]> wrote: ** What is the error that you are getting? Joe -----Original Message----- From: Action Request System discussion list(ARSList) [mailto:[email protected]]on Behalf Of amit dw Sent: Tuesday, February 16, 2010 4:20 PM To: [email protected] Subject: SQL help needed ** Hello All, Below is the problem and way I was trying to handle it C_list contains comma separated values of group Id's. this list contains all the group id's associated to a particular login name. C_list= (1,15005,800005,800003,800004,805) This variable will be holding up dynamically value in numbers. For group id numbers in simple sql statement we can get the result corresponding name using the below query, Select c105,c106 from t10 where c106 in (1, 101,102,104). Same query when I tried transforming in a cursor it throws up a compilation error. The error points out to a fetch statement where we try and fetch the data from the cursor for one particular group id. Declare cursor c1 as select c105,c106 from t10 where c106 in(c_list); Begin Open c1; Loop Fetch C1 into g_num,g_name; dbms_output.put_line(g_name); EXIT WHEN C1%NOTFOUND; END LOOP; Close c1; End; Hope it explains the problem I am facing. _______________________________________________________________________________ UNSUBSCRIBE or access ARSlist Archives at www.arslist.org Platinum Sponsor:[email protected] ARSlist: "Where the Answers Are"

