Home » Developer & Programmer » Forms » Populate List Item (Oracle Dev Suite 10g, Windows XP)
Populate List Item [message #302768] |
Wed, 27 February 2008 00:02  |
mail2cmin
Messages: 3 Registered: January 2007
|
Junior Member |
|
|
Hi
I have coded the following at form level trigger to populate list item using record groups.But I am unable to succeed.
Pls go through the code and help me.
-----------------------------------------------------------------
/*
** Built-in: CREATE_GROUP_FROM_QUERY
**Example: Create a record group from a query, and populate it.
*/
DECLARE
list_id ITEM;
list_name VARCHAR2(40) := 'ENAME';
rg_name VARCHAR2(40) := 'Employee_Names';
rg_id RecordGroup;
errcode NUMBER;
outcome NUMBER;
BEGIN
/*
** Make sure group doesn't already exist
*/
list_id :=Find_Item(list_name);
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 ENAME FROM EMP');
END IF;
IF Not Id_Null(rg_id) THEN
Message('Record Group Created');
END IF;
/*
** Populate the record group
*/
errcode := Populate_Group( rg_id );
IF errcode = 0 THEN
outcome := GET_GROUP_ROW_COUNT(rg_id);
Message(outcome);
END IF;
Retrieve_List(list_id, rg_id);
Clear_List(list_id);
Populate_List(list_id, rg_id);
END;
-----------------------------------------------------------------
|
|
|
|
|
Re: Populate List Item [message #302806 is a reply to message #302800] |
Wed, 27 February 2008 01:16   |
mail2cmin
Messages: 3 Registered: January 2007
|
Junior Member |
|
|
Yes I have successfully done with the solution given by Vamsi Kasina.
It is a small change in the SELECT query.
Here it is......
-----------------------------------------------------------------
PROCEDURE Pop_List IS
/*
** Built-in: CREATE_GROUP_FROM_QUERY
**Example: Create a record group from a query, and populate it.
*/
list_id ITEM;
list_name VARCHAR2(40) := 'BLOCK3.item';
rg_name VARCHAR2(40) := 'Employee_Names';
rg_id RecordGroup;
errcode NUMBER;
outcome NUMBER;
BEGIN
/*
** Make sure group doesn't already exist
*/
list_id :=Find_Item(list_name);
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 ENAME,ENAME FROM EMP',FORM_SCOPE,200);
END IF;
IF Not Id_Null(rg_id) THEN
delete_group(rg_id);
rg_id := Create_Group_From_Query( rg_name,'SELECT ENAME,ENAME FROM EMP',FORM_SCOPE,200);
END IF;
/*
** Populate the record group
*/
errcode := Populate_Group_with_query( rg_id,'SELECT ENAME,ENAME FROM EMP' );
IF errcode = 0 THEN
outcome := GET_GROUP_ROW_COUNT(rg_id);
Message(outcome);
END IF;
Clear_List(list_id);
Populate_List(list_id,rg_id);
END;
-----------------------------------------------------------------
|
|
|
|
|
|
Goto Forum:
Current Time: Tue Apr 29 07:23:36 CDT 2025
|