Why no body answer me? Is it difficult Q? [message #123886] |
Wed, 15 June 2005 07:23 |
jtech
Messages: 3 Registered: June 2005 Location: U.K
|
Junior Member |
|
|
Hi PALs,
I'm trying to fill my combo box by accNo column in the clients
table, so I wrote this code and an error accured...
..........The code:
DECLARE
group_id RecordGroup;
list_id Item := Find_Item('B.LIST4');
status NUMBER;
rg_name varchar2(40) := 'recgroup';
BEGIN
clear_list(list_id);
group_id := Find_Group(rg_name);
IF NOT id_null(group_id) then
Delete_Group(group_id);
End if;
group_id := Create_Group_From_Query(rg_name,
'SELECT ACC FROM PRO');
status := Populate_Group(rg_name);
Populate_List(list_id, group_id);
END;
........The error:
FRM-41334 :Invalid record group for list population.
So can tell me what is the problem? Can you help me? I will be pleasure.
PLZ give me full answer.
|
|
|
Re: Why no body answer me? Is it difficult Q? [message #123905 is a reply to message #123886] |
Wed, 15 June 2005 08:54 |
nilesh1610
Messages: 2 Registered: June 2005
|
Junior Member |
|
|
Hi,
Your Code is perfectly right, Just make following changes marked in Bold & blue. if this doesn't work then pls let me know.
Whenever u create a Query from the Group u have to give alias to the Column name.
DECLARE
group_id RecordGroup;
list_id Item := Find_Item('B.LIST4');
status NUMBER;
rg_name varchar2(40) := 'recgroup';
BEGIN
clear_list(list_id);
group_id := Find_Group(rg_name);
IF NOT id_null(group_id) then
Delete_Group(group_id);
End if;
group_id := Create_Group_From_Query(rg_name,
'SELECT ACC, ACC FROM PRO');
status := Populate_Group(rg_name);
Populate_List(list_id, group_id);
END;
|
|
|
|
Re: Why no body answer me? Is it difficult Q? [message #261541 is a reply to message #123914] |
Thu, 23 August 2007 00:27 |
james_aron
Messages: 32 Registered: July 2007 Location: chennai
|
Member |
|
|
hi nilesh1610,
I had this same problem and tooo i post one thread for this problem. but i did'nt get any solution. while i browse,i found the solution in this thread.
Many thanks to nilesh1610 and special thanks to jtech for posting this thread.
>>>'SELECT ACC, ACC FROM PRO');
and can any-one explain me why we have to give 2 same column name to populate list.
regards,
jame
[Updated on: Thu, 23 August 2007 00:29] Report message to a moderator
|
|
|
Re: Why no body answer me? Is it difficult Q? [message #261580 is a reply to message #261541] |
Thu, 23 August 2007 01:31 |
Flyhard
Messages: 21 Registered: April 2007 Location: Germany
|
Junior Member |
|
|
james_aron wrote on Thu, 23 August 2007 07:27 | hi nilesh1610,
I had this same problem and tooo i post one thread for this problem. but i did'nt get any solution. while i browse,i found the solution in this thread.
Many thanks to nilesh1610 and special thanks to jtech for posting this thread.
>>>'SELECT ACC, ACC FROM PRO');
and can any-one explain me why we have to give 2 same column name to populate list.
regards,
jame
|
You do not need 2 same columns. The first is the Label, the Second is the Value. Please read the documentations...
|
|
|
Re: Why no body answer me? Is it difficult Q? [message #261585 is a reply to message #261541] |
Thu, 23 August 2007 01:39 |
bbaz
Messages: 138 Registered: April 2007
|
Senior Member |
|
|
Quote: |
and can any-one explain me why we have to give 2 same column name to populate list.
|
YOU NEED TO SELECT 2 FIELDS/COLUMN, ONE IS FOR THE LIST ELEMENT (Displayed for the USER) and the OTHER is for the LIST ITEM VALUE (which is the value behind the display element once selected). THE TWO FIELDS CAN BE THE SAME AND CAN BE DIFFERENT.
ex:
select DNAME, DEPTNO from DEPT;
So what you display is the DEPT NAME, and the Value behind your selection will be the DEPTNO.
Hope this clarifies your doubts.
Regards,
Baz
|
|
|
Re: Why no body answer me? Is it difficult Q? [message #359501 is a reply to message #261585] |
Sun, 16 November 2008 23:37 |
raghavendrajsv
Messages: 3 Registered: March 2008 Location: bangalore
|
Junior Member |
|
|
DECLARE
V_RECORD_GROUP RECORDGROUP;
V_STATUS NUMBER;
V_SQL VARCHAR2(1500);
BEGIN
V_SQL:='SELECT ENAME,ENAME FROM EMP ';
V_RECORD_GROUP := CREATE_GROUP_FROM_QUERY('V_RECORD_GROUP',V_SQL);
IF ID_NULL(V_RECORD_GROUP) THEN
MESSAGE('RAO 1');MESSAGE('RAO 1');
END IF;
V_STATUS:=POPULATE_GROUP('V_RECORD_GROUP');
IF V_STATUS=1 THEN
MESSAGE('RAO 2');MESSAGE('RAO 2');
END IF;
POPULATE_LIST('EMP1.ENAME',V_RECORD_GROUP);
END;
|
|
|