Home » Developer & Programmer » Forms » About List item
About List item [message #177369] Wed, 14 June 2006 06:35 Go to next message
vidya2005
Messages: 36
Registered: July 2005
Location: bangalore
Member
Hi,

I have one doubt about list item
how to get database values into list item at run time.
How to use add_list_elemment procedure? Can anybody explain about this.

Thanks
Vidya
Re: About List item [message #177500 is a reply to message #177369] Thu, 15 June 2006 02:29 Go to previous messageGo to next message
Maaher
Messages: 7065
Registered: December 2001
Senior Member
And Forms Help did not help you out? What version are you on?

MHE
icon9.gif  Re: About List item [message #177539 is a reply to message #177500] Thu, 15 June 2006 06:45 Go to previous messageGo to next message
vidya2005
Messages: 36
Registered: July 2005
Location: bangalore
Member
Hi MHE

I am using oracle 9i. Can you please tell me how to get the data
from data base into list item.

I created the list item taken from tool box.
I have set the property to Combo Box.

In new block instance trigger I used the add_list_item
but it is notworking. How to do.
Please help


Thanks
Vidya
Re: About List item [message #177551 is a reply to message #177539] Thu, 15 June 2006 08:02 Go to previous messageGo to next message
Maaher
Messages: 7065
Registered: December 2001
Senior Member
In the when-new-form-instance:
1. clear the item
2. add elements (from a cursor).

Something like this will do:
DECLARE
	CURSOR employee_cursor
	IS
	SELECT ROWNUM rn
	     , last_name
	     , employee_id
	FROM ( SELECT last_name
	            , to_char(employee_id) employee_id
	       FROM   employees
	       ORDER  BY last_name
	     );
BEGIN
	CLEAR_LIST('MYBLOCK.MYLIST');
	
	FOR employee_record IN employee_cursor
	LOOP
		ADD_LIST_ELEMENT( 'MYBLOCK.MYLIST'
		                , employee_record.rn
		                , employee_record.last_name
		                , employee_record.employee_id
		                ); 
	END LOOP;
END;


This example is based on the demo schema HR in Oracle 9i. It will fill the list element with all the employees displaying the last_name and having employee_id as value.

MHE
icon7.gif  Re: About List item [message #177748 is a reply to message #177551] Fri, 16 June 2006 07:20 Go to previous messageGo to next message
vidya2005
Messages: 36
Registered: July 2005
Location: bangalore
Member
Hi MHE,

Thanks a lot for help. I will try with the code mentioned by you.

Regards,
Vidya
Re: About List item [message #178077 is a reply to message #177369] Mon, 19 June 2006 06:06 Go to previous messageGo to next message
vidya2005
Messages: 36
Registered: July 2005
Location: bangalore
Member
Hi MHE,

Is it possible to add the values to list item without using
cursor.Cursor is the only way to add the values to list item
by writing procedure. Without writing procedure can't we
add the values.

Please reply.

Thanks
Vidya
Re: About List item [message #178093 is a reply to message #178077] Mon, 19 June 2006 06:37 Go to previous message
Maaher
Messages: 7065
Registered: December 2001
Senior Member
Well, you wanted database values. Those values are typically stored in a table. The only way to get those values out of the table into pl/sql is through a cursor (explicit or implicit). But you can add values as you please. Just call the ADD_LIST_ELEMENT built-in for each value you want to add. I'm not sure what's the problem with a cursor though...

MHE
Previous Topic: Create compliation File FMX to Another Location
Next Topic: problem with trigger
Goto Forum:
  


Current Time: Fri Sep 20 09:25:45 CDT 2024