Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Dynamic LOV

Dynamic LOV

From: FromMe <sick_at_heart.net>
Date: Sat, 22 Sep 2001 20:10:08 -0400
Message-ID: <9oja4u$qt$1@bob.news.rcn.net>


I am trying to understand how to populate list items dynamically. I am trying to do this with creating a queryable record group. I put the code in the key-listval trigger on the deptno field.

The code I tried below (What am I doing wrong?):

DECLARE
 RG_ID RECORDGROUP;
 RG_NAME VARCHAR2(8) := 'RG_DEPT';  QUERY_STRING VARCHAR2(80) := 'SELECT TO_CHAR(DEPTNO), DNAME FROM DEPT ORDER BY DNAME';
 RET_CODE NUMBER;
BEGIN
 /* First check whether the record group already exists.

    If yes, delete it.
*/

 rg_id := FIND_GROUP(rg_name);
 IF NOT ID_NULL(RG_ID) THEN
  DELETE_GROUP(RG_ID);
 END IF;  /* Create the record group from an input query to derive a handle or

    internal id, as well as the column structure
*/

 RG_ID := CREATE_GROUP_FROM_QUERY(RG_NAME, QUERY_STRING);  IF ID_NULL(RG_ID) THEN
  MESSAGE('ERR: Creating Record Group' || RG_NAME);   RAISE FORM_TRIGGER_FAILURE;
 END IF;  /* Populate the created record group with data from the query used to

    create the group. This need not be done in a loop.
*/

-- RET_CODE := POPULATE_GROUP_WITH_QUERY(RG_ID, 'SELECT TO_CHAR(DEPTNO),DNAME FROM DEPT');  RET_CODE := POPULATE_GROUP(RG_ID);
 IF (RET_CODE IS NOT NULL AND RET_CODE <> 0) THEN   MESSAGE('ERR: Populating Group');
  RAISE FORM_TRIGGER_FAILURE;
 END IF;

Received on Sat Sep 22 2001 - 19:10:08 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US