Home » Developer & Programmer » Forms » Why no body answer me? Is it difficult Q?
Why no body answer me? Is it difficult Q? [message #123886] Wed, 15 June 2005 07:23 Go to next message
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 Go to previous messageGo to next message
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 #123914 is a reply to message #123905] Wed, 15 June 2005 09:20 Go to previous messageGo to next message
Maaher
Messages: 7062
Registered: December 2001
Senior Member
Hi,
I suggest you read the sticky in the Newbie forum for some useful info concerning posting questions.

Some highlights:
1) choose an intelligent topic title.
In your case something like 'FRM-41334 :Invalid record group for list population.'

2) be patient. This forum is based on goodwill from other Oracle users. Most of them do have jobs and a life outside the forum.
In
3) Have the courtesy to write in plain English. If you don't it'll be harder to find out what you need.

4) be polite, don't whine if your answer doesn't get replies as quick as you'd like.
5) read the sticky
5) be patient. No kidding. Nothing acts as a better answer-repellent like impatience.

That said:
You need two (2) columns in your record group: one for the label and the other for the value.

Using just dept you can create something like this:
DECLARE
  GROUP_ID   recordgroup;
  list_id    item          := FIND_ITEM ('B.LIST4');
  status     NUMBER;
  rg_name    VARCHAR2 (40) := 'recgroup';
BEGIN
  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 DNAME, TO_CHAR(DEPTNO) FROM DEPT');
  CLEAR_LIST (list_id);
  status := POPULATE_GROUP (rg_name);
  MESSAGE (status);
  PAUSE;
  POPULATE_LIST (list_id, GROUP_ID);
END;


HTH,
MHE
Re: Why no body answer me? Is it difficult Q? [message #261541 is a reply to message #123914] Thu, 23 August 2007 00:27 Go to previous messageGo to next message
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 Go to previous messageGo to next message
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 Go to previous messageGo to next message
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 Go to previous message
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;
Previous Topic: Printing file from form to printer
Next Topic: How to customize specific canvas to run as default field during run time?
Goto Forum:
  


Current Time: Fri Dec 09 08:00:10 CST 2016

Total time taken to generate the page: 0.10573 seconds