Home » Developer & Programmer » Forms » show many results in data block
icon5.gif  show many results in data block [message #344714] Mon, 01 September 2008 01:49 Go to next message
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?? !! Sad

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 #344747 is a reply to message #344714] Mon, 01 September 2008 03:01 Go to previous messageGo to next message
Littlefoot
Messages: 20901
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
"but it didn't work" is absolutely useless. What does it mean? What happens? Any error message? If so, which one?
Re: show many results in data block [message #344755 is a reply to message #344714] Mon, 01 September 2008 03:33 Go to previous messageGo to next message
rania$$
Messages: 11
Registered: July 2008
Junior Member
it didn't work because the block contains no results with error block146 must have at least one primary key
Re: show many results in data block [message #344863 is a reply to message #344755] Mon, 01 September 2008 08:02 Go to previous messageGo to next message
Littlefoot
Messages: 20901
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
So make at least one item in "block146" to be a primary key item.
Re: show many results in data block [message #344971 is a reply to message #344863] Tue, 02 September 2008 01:07 Go to previous messageGo to next message
rania$$
Messages: 11
Registered: July 2008
Junior Member
i created a primary key item in the block "block146" but still the results not shown in the block.. Sad
Re: show many results in data block [message #345001 is a reply to message #344971] Tue, 02 September 2008 02:21 Go to previous messageGo to next message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
Is this a new form? Do you populate the block using a cursor or did you create the block using the wizard and point it to a table?

David
Re: show many results in data block [message #345006 is a reply to message #345001] Tue, 02 September 2008 02:28 Go to previous messageGo to next message
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 #345013 is a reply to message #345006] Tue, 02 September 2008 02:34 Go to previous messageGo to next message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
How do you know when you have a 'parent project'?

David
Re: show many results in data block [message #345019 is a reply to message #345013] Tue, 02 September 2008 02:43 Go to previous messageGo to next message
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 #345025 is a reply to message #345019] Tue, 02 September 2008 02:54 Go to previous messageGo to next message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
I repeat "How do you know when you have a 'parent project'?"

David
Re: show many results in data block [message #345029 is a reply to message #344714] Tue, 02 September 2008 03:06 Go to previous messageGo to next message
rania$$
Messages: 11
Registered: July 2008
Junior Member
Sorry i didn't get the question Embarassed
Re: show many results in data block [message #345302 is a reply to message #345029] Tue, 02 September 2008 20:41 Go to previous messageGo to next message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
Each record contains data. What data value in which field makes a project a 'parent' or can any project be a 'parent'?

David
Re: show many results in data block [message #345344 is a reply to message #345302] Wed, 03 September 2008 02:46 Go to previous messageGo to next message
rania$$
Messages: 11
Registered: July 2008
Junior Member
Sir,
Yes any project can be a parent.

The screen is as follows:


http://dc86.4shared.com/download/61548273/84d78cc9/screen_shot.jpg?tsid=20080903-024155-3ae2efb8
Re: show many results in data block [message #345345 is a reply to message #345344] Wed, 03 September 2008 02:48 Go to previous messageGo to next message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
Okay, that didn't work. 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
Re: show many results in data block [message #345358 is a reply to message #345345] Wed, 03 September 2008 03:34 Go to previous messageGo to next message
rania$$
Messages: 11
Registered: July 2008
Junior Member
Hi,

I cant put links beacuse I have to restrict in the above screen design.. It must be a field.. Confused

http://www.4shared.com/file/61548273/84d78cc9/screen_shot.html

[Updated on: Wed, 03 September 2008 03:39]

Report message to a moderator

Re: show many results in data block [message #345496 is a reply to message #345358] Wed, 03 September 2008 19:36 Go to previous messageGo to next message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
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
Re: show many results in data block [message #345545 is a reply to message #345496] Thu, 04 September 2008 02:20 Go to previous message
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.
Previous Topic: Moving Item in a canvas
Next Topic: migration forms
Goto Forum:
  


Current Time: Thu Dec 08 16:30:08 CST 2016

Total time taken to generate the page: 0.08384 seconds