?
Solved

toad F5 select results not the same as F9 select results

Posted on 2010-09-21
12
Medium Priority
?
2,034 Views
Last Modified: 2012-05-10
Hello experts,
I have a "select sum(Something) from x_table union sum(Something) from y_table" query and when i am executing it with f5 i get different result than executing it with f9. The F9 execution is the right one

how can i get the same results?In my vb.net application i'm getting the f5 results.

Thanks in advance!
0
Comment
Question by:spiral2007
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
12 Comments
 
LVL 28

Expert Comment

by:Naveen Kumar
ID: 33723721
i can get the same results for a sample query which i tried both with F5 and F9.  

But f5 is for executing a script which can even have just one sql statement in the query.

what is the exact query.. are there any other statements present in the toad window when you press f5 ?

Thanks
0
 

Author Comment

by:spiral2007
ID: 33723738
here is the query
Select sum(MANUAL_AMOUNT) from CODINSTR.FOROLOGIA_ADDRESS_DIMOTIS inner join CODINSTR.DOG on DOG.DOG_ID = FOROLOGIA_ADDRESS_DIMOTIS.DOG_ID inner join CODINSTR.DOG_CHARGE_CATEGORY ON DOG_CHARGE_CATEGORY.DOG_CHARGE_CATEGORY_ID = DOG.DOG_CHARGE_CATEGORY_ID    Where ( DOG.DOG_CHARGE_CATEGORY_ID = 1 or  DOG.DOG_CHARGE_CATEGORY_ID = 2 or  DOG.DOG_CHARGE_CATEGORY_ID = 3 or  DOG.DOG_CHARGE_CATEGORY_ID = 4 or  DOG.DOG_CHARGE_CATEGORY_ID = 5 or  DOG.DOG_CHARGE_CATEGORY_ID = 6)

union 

Select sum(MANUAL_AMOUNT) from CODINSTR.forologia_company_dieuthinsi  inner join CODINSTR.DOG on DOG.DOG_ID = forologia_company_dieuthinsi.DOG_ID inner join CODINSTR.DOG_CHARGE_CATEGORY ON DOG_CHARGE_CATEGORY.DOG_CHARGE_CATEGORY_ID = DOG.DOG_CHARGE_CATEGORY_ID   Where ( DOG.DOG_CHARGE_CATEGORY_ID = 1 or  DOG.DOG_CHARGE_CATEGORY_ID = 2 or  DOG.DOG_CHARGE_CATEGORY_ID = 3 or  DOG.DOG_CHARGE_CATEGORY_ID = 4 or  DOG.DOG_CHARGE_CATEGORY_ID = 5 or  DOG.DOG_CHARGE_CATEGORY_ID = 6)

Open in new window

0
 
LVL 7

Expert Comment

by:sumit2906
ID: 33723742
F5 is for executing as script, while F9 says execute statement. can you show us the sql stmt your are running?
0
 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

 
LVL 28

Expert Comment

by:Naveen Kumar
ID: 33723838
what is the output you are getting for that query when you use F5 and when use F9 ?
0
 

Author Comment

by:spiral2007
ID: 33724142
F5 results

SUM(MANUAL_AMOUNT)
------------------
             307.5
          14271.36

2 rows selected.

----------------------------------------------------
F9 results

550
24900
0
 
LVL 28

Expert Comment

by:Naveen Kumar
ID: 33724160
Can you give me exactly whatever is there in the toad script window before you press F5 or F9 to see whether some ; missing at some statement or something else is causing this. Probably just save it as an attachment and upload here.

Thanks,
0
 
LVL 28

Expert Comment

by:Naveen Kumar
ID: 33724176
just to test it.. can you just run the query in sqlplus and let me know what is the ouput you get in sql*plus...
0
 
LVL 3

Accepted Solution

by:
Bigboj earned 1000 total points
ID: 33732964
This can happen if You set the "Current Schema" combo, or any of the session-related settings in TOAD
This settings are affect only SQLs executed as single statement.
By default, for script execution, TOAD opens a new session with the server-defaults of session settings.
0
 
LVL 28

Assisted Solution

by:Naveen Kumar
Naveen Kumar earned 1000 total points
ID: 33733183
I understand what Bigboj is saying and may be that is the reason.

To avoid that, you can simply do a commit in the toad window and retry to check with both F5 and F9 ? This should get you the same data.
0
 

Author Comment

by:spiral2007
ID: 33734945
t
0
 

Author Comment

by:spiral2007
ID: 33735120
i don't want to close the question , i just want to accept multiple answers by nav_kum_v and Bigboj.

??
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I remember the day when someone asked me to create a user for an application developement. The user should be able to create views and materialized views and, so, I used the following syntax: (CODE) This way, I guessed, I would ensure that useā€¦
When it comes to protecting Oracle Database servers and systems, there are a ton of myths out there. Here are the most common.
This video explains at a high level with the mandatory Oracle Memory processes are as well as touching on some of the more common optional ones.
Via a live example show how to connect to RMAN, make basic configuration settings changes and then take a backup of a demo database
Suggested Courses

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question