Query is not working properly when statistics are computed (XE 11g Windows 7 32 bits)

Hi,
We have an application with a Oracle XE 11.2 database on a Windows 7 32 bits plateform.
We have a query wich access 4 tables end use a user defined package function.
When the statistics are computed the query is returning no rows, (with the data in the tables it should return 349 rows).
When the statistics are deleted (with ANALYZE TABLE xxx DELETE STATISTICS) the query is working fine.
I tried different statistics calculation methods, and sometimes the query is working, sometimes it is not!
I don't understand how the statistics caluclation method can change the query results.
Has anybody already encountered such an issue?
Regards,
Yves

I understand how the statistics are working.
What i don't undestand is why the number of rows returned is different with or without statistics.
I tried yesterday to had a hint /*+ RULE */ and with the hint, rows are correctly returned!
Here is the query:
SELECT l_activite.copaip, l_activite.nunati, l_activite.numeul, obsoff.dapaul,
                                    obsoff.lai24h / 10 * DECODE (coefat, NULL, 1, 0, 1, coefat / 200) lai24h, obsoff.etfeob, obsoff.tplaco / 10 tplaco,
                                    obsoff.tblaco / 10 tblaco, l_lactoff.nulact, obsoff.dapaul - l_lactoff.dadela + 1 dulact, l_lactoff.dadela,
                                    l_activite.dcenul,
                                    (  obsoff.tblaco
                                     / 10
                                     * (DECODE (obsoff.tblaco, 0, 0, NULL, 0, obsoff.lai24h * DECODE (coefat, NULL, 1, 0, 1, coefat / 200) / 10))
                                    ) mg,
                                    (  obsoff.tplaco
                                     / 10
                                     * (DECODE (obsoff.tplaco, 0, 0, NULL, 0, obsoff.lai24h * DECODE (coefat, NULL, 1, 0, 1, coefat / 200) / 10))
                                    ) mp,
                                    DECODE (obsoff.tblaco, 0, 0, NULL, 0, obsoff.lai24h * DECODE (coefat, NULL, 1, 0, 1, coefat / 200) / 10) lait_mg,
                                    DECODE (obsoff.tplaco, 0, 0, NULL, 0, obsoff.lai24h * DECODE (coefat, NULL, 1, 0, 1, coefat / 200) / 10) lait_mp,
                                    pck_f_valorises.f_present_mul (obsoff.etfeob,
                                                                   obsoff.nulact,
                                                                   (SELECT MAX (l_obsoff.dapaul)
                                                                      FROM l_obsoff
                                                                     WHERE TRIM (l_obsoff.copaip) = TRIM (l_activite.copaip)
                                                                       AND TRIM (l_obsoff.nunati) = TRIM (l_activite.nunati)
                                                                       AND l_obsoff.dapaul < obsoff.dapaul
                                                                       AND l_obsoff.etfeob <> 'T'),
                                                                   obsoff.dapaul,
                                                                   l_lactoff.dadela
                                                                  ) as OK
                               FROM l_activite, l_obsoff obsoff, l_lactoff, l_passage
                              WHERE TRIM (l_activite.copaul) = TRIM ('FR')
                                AND TRIM (l_activite.numeul) = TRIM ('61323017') || '    0'
                                AND TRIM (l_activite.copaip) = TRIM (obsoff.copaip)
                                AND TRIM (l_activite.nunati) = TRIM (obsoff.nunati)
                                AND TRIM (l_activite.copaip) = TRIM (l_lactoff.copaip)
                                AND TRIM (l_activite.nunati) = TRIM (l_lactoff.nunati)
                                AND TRIM (l_passage.copaul) = TRIM (l_activite.copaul)
                                AND TRIM (l_passage.numeul) = TRIM (l_activite.numeul)
                                AND (   (DECODE (l_activite.dacosu, TO_DATE ('01/01/0001', 'dd/MM/YY'), 'VIDE', NULL, 'VIDE', l_activite.dacosu) = 'VIDE')
                                     OR (l_activite.dacosu >= l_passage.dapaul)
                                AND l_passage.dapaul = obsoff.dapaul
                                AND obsoff.nulact = l_lactoff.nulact
                                AND obsoff.dapaul >= l_activite.dcenul
                                AND l_passage.dapaul <= to_date('24/04/2013')
                                AND l_passage.dapaul >= to_date('24/04/2012') - 50
                                AND pck_f_valorises.f_present_mul (obsoff.etfeob,
                                                                   obsoff.nulact,
                                                                   (SELECT MAX (l_obsoff.dapaul)
                                                                      FROM l_obsoff
                                                                     WHERE TRIM (l_obsoff.copaip) = TRIM (l_activite.copaip)
                                                                       AND TRIM (l_obsoff.nunati) = TRIM (l_activite.nunati)
                                                                       AND l_obsoff.dapaul < obsoff.dapaul
                                                                       AND l_obsoff.etfeob <> 'T'),
                                                                   obsoff.dapaul,
                                                                   l_lactoff.dadela
                                                                  ) = 1
and the function :
FUNCTION F_PRESENT_MUL(p_etat IN CHAR,p_nulact IN NUMBER,
p_derniere_obs_lait IN DATE, p_date_passage IN DATE,p_dadela IN DATE)
RETURN NUMBER IS
   NAME:       F_PRESENT_MUL
   PURPOSE:    Retourne 1 si présent MUL 0 sinon
   REVISIONS:
   Ver        Date        Author           Description
   1.0        01/12/2006  Mathieu GUIDEL        1. Created this function.
   NOTES:
BEGIN
   IF p_derniere_obs_lait IS NULL THEN /* vache présente MUL */
    RETURN 1;
   END IF;
   IF p_etat='P' THEN /* vache présente MUL */
   RETURN 1;
   ELSE
    IF p_etat = 'N' THEN /* NC ou FV */
     IF (p_date_passage - p_dadela + 1) <= 7 THEN /* FV */
      IF p_nulact=1 THEN
      RETURN 0;
      ELSE /* considérée comme tarie */
       IF (p_date_passage - p_derniere_obs_lait) < 100 THEN /* derniere obs lait inférieur à 100 jour, présente MUL */
       RETURN 1;
       ELSE /* FV tarie depuis trop longtemps : non présente MUL */
       RETURN 0;
       END IF;
      END IF;
     ELSE /* NC */
     RETURN 1;
     END IF;
    ELSE
     IF p_etat = 'T' THEN /* Tarie */
      IF (p_date_passage - p_derniere_obs_lait) < 100 THEN /* derniere obs lait inférieur à 100 jour, présente MUL */
      RETURN 1;
      ELSE /* tarie depuis trop longtemps : non présente MUL */
      RETURN 0;
      END IF;
      ELSE /* etat différent de P, N, T donc etat = S */
      /*vérification du contrôle précédent non FV*/
      IF (p_derniere_obs_lait - p_dadela + 1) <= 7 THEN /* FV au contrôle précédent*/
      RETURN 0;
      ELSE
        IF (p_date_passage - p_derniere_obs_lait) < 30 THEN /* derniere obs lait ou NC inférieur à 30 jour, présente MUL */
        RETURN 1;
        ELSE /* sortie sans lait depuis trop longtemps : non présente MUL */
        RETURN 0;
        END IF;
      END IF;
     END IF;
    END IF;
   END IF;
END F_PRESENT_MUL;
Regards

Similar Messages

  • Query Stripping not working properly when using variable in the report

    We have issue with WEBI document that have query stripping enable.
    Once the query stripping enabled there is no data return in the report.
    We have investigate on the problem, the query stripping function are notable to retrieve objects that indirectly used in the report
    as we have
    many variable in the reports.
    Ex.
    Var1 = object1 + object2
    Var2 = Object3 + Object4
    Var3 = Var1 + Var2
    Var4 = Object1 + Object2 + Object3 + Object4
    If we use only Var3 in the report, the object1,2,3,and 4 will not be
    retrieve.
    But if we are using Var4 in the report, the object1,2,3,and 4 will be
    retrieve properly.
    Please let me know is it a by-design behavior, if yes please share points on it

    Hi Amit,
    Thank you for response, however i already had alook on that VIdeo and it tells us about the basic enabling of query stripping.
    But my question is when we have a Variable in a report which is dependent on the other two variables it gives me #error so is it by design or not.
    Regards,
    Abhinav

  • Application does not work properly when I press a CommanButton

    Hi all, I am having a problem with weblogic 10.3.5.
    It turns out that an application built with JDeveloper 11.1.5, I test it, and everything goes well in the JDeveloper integrated Weblogic.
    But when deploy in a standalone weblogic 10.3.5 server, the application does not work properly when I press a CommanButton to go to another page search (the property "action" is set correctly) , but nothing happens, stays in the same home page. Similarly when a commanButton link to run a task-flow, It do not work , however in the JDeveloper integrated Weblogic it runs correctly.
    How I can solve these problems?
    Thanks.

    Thanks Frank for help us, but when I writing this comment we are doing at home. So, we going to test the page in a stand alone weblogic server 10.3.5. We wrote the URL as :
    " http://<our ip>:7001/myApp/faces/index.jspx "
    this application contains a report desing and compiled with iReport 4.5.1 ( last version in the moment ), we can see the report when I press a commanButton without any problem.
    But now, we need try your suggestions in the office, and give you more information about it . Thanks for the moment.
    In the Afternoon we gonna give you more information about it .

  • My Ipod touch does not work properly.When i charge it,it only works for 5 min.n gets discharge.I showed it to the apple store in banglore n the person told me its fine n It is working properly.Bt its not working properly.Can someone help

    My Ipod touch does not work properly.When i charge it,it only works for 5 min.n gets discharge.I showed it to the apple store in banglore n the person told me its fine n It is working properly.Bt its not working properly.Can someone help

    If after you charge it for about three hours and it only last about five minutes the battery is probably dead or there could be another hardware problem.  I would go back to the Apple store and ask them specifically how can it be OK if the fully charged battery only lasts five minutes.

  • Clip inspector in imovie not working properly - when I select a picture - and select clip adjustment it tells me that I need to select one or more clips to view Inspector tools and in a clip the audio adjustment only shows a speaker? help

    Clip inspector in imovie not working properly - when I select a picture (in project library) - and select clip adjustment it tells me that I need to select one or more clips to view Inspector tools and when I select a movie clip and then click on audio adjustments the audio adjustment appears as a speaker icon and I don't know how to get to the various audio options? It was working fine one minute and then I seemed to lose the functionality. Also editing a photo in a photo or getting rid of ken burns effect etc does not seem to work. help

    Can anyone shed any light on this as I am having the same problem? One minute it works fine, the next you get the error message above.
    Many thanks.

  • Hello My ipads Power button is not working properly when I press it once it shows option to turn off instead of locking and some other display problems like it suddenly lockes down or display disappears ...Please help. Thank You

    Hello My ipads Power button is not working properly when I press it once it shows option to turn off instead of locking and some other display problems like it suddenly lockes down or display disappears ...Please help. Thank You

    Thanks for that information!
    I'm sure I will be calling AppleCare, but the problem is, they charge for the phone calls don't they? Because I don't have money to be spending to be on the phone with a support service.
    In other things, it seemed like the only time my MacBook was working was when I had Snow Leopard without the 10.6.8 update download that was supposed to be done to prepare for OS X Lion.
    When I look at the information of my HD it says that I have 10.6.8 but that was the install that it claimed to have failed and caused me to restart resulting in all of the repeated problems.
    Also, because my computer is currently down, and I've lost all files how would that effect the use of my iPhone? Because if it doesn't get fixed by the time OS 5 is released, how would I be able to upgrade?!

  • My macbook pro is not working properly , when is turned on after then show apple logo and continue show this or nothing.

    my macbook pro is not working properly , when is turned on after then show apple logo and continue show this or nothing

    Gray, Blue or White screen at boot, w/spinner/progress bar

  • I've an iphone 4, its headset jack is not working properly, when i insert the earphone no sound is coming, but when i keep the earphone little out i can hear the sound but very low sound is coming out, I've never dropped my iphone please help...

    I've an iphone 4, its headset jack is not working properly, when i insert the earphone no sound is coming, but when i keep the earphone little out i can hear the sound but very low sound is coming out, I've never dropped my iphone please help...

    bunjamin wrote:
    There is now a new line in BBM that wasn't there before which covers the message that I am typing, so I can't actually see what I am typing.
    Hi bunjamin,
    just go to BlackBerry World, and update all your apps including BBM.
    bunjamin wrote:
    Every time I unlock my phone, my screen enlarges so I can't really see much on the hub/notification screen and it defaults to the hub which it didn't do before).
    you can turn off the magnifying glass :
    device settings >> accessibility >> magnify mode >> OFF
    you can deactivate the "reset to Hub view" :
    hub >> overflow (bottom right button) >> Settings >> Display and actions >> Return to Default View When Idle >> OFF
    bunjamin wrote:
    my ringtone is much softer than it was previously
    yes, BlackBerry has acknowledged this bug in this article from the public knowledge base:
    KB36755 After upgrading BlackBerry 10 OS to version 10.3.1 the volume for notifications is noticed to be significantly lower than in the previous version
    The search box on top-right of this page is your true friend, and the public Knowledge Base too:

  • Swf is not working properly when upload to server

    I develop 1.swf which is having 3 buttons each one having
    anather .swf to call 2.swf, 3.swf respectively.
    This application is running perfectly on my PC, but
    While uploading the swf to server the 2.swf and 3.swf is
    not running. Can any one tell how to recover from this kind
    of problem.

    justbipin wrote:
    > basically my code working perfectly,
    > but its not working properly when upload to server
    > can anybody having any ref. or link to solve this
    issues.
    why is that we insist on seeing the source file ?
    There is no one way of doing things in flash and no one can
    help
    you based on "does not work description".
    This is way to broad of a subject to even try to guess.
    Same as asking "my car does not work, what's up with
    that"....
    Please upload the problematic file and provide url for us to
    check.
    Otherwise you need to try to troubleshoot it yourself as we
    can't
    guess from here what possibly is wrong with that file.
    Regards
    Urami
    Happy New Year guys - all the best there is in the 2006 :)
    <urami>
    http://www.Flashfugitive.com
    </urami>
    <web junk free>
    http://www.firefox.com
    </web junk free>

  • TS1630 My Iphone 4s reciever is not working properly, when i call someone from my iphone 4s.  can any one help me how to solve this problem?

    My Iphone 4s reciever is not working properly, when i call someone from my iphone 4s.  can any one help me how to solve this problem?

    You might like to define "not working properly".

  • Flip Card Animation is not working properly when Button's PointOver State remain Activated.

     I am facing problems with flip car animation which is not working properly when its mouse point over state remains activated but it works perfect when its tapped two times and instantly change pointer position. Kindly Help me out as soon as possible.
    Code is here:
    Xaml:
    <Image Name="imgCapital" RenderTransformOrigin=".5,.5" Tag="1" Tapped="imgCapital_Tapped">
    <Image.Projection>
    <PlaneProjection RotationY="0"/>
    </Image.Projection>
    </Image>
    <Image Name="imgSmall" RenderTransformOrigin=".5,.5" Tag="2" Opacity="1" Tapped="imgSmall_Tapped">
    <Image.Projection>
    <PlaneProjection RotationY="-90"/>
    </Image.Projection>
    </Image>
    Storyboard:
    <Storyboard x:Name="FlipOpen">
    <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Projection).(PlaneProjection.RotationY)" Storyboard.TargetName="imgCapital">
    <EasingDoubleKeyFrame KeyTime="0:0:0" Value="0"/>
    <EasingDoubleKeyFrame KeyTime="0:0:0.4" Value="90"/>
    </DoubleAnimationUsingKeyFrames>
    <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Projection).(PlaneProjection.RotationY)" Storyboard.TargetName="imgSmall">
    <EasingDoubleKeyFrame KeyTime="0:0:0.4" Value="-90"/>
    <EasingDoubleKeyFrame KeyTime="0:0:0.8" Value="0"/>
    </DoubleAnimationUsingKeyFrames>
    </Storyboard>
    <Storyboard x:Name="FlipClose">
    <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Projection).(PlaneProjection.RotationY)" Storyboard.TargetName="imgCapital">
    <SplineDoubleKeyFrame KeyTime="0:0:0.4" Value="90"/>
    <SplineDoubleKeyFrame KeyTime="0:0:0.8" Value="0"/>
    </DoubleAnimationUsingKeyFrames>
    <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Projection).(PlaneProjection.RotationY)" Storyboard.TargetName="imgSmall">
    <SplineDoubleKeyFrame KeyTime="0:0:0" Value="0"/>
    <SplineDoubleKeyFrame KeyTime="0:0:0.4" Value="-90"/>
    </DoubleAnimationUsingKeyFrames>
    </Storyboard>

    Actually i simply want flip card animation which is not working here in my code. When i tapped button to invoke animation its behavior not exactly flipping.  Its one side work properly but other collapsed suddenly not rotate if i keep mouse right at
    the button, but if i change mouse pointer at that very time after tapping it works properly. Mouse Pointer Over mean screen points where i tapped.
    Triggered Function is here:
      private void btnChangCase_Tapped(object sender, TappedRoutedEventArgs e)
                if(isCaseChanged==false)
                    isCaseChanged = true;
                    FlipOpen.Begin();
                else if(isCaseChanged==true)
                    isCaseChanged = false;
                    FlipClose.Begin();

  • I had photoshop elements 8 installed on my previous computer and it did not work properly when it came to sizing  photos for a website I was adding to.  I now have a new computer which runs windows 7.  Is it worth installing it again on my new computer?

    I had photoshop elements 8 installed on my previous computer and it did not work properly when it came to sizing  photos for a website I was adding to.  I now have a new computer which runs windows 7.  Is it worth installing photoshop elements 8 again on my new computer or will it be a waste of time?

    I have PSEv.8 on my computer running WINDOWS 7. It works perfectly..
    Perhaps you need help with saving files for web use.. Will be pleased to assist you when you get everything set up.

  • Image display control scrolling does not work properly when zoomed in

    I am using a ROI on an image in the image display control. When zooming into the image to fine-adjust the positioning of the ROI, the image scrolling does not work properly. As far as I understand, the image should scroll automatically when the ROI is leaving the visible area. However, the scrolling behaviour seems to depend on the origin of the Labview panel, not the origin of the image display control, which might require to move the ROI way out of the visible area before the scrolling takes place. In other words: the coordinate system of the image display control is shifted with respect to the true visible image area, depending on where you place it on the front panel. As a consequence, when clicking on a ROI which is in the visible area, but is outside of what Labview thinks is the visible area, it might immediately jump to the left border of the image, making the positioning of the ROI really difficult.
    Has anyone noticed this behaviour, and what would be a reliable solution to avoid this? 
    Dirk

    Hello,
    no, I am not talking about the tools palette. Just place an image control with some image in it on a new VI front panel. Then, use the rectangle from the tools and select a ROI in the image. If you zoom in (using the magnification glass), and then grab the ROI and move it around, the image scroll with the ROI. So far, so good. If you now place the image control elsewhere on the panel, or add new control above it, resize the panel, etc. , this scrolling when moving the ROI will not work correctly if the origin (0,0) of the panel is far away from the image control.
    I have attached a VI for simplicity (although there is hardly any code in it).
    If you make a ROI and try to move it down, you will notice that scrolling starts if you move the mouse out to about 10cms below the image (depens on your screen, of course). After that, if you click on the ROI, the scroll bars and ROI might jump up to the upper end of the image. Imagine how annoying this is if you try to finely adjust the ROI position. 
    I think it is a bug in the implementation of the image display control.
    Thanks,
    Dirk
    Attachments:
    scrolling.vi ‏818 KB

  • Date Axis Line/bar Chart not working properly when rendering through SDK

    Hi all,
    When i render a existing Crystal report 2011 through java SDK code(Eclipse) bar chart is working fine, But the Date Axis line chart is not displaying properly. the properties are getting changed.. Any clue how to handle this? Do we have particular jar for Chart?
    Thanks in Advance!
    Regards,
    Mirthu

    Hi Mirthu
    I moved your post to the SAP Crystal Reports, version for Eclipse SCN Space. Unfortunately, all I know about Java is that it's in the cup in front of me . But I will get someone to have a look that should be able to help you ASAP.
    - Ludek
    Senior Support Engineer AGS Product Support, Global Support Center Canada

  • Dynamic Height in Graphs does not work properly when the graph is in an list

    Help please,
    I have an report in SQL Server 2008 (SP1) Reporting Services which uses Dynamic Height to dynamically increase the size of the graph for the data. For a single dataset this works great!
    When I place this graph in a list/tablix (to display this graph on each group) things go bad... Only the first graph on every page is resized, all other graphs on the same page are equal in size of the first!
    When I place a pagebreak on the lists property all graphs are drawn fine!! But then I will have a page for every question in my data (which can be a lot!)
    What is going on here? Please help.

    Hi Jerry,
    thanks for your reply, but this does not work. The graphs are now all the same size (the size of the first one that is), and on the same page for that matter...
    It looks like the renderer calculates the value of the dynamic height only once on a page in stead of each graph. That's a bug in my opinion.
    Any suggestions on how to fix this?
    The inner workings of the report are like this: The data contains anwers from a survey by question, so i have a unknown count of answers with each question; I placed a list on my report with a groupingproperty on the question asked. On this list i place a horizontal bar-graph which must grow in height when it is too small. The dynamic height should be calculated like this =70 + (CountDistinct(AnswerValue.Value)*10) & "pt".
    When i place this calculation in a textbox, every item in the group is calculated correctly. Each graph is drawn, but the graphs are sized only to the size of the first graph on the page. When I place a pagebreak after each list-repeat (so i get each question on a seperate page) each graph is drawn correctly! This results however in more than 100 pages with all used for just a few centimeters (think about trees!).
    I'm using SQL 2008 / SSRS2008 with SP1 by the way ( without SP1, the behaviour is the same).
    Any more suggestions are appreciated.
    Danny

Maybe you are looking for

  • How to have two times the same iTunes library ?

    My parents are separated, so I have two computers (one with my father and the other one with my mother) and all my music is in the computer with my mother, I want to have the same iTunes library to my father how I should do?

  • Fixed exchange rate on PO taken from sales order?

    Dear, we want to fix the exchange rate on the PO (standard SAP), but we want the exchange rate of the PO to be the one from the sales order (actually the one originally coming from the quote). Anu ideas on how to do this (standard or which user-exit)

  • HR Master Record Replication to FI with Dual Control for Sensitive Fields

    Dear Experts, We have an issue on our project whereby employee records are maintained in HR, but replicated to FI on a regular basis via tcode PRAA, creating employee vendors. We wish to activate the "Dual Control for Sensitive Fields" for the vendor

  • Deleting images but IPhoto size stays same?

    I removed about 1500 photos from iPhoto but the size of the iphoto library didn't change a bit, still at 30GB. I need space on my hard drive, what I can do?

  • THE i pod shuffle is it really worth it

    Brought a i pod shuffle and i thought it was the dogs ******s but it really isnt. For the 6 months 4 of which it was corrupted and wasnt any good to me. Went to try and sort it on here but staff werent interested or anyone else. So it went in the was