Hi,

I created a datasource with 2 queries with "union all". The result of this query I use with connect by statement. I tested in PL/SQL developer and all lines are shown, but when I use in a grid just some lines appear.

What is wrong?

Thanks Ricardo

asked 11 Aug '13, 16:28

Ricardo's gravatar image

Ricardo
11120
accept rate: 0%


Hi Ricardo,

If your hierarchical query contains a where clause, it can confuse the execution plan and cause a different data set to be returned. If it's your case, this blog post may help you fix the problem. If it doesn't help, please post your query and some sample data to reproduce the problem.

Regards,
Ibrahim

link

answered 12 Aug '13, 03:48

Ibrahim%20Sandalli's gravatar image

Ibrahim Sand... ♦♦
1.5k5
accept rate: 25%

Hi Ibrahim

Thank you for your reply.

I made a test using NO_MERGE hint as suggested in blog, but it didn't work.

Here is the query:

select lpad(' ', (level - 1) * 5, ' ') || status_name as status_name, quantity, hours from (select grp.name as status_name, null as status_group_name, sum(summary.quantity) as quantity, sum(summary.hours) as hours from table(mnp_presentation.show_summary_group(:id_group)) summary, GENERAL_DATA_T grp, APPLICATIONS_T apl, STATUS_T sta where summary.status_group_id = grp.general_id and summary.status_id = sta.status_id and summary.application_group = apl.application_id(+) group by grp.name union all select sta.name as status_name, grp.name as status_group_name, summary.quantity, summary.hours from table(mnp_presentation.show_summary_group(:id_group)) summary, GENERAL_DATA_T grp, APPLICATIONS_T apl, STATUS_T sta where summary.status_group_id = grp.general_id and summary.status_id = sta.status_id and summary.application_group = apl.application_id(+)) start with status_group_name is null connect by prior status_name = status_group_name

Regards Ricardo

link

answered 12 Aug '13, 08:11

Ricardo's gravatar image

Ricardo
11120
accept rate: 0%

Hi Ibrahim

I made a mistake in my source code, I fixed it.

Thanks a lot

Best regards Ricardo

link

answered 12 Aug '13, 11:22

Ricardo's gravatar image

Ricardo
11120
accept rate: 0%

Hi Ricardo,

I'm glad that your problem is solved.

Best,
Ibrahim

(12 Aug '13, 14:18) Ibrahim Sand... ♦♦
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×85
×64

Asked: 11 Aug '13, 16:28

Seen: 4,341 times

Last updated: 12 Aug '13, 14:18


© Copyright Gerger 2017