Count(*) does not take into consideration the where condition

the following sql function is supposed to calculate the number of rows that respect the conditions in the where clause. After I call this function I get the the total number of rows in the table. Any help would be much appreciated.
FUNCTION NBRTRIMCOMPLETES (ETU_NO NUMBER, PRG_NO NUMBER) RETURN VARCHAR2 IS
nbrTrimCompletes number(6);
begin
     SELECT COUNT(*) into nbrTrimCompletes from (select * from INSCRIPTION I WHERE I.ETU_NO = ETU_NO AND I.PRG_NO = PRG_NO);
     RETURN nbrTrimCompletes;
end NBRTRIMCOMPLETES;

The compile can't distinguish between the column name ETU_NO an the variable ETU_NO, that's why your where condition always evaluates to true.
Change the name of the parameters.
FUNCTION NBRTRIMCOMPLETES (P_ETU_NO INSCRIPTION.ETU_NO%TYPE,
                           P_PRG_NO INSCRIPTION.PRG_NO%TYPE
                          ) RETURN NUMBER
IS
  nbrTrimCompletes PLS_INTEGER;
begin
  SELECT COUNT(*)
  into   nbrTrimCompletes
  FROM   INSCRIPTION I
  WHERE  I.ETU_NO = P_ETU_NO
  AND    I.PRG_NO = P_PRG_NO;
  RETURN nbrTrimCompletes;
end NBRTRIMCOMPLETES;

