Sponsored

Retrieves the sequence number of the selected row for the given group. Suppose you want to get a particular column value from a record group for the all rows or for particular rows, then you can use get_group_selection built-in to perform the task.

Example:

/*
Built-in: GET_GROUP_SELECTION Example: Return a comma-separated list (string) of the selected part  numbers from the presumed existent PARTNUMS record group.
*/
FUNCTION Comma_Separated_Partnumbers
RETURN VARCHAR2 IS
tmp_str VARCHAR2(2000);
rg_id RecordGroup;
gc_id GroupColumn;
the_Rowcount NUMBER;
sel_row NUMBER;
the_val VARCHAR2(20);
BEGIN
rg_id := Find_Group(’PARTNUMS’);
gc_id := Find_Column(’PARTNUMS.PARTNO’);
/*
Get a count of how many rows in the record group have been marked as "selected"
*/
the_Rowcount := Get_Group_Selection_Count( rg_id );
FOR j IN 1..the_Rowcount LOOP
/*
Get the Row number of the J-th selected row.
*/
sel_row := Get_Group_Selection( rg_id, j );
/*
Get the (VARCHAR2) value of the J-th row.
*/
the_val := Get_Group_CHAR_Cell( gc_id, sel_row );
IF j = 1 THEN
tmp_str := the_val;
ELSE
tmp_str := tmp_str||’,’||the_val;
END IF;
END LOOP;
RETURN tmp_str;
END;

Oracle Forms Recipes eBookDownload

Example is given for get_group_selection built-in in Oracle Forms.

Post a Comment

V. Kapoor

{picture#https://3.bp.blogspot.com/-q3wCssWUHo8/ViDFfCpPEuI/AAAAAAAAD0M/MHPvgnl3T3U/s1600/authpic.JPG} Vinish Kapoor is a Software Consultant, currently working in a reputed IT company in Noida, India and doing blogging on Oracle Forms, SQL and PLSQL topics. He is an author of an eBook Oracle Forms Recipes, which is available on Google play. {facebook#https://www.facebook.com/foxinfotech2014} {twitter#https://twitter.com/foxinfotech} {google#https://plus.google.com/u/0/+VKapoor/posts}
Fox Infotech. Powered by Blogger.