Home » Developer & Programmer » Forms » add items to list item (form builder 6i)
add items to list item [message #315295] Mon, 21 April 2008 00:05 Go to next message
omarq
Messages: 8
Registered: May 2006
Junior Member
hi..
i want to add items to the list item manually from the sql statement which can return one or more values.. the problem is when it returns more than one value.

here is the statement:
DECLARE
V_DAY NUMBER;
begin
select distinct(to_char(SESSION_DATE,'d'))
INTO V_DAY
from cs_session_agendas
where session_date between :CS_SCHEDULE_TRANSACTIONS.DATE_FROM
and :CS_SCHEDULE_TRANSACTIONS.DATE_TO
and area_id = :CS_SCHEDULE_TRANSACTIONS.area_id;

-- here the output will be the number 3 which will be added to
the list item.
Add_List_Element('DAY_LIST', 1, V_DAY, V_DAY);

EXCEPTION
WHEN TOO_MANY_ROWS THEN
????? -- here the output will be the numbers , 1, 2, 4, 5
--how can i add these to the list item?
--even i want to use loop how can i know the number of
--reputation since it is not fixed?

end;

thanks in advance....
Re: add items to list item [message #315898 is a reply to message #315295] Wed, 23 April 2008 02:53 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Use an exclusive cursor or put the 'select' statement into a 'loop' and process each record returned, one at a time.

David
Re: add items to list item [message #315916 is a reply to message #315295] Wed, 23 April 2008 04:06 Go to previous messageGo to next message
omarq
Messages: 8
Registered: May 2006
Junior Member
THANKS....
Re: add items to list item [message #316266 is a reply to message #315916] Thu, 24 April 2008 07:24 Go to previous messageGo to next message
sinida1984
Messages: 83
Registered: September 2007
Location: India
Member
is it working now? Or else try record group.
eg:- consider below.
declare
list_id item := find_item('co_final_invoice.common_currency');
rg_name varchar2(20) := 'rg_codes';
rg_id recordgroup := find_group(rg_name);
pop_code number;
w_query varchar2(2000);
Begin
if not id_null(rg_id) then
delete_group(rg_id);
end if;
w_query := 'Select priceuom_name,code from priceuom';
rg_id := create_group_from_query(rg_name, w_query);

list_id := find_item('co_final_invoice_ted.priceuom_code');
clear_list(list_id);
pop_code := populate_group(rg_id);
populate_list(list_id, rg_id);
Re: add items to list item [message #316730 is a reply to message #315295] Mon, 28 April 2008 01:57 Go to previous message
omarq
Messages: 8
Registered: May 2006
Junior Member
thank you for the help, ill try it
Previous Topic: ORA:03115 error
Next Topic: why the "Synchronize with Item" property don't save
Goto Forum:
  


Current Time: Sun Feb 09 05:23:40 CST 2025