show many results in data block [message #344714] |
Mon, 01 September 2008 01:49  |
rania$$
Messages: 11 Registered: July 2008
|
Junior Member |
|
|
Hi ALL,
I have table called ‘Projects’ which contains all projects details with data structure
( Prj_num number(50);
Parent_prj number(50);
Prj_title varchar(800);
Prj_completion_dat date;
Prj_status varchar2(60);)
I user the two columns (prj_num,Parent_prj) to return the childs for each project using the sql query as follows:
select lpad(' ',2*(level-1)) || to_char(prj_NUM)
from Projects
start with PARENT_prj =:master_block.prj_num
connect by prior prj_NUM = PARENT_prj)
My question:
Am using oracle forms 9i and I want to diplay the results from this query in the form screen..
So how can I use a data block to display those results.
I already have a data block” master_block” for the table projects with all columns.
I tried to create another data block “BLOCK146” with from clause query in Query Data Source Name the following query:
select lpad(' ',2*(level-1)) || to_char(prj_NUM) into :BLOCK146.item4
from Projects
start with PARENT_prj = :master_block.prj_num
connect by prior prj_NUM = PARENT_prj;
but it didn't work..
Can any body help please?? !!
Thanks alot in advanced..
[Updated on: Mon, 01 September 2008 01:52] Report message to a moderator
|
|
|
|
|
|
|
|
Re: show many results in data block [message #345006 is a reply to message #345001] |
Tue, 02 September 2008 02:28   |
rania$$
Messages: 11 Registered: July 2008
|
Junior Member |
|
|
I tried to use a cursor and i put the cursor statement in the post query because i want the results to be shown after the user press run query but i have many problems on that like
Illegal restricted procedure next_record in post-query trigger
and this the cursor i used.
declare cursor C1 is select lpad(' ',2*(level-1)) || to_char(prj_NUM)
from projetcs
start with PARENT_prj= :master_block.prj_NUM
connect by prior prj_NUM = PARENT_prj;
Begin
open C1;
loop
fetch C1 into :BLOCK149.prj;
exit when C1%notfound;
next_record;
end loop;
close C1;
first_record;
end;
|
|
|
|
Re: show many results in data block [message #345019 is a reply to message #345013] |
Tue, 02 September 2008 02:43   |
rania$$
Messages: 11 Registered: July 2008
|
Junior Member |
|
|
in the table i have coulmn called project number and another coulmn called parent project number as i mentioned above so from the results returned from the query
select lpad(' ',2*(level-1)) || to_char(prj_NUM)
from Projects
start with PARENT_prj =:master_block.prj_num
connect by prior prj_NUM = PARENT_prj)
will return all the childs for the project if he has any..
[Updated on: Tue, 02 September 2008 02:44] Report message to a moderator
|
|
|
|
|
|
|
|
|
|
Re: show many results in data block [message #345545 is a reply to message #345496] |
Thu, 04 September 2008 02:20  |
rania$$
Messages: 11 Registered: July 2008
|
Junior Member |
|
|
djmartin wrote on Wed, 03 September 2008 19:36 | Well you screwed up your response two ways!! You didn't answer the question and you posted your image outside of the forum and onto a restricted website!!
Answer the sodding question!! "How about telling us the contents of a column that would mark a project as being a parent. Or can any project be a parent project, all it needs is someone linked to it?"
David
|
Ok sorry for that. I will search my question some where else. I don't want to screw my answers more..
Thanks alot.
|
|
|