Similar Messages

  • HS.EXP does not take into account the Value member and the source

    Hello,
    The formula is put in the "Entity Curr Adjs" part of the Sub Calculate.
    The expression is the following and apply for one entity (Holding method) I filtered previously and the ICP Entity has proportionnal method with 50% rate:
    HS.Exp "A#5420.I#[ICP None].C1#REC.C2#[None].C3#[None].C4#Recla_IAS_Aut_RetS_5=
    A#5340.V#[Contribution].E#Logista_E_TBCO.I#UTE_O.C1#CLO.C2#TotC2.C3#TotC3.C4#TotC4"
    The data I would like to retrieve is the one in Contribution Value as I put on the source part of the expression.
    And yet, the data I get is the one of the Entity Currency and Proportion Value, which is different because the ICP has proportionnal method (50%) and the Contribution value is the result of Proportion - Elimination values.
    To sum up: I obtain a data of 50 instead of 25.
    I checked that the data I see in my form corresponds to the source parameters but it seems that it does not take into account the Value parameter.
    Could it be that it is not possible to use a Contribution Value source for an Entity Currency Adjs destination?
    Thanks in advance.
    Regards,
    Julien

    Hi,
    I see another problem in what you're trying to do. First, let me state what you're trying to establish: you are trying to get a value from one entity (say A) to another entity (say B), be it at [Proportion], [Elimination], [Contribution], ...
    My question is: how can you know that during the consolidation process, by the time your code runs on B, A has already been processed and [Proportion], [Elimination] are not empty (or contain values from a previous consolidation run)?
    The answer is "You don't". Theoretically, you have no control as per the order in which entities are calculated/consolidated during the process. Even more complex is the thing that if you have a multi-core machine, more than one entities may run in parallel, but still you cannot force A to run before B. I have done some tests and I've seen that in a one processor setting the order that entities enter in the process of consolidation matches the order you have placed them in the consolidation tree in metadata. Still this thing is not documented as far as I know and therefore you cannot rely on this.
    Finally, I have also seen that in a simple case (B pulls from A), if you run consolidation twice, then you definitely get correct values. By the time you make a change in A, you have to run consolidation twice again to make sure that you get the correct data. I believe that you see that what I'm describing is good for experimenting but not for releasing to a client.
    I tend to think of such a design, as a practice to avoid.
    --Kostas                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • SPOOLing in sql developer does not take into consideration SET ECHO OFF

    I'm running SQL Developer 3.1.07.42 on Windows 7 64 bit with java 1.7
    I have the following very simple script just to show the problem:
    SET ECHO OFF;
    SET FEEDBACK OFF;
    SET SERVEROUTPUT ON;
    SET VERIFY OFF;
    SET PAGES 0;
    SET HEAD OFF;
    SPOOL c:\test.sql
    SELECT 1, 2, 3 FROM DUAL;
    SPOOL OFF;
    /if I run it in TOAD 10.6.0.42 it creates the file with
             1          2          3This is as expected (by me)
    if I run the exact same query in SQL Developer 3.1.07.42 , it creates the file with:
    < SELECT 1, 2, 3 FROM DUAL
    1 2 3(the < above is actually ">" but the CODE formatting software is screwing ">")
    but I don't want the ECHOed command to be spooled. For the life of me, I cannot find a way to disable the ECHO from spooling in sql developer.
    Tried the same in 3.0.4 and 2.1.1 with the same (bad) result (plus some warning on some of the unsupported SET commands).
    Am I missing something obvious? Cause like this, the spool command cannot be used in sql developer to generate a CSV file for example, because of the echoed command. And windows doesn't come with SED by default so that is out. (plus that my original script is integrated into a much larger and complex set of scripts and the main script using them is executed from SQL Developer as a company policy (so that everybody uses the same tool and the code runs the same for everybody))
    Any ideas/suggestions are welcome
    Thanks.

    Hi Gary, you seem to have some extensive knowledge. I'd like to follow-up on this thread and try to understand why SQL Developer won't hide the code even though I'm already running the code as a Worksheet (I assume you mean Run Script F5 button in SQL Developer).
    I generally develop in SQL Developer that does a lot of dbms_output to echo data using a Spool command. When I'm in SQL Developer I can't get the code NOT to spool, it typically is echoed directly in the spool file at the top followed by the dbms_output data. If I save the sql file and run in in sqlplus it only outputs the data (good). If I use @C:\xyz_script.sql and hit F5 in SQL Developer it only outputs the data (per your previous answer) -- good.
    So why can't I hit F5 in SQL Developer in the script file and have it only output the data? It just doesn't work no matter how many "SETs" you turn-off.
    Looks like Echo, Term, Feed are supported in SQL Developer, maybe supported means something other than work.
    http://www.oracle.com/technetwork/developer-tools/sql-developer/sql-worksheet-commands-097146.html

  • After doing a Google search - when I click on a link it does not take me to the corect website. Instead it always take me to some icity webpage. How do I fix this so that Firefox takes me to the correct website that the Google search found?

    After doing a Google search - when I click on a link it does not take me to the correct website. Instead it always take me to some icity webpage. How do I fix this so that Firefox takes me to the correct website that the Google search found?

    After doing a Google search - when I click on a link it does not take me to the correct website. Instead it always take me to some icity webpage. How do I fix this so that Firefox takes me to the correct website that the Google search found?

  • Iphoto Stream does not take in concideration the time zone. How to add a certain amount of hours on a Stream automaticly downloaded into Iphoto?

    Hi,
    I am just back from my holidays with few friends... We were in a Time Zone +6. I have created a Photo stream for everyone to share their photo on the same place. It worked. Back @ my place, I downloaded those photos localy on my laptop to be able to close the Stream. Those picts has the perfect time. In the same time I got all my picts that are automaticly streamed into Iphoto as well ... Here is my problem : I want to had the Picture that I have not streamed into the commun stream to my local event (from my own automatic stream) ... Those have been uploaded with my laptop local time !!! So I have 6 hours difference ! ...
    Is there a way to add 6 hours to all my pictures or should I import manualy my pictures from my phone to Iphoto ? (Picts are Ok into my phone).
    It is kind of an hugly bug: I think that this streaming option is actully really useful when you are in holidays ... so kind of often in an other time zone !
    Thx for the support !

    You e missing somthing - the adjust time and date command is specfially designed to corect tim fo camera mis-settings or time zone - you selec a roup of photo off by a certain amount and it adds the same delta to all thereby quickly an dsimply correcing user camera setting errors or user time zone errors
    It does exactly what you ask for - the batch change command does not work for this by=ut the adjust time command does
    LN

  • I am trying to sync computers. After I set up first and go to second when I select I already have an account it does not take me to the screen to enter email and password as directions say. I am stuck!

    Computer 1 setup with code.
    When I follow instructions on computer 2 and select I already have account it give me set of codes to enter on first computer at :add device screen. Does not give me option option to add email address and password but tells me to enter a code they supple to add a device screen on first computer. When i go there it doesn't give me this option

    Hi!
    I understand that Computer 1 is synced and you see something like this when you access the Sync Tab under Preferences: https://support.mozilla.com/media/uploads/gallery/images/2011-01-27-15-46-25-9c0352.png
    And in Computer 2 you get a window similar to this: https://support.mozilla.com/media/uploads/gallery/images/compcode.jpg
    But when you click on Add Device the following window doesn't appear: https://support.mozilla.com/media/uploads/gallery/images/2011-01-27-15-46-48-5f59d1.png
    Is this correct? If so, please let me know what you see (a screenshot will be handy).
    You can also set up the second computer following this instructions: https://support.mozilla.com/en-US/kb/How%20to%20sync%20Firefox%20settings%20between%20computers#w_what-if-im-not-near-my-first-computer

  • When i type in a website and hit "enter" it does not take me to the website and i have to manually google where i want to go. is there a certain setting that needs to be set?

    its a small problem, but is very annoying -_-

    Do you have that problem when running in the Firefox SafeMode?<br/> ''A troubleshooting mode.''<br />
    You can open the Firefox 4.0 SafeMode by holding the '''Shft''' key when you use the Firefox desktop or Start menu shortcut. Or use the Help menu item, click on '''Restart with Add-ons Disabled...''' while Firefox is running. <br />
    ''To exit the Firefox Safe Mode, just close Firefox and wait a few seconds before using the Firefox shortcut to open it again.''
    If not, see this: <br />
    http://support.mozilla.com/en-US/kb/troubleshooting+extensions+and+themes

  • SQL-tab / refresh button: does not take into account renamed constraint.

    I discovered a small bug:
    1) find or create a table with system generated constraint names (SYS_C007289)
    2) open that table in SQL Developer (I'm using 3.0.04.34). On the constraints tab, there will be the SYS% constraints. On the SQL-tab, the constraints will be shown without a name (simply "not null" for example).
    3) Return to the Constraints tab and use Actions / Constraints / Rename single to rename a constraint.
    4) return to the SQL tab and press the Refresh button. Unexpectedly, the new constraint name is still not in the SQL!
    5) close the entire window/tab for the table
    6) re-open that table.
    7) go to the SQL-tab: now the name of the constraint is in the code.
    As shown above, the workaround is easy, so this is a very minor bug-let.

    Looks like you add an ActionListener to your button <next> every time yuou call buildGui() and, believe it or not, adding a listener more than once triggers additional events. Thus, it's okay on your first loop but on the second it now has 2 listeners and thus will skip 3 and go to four. After this it now has three listeners and will skip 4 and 5 and go to 6 etc, etc.
    // in your buldGui() method
    System.out.println("prints next");
    frameContainer.add(next);
    next.addActionListener(this);
    System.out.println("it has already printed next");
    exit.addActionListener(this);
    frameContainer.add(exit);

  • OSMF Dynamic Streaming taking into consideration the mediaContainer size?

    Hi,
    While playing with the dynamic streaming in OSMF I've noticed that it doesn't take into consideration the size of the mediaContainer it's being displayed into. Basically it will load the highest version of the stream available to my current bandwidth even though the mediaContainer would display the same quality as with the 2nd highest version (the frameSize for each of the 1st 2 versions are higher than my mediaContainer size). While this may not pose a problem to the user it may generate additional (unnecessary) traffic server side. Is there anything I'm doing wrong/not seeing? Can this be accomplished with OSMF? Is there any documentation related to implementing a DynamicStreaming switch maanger?
    Thx in advance

    Thx. I will check the Strobe sources. I was trying to avoid going there in order to gain time but guess this is the only way.

  • Why does converting word into PDF does not take the background color of the page?

    When I do a page background on a document, and save as pdf, it does not take the background color. It shows only white background.

    This may be a limitation with the built in PDF writer in OS X. Never tried it so I have no idea if it does the same on my Mac.
    As this is not a MS Word problem you are in the right set of forums.
    Have you tried another PDF writer other then the built in one?

  • How do I scan a document into my computer? The instruction book does not go into detail

    HP deskjet 2540 All-in-one
    How do I scan a document into my computer? The instruction book does not go into detail
    Window 7
    Thanks for helping me

    Hi @thea14,
    Welcome to the HP Forums!
    I noticed that you are wondering how to scan with your HP Deskjet 2540 on Windows 7, and I am happy to help!
    Please take a look through this how to scan guide, Scan from Windows 7 With the Full Feature HP Software for HP Multifunction Printers.
    Hope this guide answers your questions, and thank you for posting!
    RnRMusicMan
    I work on behalf of HP
    Please click “Accept as Solution ” if you feel my post solved your issue, it will help others find the solution.
    Click the “Kudos Thumbs Up" to say “Thanks” for helping!

  • Build thumbnail image does not take AnalogBalance into account

    When I build a thumbnail, it does not take AnalogBalance into account.
    dng_image_preview thumbnail;
    dng_render render (host, *negative);
    // Build stage 2 image.
    negative->BuildStage2Image (host, ttShort);
    // Build stage 3 image.
    negative->BuildStage3Image (host, ttShort);
    render.SetFinalSpace (negative->IsMonochrome () ? dng_space_GrayGamma22::Get () : dng_space_sRGB ::Get ());
    render.SetFinalPixelType (ttByte);
    render.SetMaximumSize (256);
    thumbnail.fImage.Reset (render.Render ());
    thumbnail.fImage.Get()->Rotate( dng_orientation::Mirror90CCW() );
    thumbnail.fInfo.fColorSpace = thumbnail.fImage->Planes () == 1 ? previewColorSpace_GrayGamma22 : previewColorSpace_sRGB;

    The AnalogBalance is going to affect the mapping between temp/tint values and camera neutral values. If the white balance values are already stored as camera neutral values, I would not expect it to significantly change thumbnail rendering.
    It sounds like you do not understand AnalogBalance correctly.

  • Update 4.01 asks to update, I say yes it appears to update then in the last step it goes back up to the update center and cannot connect, the update does not take effect and it keeps asking

    I allow update 4.01 to update got thru all the steps and at the last step it goes back out to the update and cannot connect, the update does not take effect.

    Sign out of your account on the iPad, restart the iPad and then sign back into your account.
    Settinsg>Store>Apple ID - tap the ID and sign out.
    Restart the iPad by holding down on the sleep button until the red slider appears and then slide to shut off. To power up hold the sleep button until the Apple logo appears and let go of the button.
    After restarting go to Settings>Store and sign in again.

  • I am using Illustrator CS5. I am using a certain font and when I make a selection to use one of the letter options or a glyph, it does not take my selection; in other words, nothing changes.

    I am using Illustrator CS5. I am using a certain font and when I make a selection to use one of the letter options or a glyph, it does not take my selection; in other words, nothing changes.

    What font? What system? What Glyph? What language settings? Could be anything. Either way, ask in the AI forum. You'll get quicker answers there - if you provide all the required info.
    Mylenium

  • My computer has been acting weird lately.  Shuts itself off, the mouse goes off in all angles, does not go into sleep mode sometimes and instead shows on a gray screen definitions of words in 3" letters!  Do I have a virus?

    My computer has been acting weird lately. Shuts itself off, the mouse goes off in all directions, does not go into sleep mode sometimes, instead shows a gray screen with word definitions in large 3" letters that continuosly flows across the screen.  Do I have a virus?

    Doesn't really sound like a virus.
    See if the Disk is issuing any S.M.A.R.T errors in Disk Utility...
    http://support.apple.com/kb/PH7029
    How many of these you can answer...
    Open Activity Monitor in Applications>Utilities, select All Processes & sort on CPU%, any indications there?
    How much RAM & free space do you have also, click on the Memory & Disk Usage Tabs.
    Open Console in Utilities & see if there are any clues or repeating messages when this happens.
    In the Memory tab, are there a lot of Pageouts?

Maybe you are looking for

  • How to write bdc programme to load the data in table control

    Hi i have to write a bdc programme and the data to be filled in table control fileds can any one help me with the code how i have to write it is for cs02 tcode thanks and regards naveen

  • Using read text fm in smartforms

    hi experts,               I have captured a text using Read_text Fm .now i need to use it inside a smartforms .how to do . i have used that code inside a program line . and in text i have called the field. declaration in form interface text type char

  • Exception in thread "main" java.lang.OutOfMemoryError( while importing xml)

    I am trying to config application in Sun One Portal server 3.0 SP5 , (Sun Solaris 8)during configuration I was trying to import some xml files however during the process I got the error : Exception in thread "main" java.lang.OutOfMemoryError. I tried

  • How do I connect my 20" iMac ...

    to my surround sound stereo system? What cords do I need to get the sound rather than just the speakers from the computer? Lame question yes I know! Sorry? Greg

  • EA4.2 - Pop Up Describe

    I have recently switched to a 64bit windows 7 machine and have installed the 32/64bit download along with Java7. However when I now try and do a desc on a package etc (Shift-F4) it now no longer seems to function and i get the following in my logging