|
|
|
Re: Problem comes in when-list-change [message #145587 is a reply to message #145478] |
Fri, 04 November 2005 00:18 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) |
![](/forum/images/custom_avatars/67467.jpg) |
djmartin
Messages: 10181 Registered: March 2005 Location: Surges Bay TAS Australia
|
Senior Member Account Moderator |
|
|
You seem to be having the same problem as http://www.orafaq.com/forum/t/54531/67467/.
You have DECLARE
A NUMBER;
REC RECORDGROUP;
BEGIN
REC:=CREATE_GROUP_FROM_QUERY('DEPTNO','SELECT DEPTNO,DEPTNO FROM EMP');
IF NOT ID_NULL(REC) THEN
A:=POPULATE_GROUP(REC);
POPULATE_LIST('DEPTNO',REC);
END IF;
END; but the reference manual says/*
** Built-in: CREATE_GROUP_FROM_QUERY
** Example: Create a record group from a query, and populate it.
*/
DECLARE
rg_name VARCHAR2(40) := 'Salary_Range';
rg_id recordgroup;
errcode NUMBER;
BEGIN
/*
** Make sure group doesn't already exist
*/
rg_id := Find_group(rg_name);
/*
** If it does not exist, create it and add the two
** necessary columns to it.
*/
IF Id_null(rg_id) THEN
rg_id := Create_group_from_query(rg_name,
'SELECT SAL-MOD(SAL,1000) BASE_SAL_RANGE,' || 'COUNT(EMPNO) EMPS_IN_RANGE ' || 'FROM EMP ' || 'GROUP BY SAL-MOD(SAL,1000) ' || 'ORDER BY 1');
END IF;
/*
** Populate the record group
*/
errcode := Populate_group(rg_id);
END;
I suggest that you try this structure for the population of your group.
David
|
|
|