Dynamically value (get roles) in combo box [message #443070] |
Fri, 12 February 2010 07:28 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
shahzad-ul-hasan
Messages: 643 Registered: August 2002
|
Senior Member |
|
|
i want to get user (dba roles in combo box runt time).i have write down this code in when new form instance.
declare
rg_id recordgroup := find_group('RG') ;
ln_error number ;
begin
if not id_null(rg_id) then
ln_error := populate_group(rg_id) ;
if ln_error = 0 then
populate_list('BLOCK3.T' , rg_id) ;
else
message('Error in Populating Group') ;
end if ;
end if ;
end ;
pls see the attached file.when i run it gives the follwoing error.
frm-41334-invalid record group.
record group query is:
SELECT GRANTED_ROLE FROM DBA_ROLE_PRIVS WHERE GRANTEE='MTSYS'
[EDITED by LF: applied [code] tags and attached additional text after topics have being merged]
-
Attachment: combo.JPG
(Size: 35.19KB, Downloaded 702 times)
[Updated on: Fri, 12 February 2010 07:37] by Moderator Report message to a moderator
|
|
|
|
|
|
|
Re: Dynamically value (get roles) in combo box [message #443151 is a reply to message #443127] |
Sat, 13 February 2010 01:13 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
tamzidulamin
Messages: 132 Registered: October 2009 Location: Dhaka
|
Senior Member |
|
|
Try with the following code:
Setp-01
CREATE TABLE MICR.Sample_List
( list_NAME VARCHAR2(200 BYTE));
Setp-02
Insert into SAMPLE_LIST (LIST_NAME) Values ('T-List');
Insert into SAMPLE_LIST (LIST_NAME) Values ('Pop-List');
Insert into SAMPLE_LIST (LIST_NAME) Values ('Combo-Box');
Insert into SAMPLE_LIST (LIST_NAME) Values ('Other List');
COMMIT;
Setp-03
Declare
rg_name varchar2(40) := 'RG';
rg_id recordgroup;
errcode number;
vQuery varchar2(4000):= 'select list_name,list_name from sample_list order by 1';
p_list varchar2(500) := 'BLOCK3.SAMPLE_LIST';
begin
rg_id := find_group( rg_name );
if id_null(rg_id) then
rg_id := CREATE_GROUP_FROM_QUERY( rg_name,vQuery);
end if;
errcode := populate_group( rg_id );
clear_list (p_list);
populate_list (p_list, rg_id );
End;
Step-04
Run the LIST.fmb form the attachment.
Now change your query as your required.
Regrads.
Tamzidul Amin.
|
|
|
|