Home » Developer & Programmer » Forms » is it possible to Populate a list for a number field , using Record Group........" (forms 6i)
is it possible to Populate a list for a number field , using Record Group........" [message #627962] Tue, 18 November 2014 04:59 Go to next message
shabbier.sa
Messages: 20
Registered: May 2014
Location: UAE
Junior Member

I would like to ask "Whether is it possible to Populate a list for a number field , using Record Group........"

select desc_e, eno from emp; -- record group to populate a number field..

but it's not embracing values ...........'

could you please show me any chance of populating through RG for number field..
Re: is it possible to Populate a list for a number field , using Record Group........" [message #628050 is a reply to message #627962] Wed, 19 November 2014 09:30 Go to previous message
CraigB
Messages: 386
Registered: August 2014
Location: Utah, USA
Senior Member
Quote:
but it's not embracing values ...........'

What does this mean? Are you getting an error? If so, please post the FULL error.

It is possible to use a NUMBER with a List Item, but you have to cast the NUMBER value to a character using TO_CHAR because the List Item values are: VARCHAR, VARCHAR. For example:
DECLARE
   v_qry  VARCHAR2(1000);
   rg_name VARCHAR2(40) := 'YOUR_RG_NAME_HERE';
   rg_id  RecordGroup;
   errcode NUMBER;
   item_id Item;   
BEGIN
   v_qry := 'SELECT desc_e, TO_CHAR(eno) from EMP';
   rg_id := Find_Group(rg_name);
   IF NOT Id_Null(rg_id) THEN
      Delete_Group(rg_id);
   END IF;
   rg_id := Create_Group_From_Query(rg_name, v_qry);
   errcode := Populate_Group(rg_id);

   item_id := Find_Item('YOUR_BLOCK.YOUR_ITEM');
   
   IF ID_NULL(item_id) THEN 
      Clear_Message;
      Message('Error: Can't find item.');
      Message(' ');
      RAISE Form_Trigger_Failure;
   END IF;

   Clear_List(item_id);
   Populate_List(item_id, rg_id);
   Delete_Group(rg_id);
END IF;


Hope this helps,
Craig...
Previous Topic: how to make open office/libre office excel document on linux with oracle forms
Next Topic: The runtime process has terminated abnormally.
Goto Forum:
  


Current Time: Fri Mar 29 05:45:31 CDT 2024