Report Query shows different result when executed manually
Hi!
When I run our report I'll get 7577 distinct rows.
From here on I copied the SQL query with SQL inspector, then pasted it in Oracle SQL Developer and replaced the user variable with the same value I entered when I ran the report from within Oracle Discoverer Desktop.
But when I run this query I'll get 10925 distinct rows.
How is that even possible??? I think the SQL inspector is supposed to print the exact same query which he used to display the data in the report? Am I missing something here?
Thanks in advance!
I found my error.
I queried v$sql to get the real quey sent to the database and then saw how it actually got processed. I'ts ok now.
Similar Messages
-
SQL Query produces different results when inserting into a table
I have an SQL query which produces different results when run as a simple query to when it is run as an INSERT INTO table SELECT ...
The query is:
SELECT mhldr.account_number
, NVL(MAX(DECODE(ap.party_sysid, mhldr.party_sysid,ap.empcat_code,NULL)),'UNKNWN') main_borrower_status
, COUNT(1) num_apps
FROM app_parties ap
SELECT accsta.account_number
, actply.party_sysid
, RANK() OVER (PARTITION BY actply.table_sysid, actply.loanac_latype_code ORDER BY start_date, SYSID) ranking
FROM activity_players actply
, account_status accsta
WHERE 1 = 1
AND actply.table_id (+) = 'ACCGRP'
AND actply.acttyp_code (+) = 'MHLDRM'
AND NVL(actply.loanac_latype_code (+),TO_NUMBER(SUBSTR(accsta.account_number,9,2))) = TO_NUMBER(SUBSTR(accsta.account_number,9,2))
AND actply.table_sysid (+) = TO_NUMBER(SUBSTR(accsta.account_number,1,8))
) mhldr
WHERE 1 = 1
AND ap.lenapp_account_number (+) = TO_NUMBER(SUBSTR(mhldr.account_number,1,8))
GROUP BY mhldr.account_number; The INSERT INTO code:
TRUNCATE TABLE applicant_summary;
INSERT /*+ APPEND */
INTO applicant_summary
( account_number
, main_borrower_status
, num_apps
SELECT mhldr.account_number
, NVL(MAX(DECODE(ap.party_sysid, mhldr.party_sysid,ap.empcat_code,NULL)),'UNKNWN') main_borrower_status
, COUNT(1) num_apps
FROM app_parties ap
SELECT accsta.account_number
, actply.party_sysid
, RANK() OVER (PARTITION BY actply.table_sysid, actply.loanac_latype_code ORDER BY start_date, SYSID) ranking
FROM activity_players actply
, account_status accsta
WHERE 1 = 1
AND actply.table_id (+) = 'ACCGRP'
AND actply.acttyp_code (+) = 'MHLDRM'
AND NVL(actply.loanac_latype_code (+),TO_NUMBER(SUBSTR(accsta.account_number,9,2))) = TO_NUMBER(SUBSTR(accsta.account_number,9,2))
AND actply.table_sysid (+) = TO_NUMBER(SUBSTR(accsta.account_number,1,8))
) mhldr
WHERE 1 = 1
AND ap.lenapp_account_number (+) = TO_NUMBER(SUBSTR(mhldr.account_number,1,8))
GROUP BY mhldr.account_number; When run as a query, this code consistently returns 2 for the num_apps field (for a certain group of accounts), but when run as an INSERT INTO command, the num_apps field is logged as 1. I have secured the tables used within the query to ensure that nothing is changing the data in the underlying tables.
If I run the query as a cursor for loop with an insert into the applicant_summary table within the loop, I get the same results in the table as I get when I run as a stand alone query.
I would appreciate any suggestions for what could be causing this odd behaviour.
Cheers,
Steve
Oracle database details:
Oracle Database 10g Release 10.2.0.2.0 - Production
PL/SQL Release 10.2.0.2.0 - Production
CORE 10.2.0.2.0 Production
TNS for 32-bit Windows: Version 10.2.0.2.0 - Production
NLSRTL Version 10.2.0.2.0 - Production
Edited by: stevensutcliffe on Oct 10, 2008 5:26 AM
Edited by: stevensutcliffe on Oct 10, 2008 5:27 AMstevensutcliffe wrote:
Yes, using COUNT(*) gives the same result as COUNT(1).
I have found another example of this kind of behaviour:
Running the following INSERT statements produce different values for the total_amount_invested and num_records fields. It appears that adding the additional aggregation (MAX(amount_invested)) is causing problems with the other aggregated values.
Again, I have ensured that the source data and destination tables are not being accessed / changed by any other processes or users. Is this potentially a bug in Oracle?Just as a side note, these are not INSERT statements but CTAS statements.
The only non-bug explanation for this behaviour would be a potential query rewrite happening only under particular circumstances (but not always) in the lower integrity modes "trusted" or "stale_tolerated". So if you're not aware of any corresponding materialized views, your QUERY_REWRITE_INTEGRITY parameter is set to the default of "enforced" and your explain plan doesn't show any "MAT_VIEW REWRITE ACCESS" lines, I would consider this as a bug.
Since you're running on 10.2.0.2 it's not unlikely that you hit one of the various "wrong result" bugs that exist(ed) in Oracle. I'm aware of a particular one I've hit in 10.2.0.2 when performing a parallel NESTED LOOP ANTI operation which returned wrong results, but only in parallel execution. Serial execution was showing the correct results.
If you're performing parallel ddl/dml/query operations, try to do the same in serial execution to check if it is related to the parallel feature.
You could also test if omitting the "APPEND" hint changes anything but still these are just workarounds for a buggy behaviour.
I suggest to consider installing the latest patch set 10.2.0.4 but this requires thorough testing because there were (more or less) subtle changes/bugs introduced with [10.2.0.3|http://oracle-randolf.blogspot.com/2008/02/nasty-bug-introduced-with-patch-set.html] and [10.2.0.4|http://oracle-randolf.blogspot.com/2008/04/overview-of-new-and-changed-features-in.html].
You could also open a SR with Oracle and clarify if there is already a one-off patch available for your 10.2.0.2 platform release. If not it's quite unlikely that you are going to get a backport for 10.2.0.2.
Regards,
Randolf
Oracle related stuff blog:
http://oracle-randolf.blogspot.com/
SQLTools++ for Oracle (Open source Oracle GUI for Windows):
http://www.sqltools-plusplus.org:7676/
http://sourceforge.net/projects/sqlt-pp/ -
FSV showing different values when executed by different users
Hi Experts,
While executing FSV throug RFBILA00 we are getting different values when executed by differet users. Variant selection is same except the user (which is different). For one user report is perfect for another user some GL accounts were not displayed and some accounts shows different values.
Anybody could help on this. Is there any userwise settings are there.
Thanks in advance.
Regards,
NarayananHi,
check user authorization, maybe one user has limited display authorization for some values (as they are linked to specific profit center,...)
BR Christian -
Variance Scaling in Query and Web Template Showing Different Results
Hi experts,
I have the following problem - variance scaling in my query and web template are showing different results.
My variance in column is set as follows:
Formula: NODIM(A % B)
Scaling Factor: 1
I have a structure in row that uses Scaling Factor of 1,000.
Let say the value of Column A is 120 and Column B is 100.
When I execute the query, it will show 0.02
However, when I execute the web template it will show the correct scaling i.e. 20.
May I know what can I do to correct above scaling error?
Thank you!You can not remove the scalling factor, but once you check the checkbox below the dropdown menu, the scalling factor will go away.
I checked at my end and when I set the scalling fact as 1, I was getting 9.9% while I was expecting 9900%. When I removed the scalling factor I started getting 9900%.
I would let you know if I came across anything else.
What about the unit of Column A and B. Are they same or different?
- Danny
Edited by: Danny Matt on Jun 22, 2009 1:54 PM -
On starting BI Server Report is showing 0 Result
I have facing a strange problem.One report is showing 0 Result on starting server,checked back end query,it shows it is hitting some other fact,tht'why measure is not found and cast Null as 0 is happening.
Strange thing is when I pull some other column from the same fact (But different Presentation table,same Logical table and Same LTS) along with my required measure it is showing data,hitting correct fact.But If I restart the server,again 0 result is coming.
I disabled cache and restarted,still the issue is coming.
I thought from BMM Layer the measure is not getting correct joins.
So I check all logical and physical join with conformed dimensions with Logical Fact.All are ok.
Measure has 2 definition at two LTS.
1.CASE "Oracle Data Warehouse"."Catalog"."dbo"."Fact_W_ORDERITEM_F"."TOP_LVL_LN_FLG" WHEN 'Y' THEN "Oracle Data Warehouse"."Catalog"."dbo"."Fact_W_ORDERITEM_F"."ROW_WID" END
2."Oracle Data Warehouse"."Catalog"."dbo"."Fact_W_ORDER_F"."NUM_ORDER_ITMS"
Please suggest possible reason.
Edited by: 980674 on Jan 8, 2013 9:04 PM
Edited by: 980674 on Jan 9, 2013 7:12 AMSay the data is like this.
Material Sold to Party Act Bud
M1 S1 100 0
M1 # 0 50
M1 S2 200 0
And you want to see like below.
Material Sold to Party Act Bud
M1 S1 100 50
M1 S2 200 50
If this is your requirement, let the sold to party be in Rows.
In columns, for budget, create a local selection, drag budget kf, sold to party (restrict this by # and right click and choose constant selection). This makes the budget kf independent of what is coming in the rows and always shows data corresponding to sold to party #. Hope this is clear. -
Dba_index_name and dba_ind_columns showing different results
Hi All,
I am confused why it is showing different results:
[email protected]#>select index_name from dba_indexes where table_name='CRBTPROV_FINAL';
INDEX_NAME
CRBTPROV_INDX1
[email protected]#>select index_name from dba_IND_COLUMNS where table_name='CRBTPROV_FINAL';
INDEX_NAME
CRBTPROV_INDX1
MSISDN_IDX
When trying to drop index MSISDN_IDX it gives error:
ERROR at line 1:
ORA-00054: resource busy and acquire with NOWAIT specified
But when trying to check where all the index is used using v$access:
select * from v$access where object='MSISDN_IDX';
no rows selected
Regards,
KirtiIf I run the following query on a 9.2.0.6 database, no index is listed:
select type, count(*) from v$access group by type;CURSOR
FUNCTION
NON-EXISTENT
PACKAGE
SEQUENCE
SYNONYM
TABLE
TRIGGER
VIEW
It seems that index is not taken into account by v$access ? -
Same Query returning different result (Different execution plan)
Hi all,
To day i have discovered a strange thing: a query that return a different result when using a different execution plan.
The query :
SELECT *
FROM schema.table@database a
WHERE column1 IN ('3')
AND column2 = '101'
AND EXISTS
(SELECT null
FROM schema.table2 c
WHERE a.column3 = SUBSTR (c.column1, 2, 12));where schema.table@database is a remote table.
when executed with the hint /*+ ordered use_nl(a c) */ these query return no result and its execution plan is :
Rows Row Source Operation
0 NESTED LOOPS (cr=31 r=0 w=0 time=4894659 us)
4323 SORT UNIQUE (cr=31 r=0 w=0 time=50835 us)
4336 TABLE ACCESS FULL TABLE2 (cr=31 r=0 w=0 time=7607 us)
0 REMOTE (cr=0 r=0 w=0 time=130536 us)When i changed the execution plan with the hint /*+ use_hash(c a) */
Rows Row Source Operation
3702 HASH JOIN SEMI (cr=35 r=0 w=0 time=497839 us)
22556 REMOTE (cr=0 r=0 w=0 time=401176 us)
4336 TABLE ACCESS FULL TABLE2 (cr=35 r=0 w=0 time=7709 us)It seem that when the execution plan have changed the remote query return no result.
It'is a bug or i have missed somthing ?
PS: The two table are no subject to insert or update statement.
Oracle version : 9.2.0.2.0
System version : HP-UX v1
Thanks.H.Mahmoud wrote:
Oracle version : 9.2.0.2.0
System version : HP-UX v1Hard to say. You're using a very old and deprecated version of the database, and one that was known to contain bugs.
9.2.0.7 was really the lowest version of 9i that was considered to be 'stable', but even so, it's old and lacking in many ways.
Consider upgrading to the latest database version at your earliest opportunity. (or at least apply patches up to the latest 9i version before querying if there is bugs in your really low buggy version) -
Same query giving different results
Hi
I m surprised to see the behaviour of oracle. I have two different sessions for same scheema on same server. In both sessions same query returns different results. The query involves some calculations like sum and divisions on number field.
I have imported this data from another server using export / import utility available with 9i server. Before export every thing was going fine. Is there some problem with this utility.
I m using Developer 6i as the front end for my client server application. The behaviour of my application is very surprizing as once it shows the correct data and if I close the screen and reopen, it shows wrong data.
I m really stucked with the abnormal behaviour. Please tell me the possiblities and corrective action for these conditions.
Regards
Asad.There is nothing uncommitted in both the sessions. But still different results are returned.
I m sending u the exact query and result returned in both sessions.
Session 1:
SQL> rollback;
Rollback complete.
SQL> SELECT CC.CREDIT_HRS,GP.GRADE_PTS
2 FROM GRADE G, COURSE_CODE CC, GRADE_POLICY GP
3 WHERE G.COURSE_CDE=CC.COURSE_CDE
4 AND G.SELECTION_ID=45 AND G.GRADE_TYP=GP.GRADE_TYP
5 AND G.TERM_PROG_ID=17 AND GP.TERM_ID=14
6 /
CREDIT_HRS GRADE_PTS
3 4
4 3.33
4 3.33
3 4
3 4
3 4
3 4
7 rows selected.
SQL>
SESSION 2:
SQL> rollback;
Rollback complete.
SQL> SELECT CC.CREDIT_HRS,GP.GRADE_PTS
2 FROM GRADE G, COURSE_CODE CC, GRADE_POLICY GP
3 WHERE G.COURSE_CDE=CC.COURSE_CDE
4 AND G.SELECTION_ID=45 AND G.GRADE_TYP=GP.GRADE_TYP
5 AND G.TERM_PROG_ID=17 AND GP.TERM_ID=14
6 /
CREDIT_HRS GRADE_PTS
3 4
4 3.33
3 4
3 4
3 4
3 4
6 rows selected.
SQL>
U can see in session 1, seven rows are returned while in session 2 six rows are returned. I have issued a rollback before query to be sure that data in both sessions is same. -
ODS and Infocube showing different results
Hi,
I loaded same data to Infocube and ODS but they are both showing different result in BEX.
ODS
ODS report is showing summarised values e.g
vendor order value invoice value date
00001 20 20 01.01.2007
Infocube
result is showing not summarised values
vendor order value invoice value date
00001 20 0 0
0 20 01.01.2007
I would like to make the infocube result same as the ODS because I am remodelling so that we start reporting from Infocube rather than ODS.
thanksHi,
this is the scenario
currently we are reporting from ODS object which fetch data from 3 ODSes. now I am asked to remodel so that we can report from infocube not ODS.
steps I have taken so far.
- created new infocube
- created 3 update rules ( same Update rules that gives the reporting ODS data).
my target is to make sure that the current ODS report is the same as the infocube report but so far the report is not consistent
I compared the data in the ODS and infocube and they are exactly the same but the report is showing differently -
Why different types of peak detectors show different results?
In my project i need to insert a peak detector but when i use different types of peak detectors they show different results. why is this so?
I also find the thresholds used will give different results.
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines -
I have a problem while typing in my MacBook pro. it is showing different characters when i type. for example: qw`e§r]t[y= this is how when we type "qwerty|" can anyone help me pls?
You could just try changing your Input Sources under System Preferences>Language & Text:
But I kind of doubt that's going to work. It may be a hardware problem or a system problem. If you take it into Apple they might be able to determine which and might advise a reinstallation of System software. I would take it to an Apple Store or an AASP but, first, make sure that you have a backup just in case they suggest a clean install of the system.
Good luck,
Clinton -
How To Make Search Query Showing the Result As List of Buttons.
Can some one give me an idea how to start to make a Search Query showing the results as list of buttons.. i have already have my buttons with names. i just dont know how to make a search query.
this is my on screen keyboard i made..
im making a system that the result were a list of buttons.. showing like this
This was supposed to be the output of the query that i need to do..
Please help me.. i just need a idea or tips how to make this one.Here is code I posted recently for another question
Public Class Form1
Const BUTTON_SIZE As Integer = 20
Const SPACE As Integer = 5
Sub New()
' This call is required by the Windows Form Designer.
InitializeComponent()
' Add any initialization after the InitializeComponent() call.
Dim buttons As New List(Of List(Of MyRadioButton))
For row = 1 To 6
Dim newRow As New List(Of MyRadioButton)
buttons.Add(newRow)
For col = 1 To 6
Dim button As New MyRadioButton()
button.row = row
button.col = col
button.Height = BUTTON_SIZE
button.Width = BUTTON_SIZE
button.Left = col * (BUTTON_SIZE + SPACE)
button.Top = row * (BUTTON_SIZE + SPACE)
button.Name = String.Format("radGr1{0}_{1}", row.ToString(), col.ToString())
Me.Controls.Add(button)
newRow.Add(button)
AddHandler button.CheckedChanged, AddressOf Radio_Change
Next col
Next row
End Sub
Private Sub Radio_Change(ByVal sender As Object, ByVal e As System.EventArgs)
Dim button As MyRadioButton = CType(sender, MyRadioButton)
Dim row As Integer = button.row
Dim col As Integer = button.col
End Sub
End Class
Public Class MyRadioButton
Inherits RadioButton
Public row As Integer
Public col As Integer
End Class
jdweng -
Web Part showing different result in different regions
Hi All,
We have a
stock web-part which is integrated into our SharePoint site . And this stock web-part is showing different result in different regions .As the output of the web-part is perfect in India,US,UK and working quite opposite in Singapore,china and Malaysia.Can
any one help me how can I solve the issue
SamarHi Samar,
As the stock web part is a custom web part, we cannot know how it works. For this issue, I suggest you ask the web part developers or support for help.
Best Regards,
Wendy
Wendy Li
TechNet Community Support -
I get different result when I paste with mouse and shift+ins
Sometimes I get different result when I paste the clipboard content with mouse and shift+insert key combination. Why? What can I do to stop this annoyance?
Just to add a little to the above, there really is no universally applied standard (not even close) for how the primary, secondary, and clipboard buffers should be used. Any X program can use them however they wish. But there are some common patterns: selected text should be placed in the primary buffer, and X pastes from the primary buffer with either middle click or shift-ins by default.
This default can (and unfortunately often is) overriden by clipboard managers - I don't know why they don't stay true to their name and just manage the clipboard buffer, but they often don't.
<mini rant>with no clipboard tools installed, selected text in any program I have is in the primary selection, and shift+ins or middle click paste from this primary selection. Ctrl-C/Ctrl-V post to/from the clipboard buffer. No need for extra tools. If I install any clipboard manager, this default sanity of X11 goes strait to s(&*Y. I don't like clipboard managers </mini rant> <mini praise> X11 is great without any of that cruft added </mini praise>
Last edited by Trilby (2013-06-15 03:12:39) -
Hello
I'm currently developping an image processing algorithm using Labview 7.1 and the associated IMAQ Vision tools. After several tests, I found a weird result. Indeed, I put the labview algorithm - including the IMAQ VI on the library to get sure that I use all the time the same VI - on my memory stick and used it on two different computers. I tested the same picture (still in my memory stick) and had two very different results.
After several hours trying to understand why, I found that there were a difference between the results given by both computers at the very begining of the algorithm. Indeed, I used a JPEG file.
To open it, I first create an Image with IMAQ Create (U8). Then, I open it.
Then in my first sub-VI, I use IMAQ Cast Image to be sure that the picture is a U8 grayscale picture.
Right after that, I use the IMAQ Linear Averages. The results of this VI are different on the two computers.
I tried several time on the same picture : one computer always give me the same result but the two computers give me a different result. So there is no random variable on the results.
So my question is : Do IMAQ Cast Image or IMAQ Linear averages give different results when using different computers that are running under Windows XP ?
My bet is on IMAQ Cast Image but I'm not quite sure and I do not undestand why. The labview and IMAQ are the same on both computers.
The difference between the two computer are above :
Computer 1 :
Pentium(R) 4 CPU 3.20GHz with a RAM of 1Go. The processor is an Intel(R).
The OS is windows XP Pro 2002
Computer 2 :
Pentium(R) 4 CPU 2.80GHz with a RAM of 512Mo. The processor is an Intel(R).
The OS is windows XP Pro 2002.
If anybody can help me on this problem, it would be really helpful.
Regards
Florence P.Hi,
Indeed it's a strange behaviour, could you send me your VI and your JPEG file, (or another file that reproduces) so that I could check this inthere ?
I'll then try to find out what's happening.
Regards
Richard Keromen
National Instruments France
#adMrkt{text-align: center;font-size:11px; font-weight: bold;} #adMrkt a {text-decoration: none;} #adMrkt a:hover{font-size: 9px;} #adMrkt a span{display: none;} #adMrkt a:hover span{display: block;}
>> Découvrez, en vidéo, les innovations technologiques réalisées en éco-conception
Maybe you are looking for
-
SCN document: 'Insert Image' greyed out at a certain stage/size
I noticed a similar issue likeTammy has reported in discussion/thread .Cannot insert or upload an image After having inserted text and several images to a draft document, the 'Insert Image' icon became greyed out at a certain stage/size. I did some
-
Toplink Optimistic Locking not working with Session Bean facade.
I am working on Oracle JDeveloper v 10.1.2 and connecting to an Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit The application is based on J2EE architecture and the technology stack uses Struts for presentation/controller framework
-
Testing a document created in LiveCycle and when I go to fill out the document and save everything looks fine. I close it and reopen it and some of the information is missing or reset back to the default (example if drop down 2 was selected a text b
-
S55-A5257 Cant wake up after closing/op​ening lid
Our Windows 8 s55-A5257 has started doing the following: After allowing the PC to hibernate, usually by closing the lid, the PC won't go to the Windows logon screen. Instead, after the Windows 8 Seattle/Space Needle splash screen it just goes to a bl
-
Running out of data connections
Problem Statement: Running out of data connections after some time and the following SQLException is thrown: "failed to create a data connection with any of the specified drivers" Problem Description: I have an application that is running under iPlan