Simple arithmatic function is not resulting in zero

This is absolutely bizarre. 2.4 - 1.2 = 1.2 and 1.2-1.2 = 0,
or so you'd think, except that Flash keeps telling me 1.2 - 1.2 =
-4.44089209850063e-16. Subtract 1.2 once more from
-4.44089209850063e-16 and you miraculously get -1.2. Even more
bizarre is that this only happens if the starting value is greater
than 2.4.
See attached code which began as something much more complex
but I've commented out absolutely EVERYTHING except for this little
bit of math and yet it keeps telling me that 0 is
-4.44089209850063e-16. But only if rpm is greater than 2.4 to start
with. If it's 2.4 or less, it does get to zero.
Thanks for any help.

1. because your computer uses binary arithmatic.
2. you must round to get zero but you don't need to round to
whole numbers. you can round to within 15 digits and then you'll
get zero and won't loose any significant accuracy for most
purposes.

Similar Messages

  • Deletion of plannable values in a cell does not result in zero value

    Hi,
    In a planning report when I wanted to set the values in a plannable cell to '0', I just deleted the value in that cell without actually setting a '0' expecting a '0' to appear in that cell after I refresh my report. But instead I get my original value back in the cell. Is this standard behaviour or a bug or do I need to change some setting to get a '0'.
    I run my planning reports on the portal.
    Thanks.
    Regards,
    Jaya

    Hi,
    Check this out please.
    [Re: Cannot Save empty cell, can only save 0|Re: Cannot Save empty cell, can only save 0]
    regards,
    Ergin Ozturk

  • Mathscript contourf function produces strange results

    the code "contourf(magic(8))" typed into the mathscripts window produces a different result from the same single line in matlab.  The resolution and colormap differences don't bother me, but the line fragments are clearly incorrect.  This is a simple example of a problem I'm having in my data.  Further, if I'd like to plot the contour line myself, the "hold on" function does not seem to work with the contour.  Any help would be much appreciated.  A simple example demonstrating both problems:
    clf
    colormap(jet)
    contourf(magic(8));
    hold on
    plot(1:8,1:8,'r*')
    shg
    piyrwq
    Attachments:
    matlabmagic8.jpg ‏35 KB
    mathscriptsmagic8.jpg ‏143 KB

    Hello,
    I have looked into this issue some more.  I talked to the developer who wrote the colormap function and it turns out we do have all the colormaps.  However, their use is not documented.  They are passed to the function as an option, e.g. colormap('jet').
    In addition, the order of calls matters.  The colormap only applies to the current plot.  If you generate a new one, the colormap disappears.  Consequently, reverse the order of your colormap and contourf calls as follows:
    contourf(magic(8));
    colormap('jet')
    Grant M.
    Staff Software Engineer | LabVIEW Math & Signal Processing | National Instruments

  • Abs Function is not working for converting the negitive valies

    Hi ,
       My requirement is from the sorce I'm getting Amount data (both negative and possitive values)
    if the value is negative then i want to convert it as possitive value. that means always i want to pass possitive values to my target side.
    For this i have used  ABS function    AMOUNT (Source) ---> abs -
    > AMOUNT (Target)
    but now the problem is from the source I'm getting this value   <AMOUNT>60179010.00</AMOUNT>
    but while mapping it is converting and giving as <AMOUNT>60179008</AMOUNT>
    I didn't understand this functinality . actually Abs function should just convert the sign of the value but why the value is also giving as mismatch.
    please suggest me some solution for this..
    Regards
    jain

    What SP are you on?
    There have been lot of bugs in terms of the arithmatic functions in XI. But most of the issues have been solved in this release - http://help.sap.com/saphelp_nw04/helpdata/en/44/a7b4355d867455e10000000a11466f/content.htm
    I suggest in case u are not on that SP upgrade to it or use a simple java UDF to do the abs conversion.
    The math class in java can help you - http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Math.html
    Additional read - /people/thorsten.nordholmsbirk/blog/2006/04/03/never-ever-use-xis-built-in-arithmetic-functions

  • Nested aggregate functions are not allowed

    I need a calculation that divides a parcial value (based on a condition) by the total. It is something like that:
    CALCULATION 1:
    PARCIAL_VALUE = CASE WHEN DURATION >= :PARAMETER THEN MEASURE_VALUE ELSE 0 END
    CALCULATION 2:
    DIVISION = CASE WHEN MEASURE_VALUE = 0 THEN 0 ELSE PARCIAL_VALUE / MEASURE_VALUE END
    Calculation 1 only works if I use a SUM before the CASE. If I don't use the SUM, the calculation doesn't aggregate.
    I believe I also should add a SUM before the CASE of Calculation 2, but I can't. I got the error: Nested aggregate functions are not allowed.
    I tried to merge the two calculations, but I got the same error. I also tried to create a calculated item in detail level in the Administrator, but it didn't work too.
    How can I reformulate this calculation in order to avoid this error?

    I got the correct result with this formula:
    CALCULATION 1:
    PARCIAL_VALUE = SUM(CASE WHEN DURATION >= FIXED_VALUE THEN MEASURE_VALUE ELSE 0 END)
    CALCULATION 2:
    DIVISION = PARCIAL_VALUE / SUM(MEASURE_VALUE)
    It didn't return a division by zero error.
    The calculation works and correctly aggregates the data when I use a fixed value in the CASE. When I change the fixed value by a parameter, the calculation 1 works perfectly, but calculation 2 doesn't aggregate.

  • RH9 Webhelp Search function is not working properly

    Hi,
    My organization is using RH9 for a Webhelp project.  My company and our client are restricted to using IE9 for the online help I have created for this project, and our OS environment is Windows 7.  When I generate using the Webhelp layout, with the TOC, Index and Search options chosen, my resulting browser window shows two frames.  Left for the Contents/Index/Search and right for the content.  In the left panel, there are three links at the top for Contents, Index and Search.  When I click on the Search link, the only thing I see is the alphabet A-Z (which are links to filter items beginning with these letters (much like the index link) and a list of what I would say is garbage.  For example, if I click on H, I see items like "half 1 2 3" or "held" or "honor # 1 2 3 4 5 6 7 8", etc.  If I run my cursor down this list, I notice that maybe the word honor is a link.  If clicked it brings up one of my topic pages.  I can also click on the random numbers that appear, like clicking on 3 it brings up another topic page.  The search function does not allow me to type in a search criteria, since there is no search field as well.
    Do you have any suggestions for this issue?  Is this a bug, or do I need to change settings somewhere within RH9?  The same thing is happening when using this help project that is running on our clients server.  Is there any suggestion you can give to try and make this work properly?

    Rick,  Thanks for stepping in.    I assumed that was the reason why I was not receiving the search field, and that is fine for now.  We have discussed with our client the possibility of having two different help projects one for each, but that decision was kind of put on the back burner.
    However, the other issue I am having is still there and I don't quite understand why.  Since I only have clickable A-Zs for the search, and it lists links much like the Index section, I'm still seeing lists of just numbers and characters (i.e., "# 1 2 3 4 5", or "%" or "& 1 2 3 4 5" sometimes all the way up to 18 or so).  And each of these characters or numbers are clickable links as well to either page that doesn't contain that number or to nothing.
    Doing a bit more research, I have noticed that a lot of these links are being picked up by the PDF file we have as part of the project.  Our help project has a link to the documented version of the help in the form of a User Guide.pdf file.  So the search is listing items from that guide like the heading numbers 1.0, 1.0.1, etc.  Also each of these are clickable links that go nowhere.  But then there is still the numbers 1, 2, etc that go to pages that don't have this anywhere on the page.
    Do you have any insight as to why these types of things are being listed under Search at all?  They make that selection look very messy and unorganized.  Not professional at all.  I have checked and tested the properties settings and can't seem to find what is causing this to happen.  Any idea would be most appreciated!!

  • Palm Desk Top 6.2 Address Look Up Function Does Not Work In Windows 7

    I recently upgraded my desk top computer's operating system from Windows Vista Home Premium to Windows 7 Home Premium.  I synchronize with a Palm Tx PDA.  HP PalmOS customer support Chat helped me work through a compatibility issue that was preventing display of Address, Calendar, Memo and To Do items on my desk top computer via the Palm Desk Top 6.2 application.  I now find that the address look up function does not work (although it worked fine when I was running Vista).  Without success, I tried running the repair tool as well as reloading the software (both overlay and clean reinstall).  I would appreciate any help or suggestions to fix?
    Post relates to: Palm TX

    Hi,
    844869 wrote:
    CREATE TABLE TEST_EMPLOYEES
    FIRST_NAME VARCHAR2(26 CHAR),
    GRADE VARCHAR2(5 CHAR)
    INSERT INTO TEST_EMPLOYEES (FIRST_NAME, GRADE) VALUES ( 'William', 45 ); ...Thanks for posting the CREATE TABLE and INSERT statements; that's very helpful.
    William&45     1
    Robin 43     1
    Raymond          43     1
    Richard          43     1
    Karen          28     1
    Michelle               1
    Jonathan               1
    Mark               1
    Ann               1You may have noticed that this site normally doesn't display multiple spaces in a row.
    Whenever you post formatted text (such as query results) on this site, type these 6 characters:
    \(small letters only, inside curly brackets) before and after each section of formatted text, to preserve spacing.
    This is one of the many helpful things found in the forum FAQ {message:id=9360002}
    Are the results above what you're getting with some existing query, or are they the results you want? 
    If those are your current results, post your query.  In that case, what are the results you want?  Do you want this?FIRST_NAME GRADE RNK
    William 45 1
    Robin 43 2
    Raymond 43 2
    Richard 43 2
    Karen 28 5
    Michelle 6
    Jonathan 6
    Mark 6
    Ann 6
    Edited by: Frank Kulash on Feb 21, 2013 2:39 PM
    I see you've added the desired results to your original message.
    Here's one way to do that:SELECT first_name
    ,     grade
    ,     RANK () OVER (ORDER BY grade NULLS FIRST)     AS rnk
    FROM     test_employees
    ORDER BY grade          DESC     NULLS LAST

  • BDC transaction "The function is not possible"

    Dear Experts,
    I have made a BDC transaction program according to recording from SHDB in order to have batch transaction for FB50.
    However, when I run the program. It shows an error "The function is not possible". But when I press the "Save" button manually, the function passed and result is saved. Just do not know what happens.
    report YFB50 no standard page heading line-size 255.
    include bdcrecx1.
    type-pools : TRUXS.
    data : rawdata type TRUXS_T_TEXT_DATA.
    parameters: sfile TYPE localfile default 'C:\fb50.txt'.
    parameters: plant like BKPF-BUKRS default '1000'.
    data: pfile type string.
    data: post_date(8) type c.
    data: record_count(2) type c.
    data: v_HKONT(19) type c.
    data: v_SHKZG(19) type c.
    data: v_WRBTR(19) type c.
    data: v_SGTXT(19) type c.
    data: v_KOSTL(19) type c.
    ***    DO NOT CHANGE - the generated data section - DO NOT CHANGE    ***
    *   If it is nessesary to change the data section use the rules:
    *   1.) Each definition of a field exists of two lines
    *   2.) The first line shows exactly the comment
    *       '* data element: ' followed with the data element
    *       which describes the field.
    *       If you don't have a data element use the
    *       comment without a data element name
    *   3.) The second line shows the fieldname of the
    *       structure, the fieldname must consist of
    *       a fieldname and optional the character '_' and
    *       three numbers and the field length in brackets
    *   4.) Each field must be type C.
    *** Generated data section with specific formatting - DO NOT CHANGE  ***
    data: begin of record occurs 0,
    * data element: HKONT
            HKONT(010),
    * data element: SHKZG
            SHKZG(007),
    * data element: WRBTR
            WRBTR(017),
    * data element: SGTXT
            SGTXT(050),
    * data element: KOSTL
            KOSTL(010),
          end of record.
    *** End generated data section ***
    start-of-selection.
    pfile = sfile.
    concatenate sy-datum+6(2) sy-datum+4(2) sy-datum+0(4) into post_date.
    CALL FUNCTION 'GUI_UPLOAD'
    EXPORTING
         FILENAME                = pfile
    TABLES
         DATA_TAB                = rawdata
    EXCEPTIONS
         CONVERSION_ERROR        = 1
         FILE_OPEN_ERROR         = 2
         FILE_READ_ERROR         = 3
         INVALID_TYPE            = 4
         NO_BATCH                = 5
         UNKNOWN_ERROR           = 6
         INVALID_TABLE_WIDTH     = 7
         GUI_REFUSE_FILETRANSFER = 8
         CUSTOMER_ERROR          = 9
         OTHERS                  = 10.
    IF SY-SUBRC <> 0.
         WRITE:/ 'SY-SUBRC:', SY-SUBRC.
    ENDIF.
    CALL FUNCTION 'TEXT_CONVERT_CSV_TO_SAP'
    EXPORTING
         I_FIELD_SEPERATOR = ';'
         I_TAB_RAW_DATA = rawdata
    TABLES
         I_TAB_CONVERTED_DATA = record
    EXCEPTIONS
         CONVERSION_FAILED = 1
         OTHERS = 2.
    perform bdc_dynpro      using 'SAPMF05A' '1001'.
    *Input header information
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    *Document Date
    perform bdc_field       using 'ACGL_HEAD-BLDAT'
                                  post_date.
    *Posting Date
    perform bdc_field       using 'ACGL_HEAD-BUDAT'
                                  post_date.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/ECCDE'.
    perform bdc_dynpro      using 'SAPLACHD' '1000'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=ENTR'.
    *Company Code
    perform bdc_field       using 'BKPF-BUKRS'
                                  plant.
    perform bdc_dynpro      using 'SAPMF05A' '1001'.
    *Input header information
    perform bdc_field       using 'BDC_OKCODE'
                                  '/BU'.
    *Document Date
    perform bdc_field       using 'ACGL_HEAD-BLDAT'
                                  post_date.
    *Posting Date
    perform bdc_field       using 'ACGL_HEAD-BUDAT'
                                  post_date.
    *Input item text
    loop at record.
    *write sy-tabix to record_count.
    *concatenate 'ACGL_ITEM-HKONT(' record_count ')' into v_HKONT.
    *concatenate 'ACGL_ITEM-SHKZG(' record_count ')' into v_SHKZG.
    *concatenate 'ACGL_ITEM-WRBTR(' record_count ')' into v_WRBTR.
    *concatenate 'ACGL_ITEM-SGTXT(' record_count ')' into v_SGTXT.
    *concatenate 'ACGL_ITEM-KOSTL(' record_count ')' into v_KOSTL.
    perform bdc_field       using v_HKONT
                                  record-HKONT.
    perform bdc_field       using v_SHKZG
                                  record-SHKZG.
    perform bdc_field       using v_WRBTR
                                  record-WRBTR.
    perform bdc_field       using v_SGTXT
                                  record-SGTXT.
    perform bdc_field       using v_KOSTL
                                  record-KOSTL.
    endloop.
    perform bdc_transaction using 'FB50'.
    Here is my input:
    206090203;H;41.74;abc;MISHK
    206090203;H;14.36;abc;FACHK
    206100100;S;41.74;def;MISHK
    206070100;S;14.36;def;FACHK
    Regards,
    Cato

    Make your LOOP.... ENDLOOP... Like this
    LOOP AT RECORD.
    perform bdc_dynpro      using 'SAPMF05A' '1001'.
    *Input header information
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    *Document Date
    perform bdc_field       using 'ACGL_HEAD-BLDAT'
                                  post_date.
    *Posting Date
    perform bdc_field       using 'ACGL_HEAD-BUDAT'
                                  post_date.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/ECCDE'.
    perform bdc_dynpro      using 'SAPLACHD' '1000'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=ENTR'.
    *Company Code
    perform bdc_field       using 'BKPF-BUKRS'
                                  plant.
    perform bdc_dynpro      using 'SAPMF05A' '1001'.
    *Input header information
    perform bdc_field       using 'BDC_OKCODE'
                                  '/BU'.
    *Document Date
    perform bdc_field       using 'ACGL_HEAD-BLDAT'
                                  post_date.
    *Posting Date
    perform bdc_field       using 'ACGL_HEAD-BUDAT'
                                  post_date.
    *Input item text
    **loop at record.
    *write sy-tabix to record_count.
    *concatenate 'ACGL_ITEM-HKONT(' record_count ')' into v_HKONT.
    *concatenate 'ACGL_ITEM-SHKZG(' record_count ')' into v_SHKZG.
    *concatenate 'ACGL_ITEM-WRBTR(' record_count ')' into v_WRBTR.
    *concatenate 'ACGL_ITEM-SGTXT(' record_count ')' into v_SGTXT.
    *concatenate 'ACGL_ITEM-KOSTL(' record_count ')' into v_KOSTL.
    perform bdc_field       using v_HKONT
                                  record-HKONT.
    perform bdc_field       using v_SHKZG
                                  record-SHKZG.
    perform bdc_field       using v_WRBTR
                                  record-WRBTR.
    perform bdc_field       using v_SGTXT
                                  record-SGTXT.
    perform bdc_field       using v_KOSTL
                                  record-KOSTL.
    **endloop.
    perform bdc_transaction using 'FB50'.
    ENDLOOP.
    Now should work fine..

  • Photoshop suddenly does not print to Epson 3880 - PROBLEM: Cannot print from Photoshop  After restart error message appears:  - "There was an error opening your printer. Printing functions will not be available until you have selected a printer and reopen

    PROBLEM: Cannot print from Photoshop
    After restart error message appears:
    — “There was an error opening your printer. Printing functions will not be available until you have selected a printer and reopened any documents.”
    • All print commands are greyed out and unavailable — even to call up the printer commands cannot be done.
    The printer printed fine until about 2 weeks ago when this error message appeared.  Printing continues from Pages, I-photo, preview etc. —  only Photoshop fails.
    The printer has been turned on and off, as have open documents been closed and open etc..   Preferences reset.  Repeatedly I have read through blogs and forums and attempted to contact Adobe — all without results
    Epson support struggled to find reason and several solutions were tried and they assume this is an Adobe problem.
    Running Mac Powerbook X 10.10.2 / Photoshop CS6 13.0.6.x64
    Attempting unsuccessfully to print to Epson 3880
    What Adobe support will be of help.
    Robert Darling —  2/19, 20, 21,22,23/2015

    Probably best to ask in Photoshop General Discussion
    This forum is about the Cloud as a delivery process, not about using individual programs
    If you start at the Forums Index https://forums.adobe.com/welcome
    You will be able to select a forum for the specific Adobe product(s) you use
    Click the "down arrow" symbol on the right (where it says All communities) to open the drop down list and scroll

  • Autofill function is not working, 'window' sticks through it not functional!

    autofill function is not working, 'window' sticks through it not functional!

    Back up all data, then test after each of the following steps that you haven't already tried. Stop when the problem is resolved.
    1. Quit and relaunch Safari.
    2. Select your card in Contacts. Then select
    Card ▹ Make This My Card
    from the menu bar. Also select
    Contacts ▹ Preferences ▹ vCard
    and uncheck the box marked
    Enable private me card
    if it's checked.
    3. In Safari, select
    Safari ▹ Preferences ▹ AutoFill ▹ AutoFill web forms: Using info from my Contacts card
    If the box was already checked, uncheck it and then check it again.
    4. Launch the Keychain Access application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad. Click Utilities, then Keychain Access in the icon grid.
    Select the login keychain from the list on the left side of the Keychain Access window. If your default keychain has a different name, select that.
    If the lock icon in the top left corner of the window shows that the keychain is locked, click to unlock it. You'll be prompted for the keychain password, which is the same as your login password, unless you've changed it.
    Right-click or control-click the login entry in the list. From the menu that pops up, select Change Settings for Keychain "login". In the sheet that opens, uncheck both boxes, if not already unchecked.
    From the menu bar, select
    Keychain Access ▹ Preferences ▹ First Aid
    If the box marked Keep login keychain unlocked is not checked, check it.
    Select
    Keychain Access ▹ Keychain First Aid
    from the menu bar and repair the keychain. Quit Keychain Access.

  • My search function does not work. How can I fix it?

    Hello
    I need help I just bough a macbook 13 inch, with snow leopard
    and the search function does not work.
    The window opens but when I write the name i searh it gives me no results.
    How can i fix it?
    Do i need really to re install all snow leopard?
    thanks
    pt

    Hello paola t & welcome to the forums
    I need help I just bough a macbook 13 inch
    It may be that Spotlight hasn't completed indexing just yet - is there a dot (indicates busy) inside the magnifying icon top right?
    Also, check System Preferences/Spotlight to see what if any exclusions are configured, etc.

  • PLSQL function does not return the correct number of rows?

    Hey folks. I'm still green when it comes to writing PLSQL. It's fun, rewarding and very frustrating. Hence, I'm turning to the experts. If you folks can help me understand what I'm doing wrong here, I'd really appreciate it.
    The code is somewhat specific to my company's product, but I think it should be easy to read and understand what I'm doing. If not, please let me know what I can clarify.
    All i'm trying to do is determine if the most recent iteration of data available for a particular host is a full scan or not (level2). I go about this in the following manner:
    1. get the operatingsystem id, it's scandate (preferred), the most recent scandate and it's scan status from a table of where all operating systems data lives. Loop through all the Oses
    (from this I set v_osid, v_mostrecentscandate, v_scandate).
    2. Before doing the crazy logic, pick the low hanging fruit
    2a. if the the level2 status of the host is N, then v_level2 = 'N';
    2b. if the level2 = 'Y' and the mostrecentscandate and scandate are identical, then v_level2 = 'Y';
    2c. for all other cases, go to 3
    3. Using v_mostrecentscandate, find all table id that may hold the most recent instance of data for the host
    4. Loop through through the concatenation of that id + _base. If you find the id in those tables, then store the id for the next step.
    5. When you I find the right id, I now concatenate the id + attrdata. For the host id, I look for any rows where attribute_value in (..) and the corresponding number_value is not null.
    5b. set v_level2 = 'Y'
    5c. otherwise, set v_level2 = 'N'
    6 end the loop
    7 wash, rinse, repeat for each OS.
    create or replace package body mostrecentlevel2 as
    function getMostRecentL2 return bdna_mostrecent_level2 pipelined IS
    v_lsid NUMBER;
    v_sql VARCHAR2(5000);
    v_sql_baseid NUMBER;
    v_sql_numv NUMBER;
    v_lsidt VARCHAR2(5000);
    v_lsidt2 VARCHAR2(5000);
    v_sql_rec VARCHAR2(5000);
    v_osid NUMBER;
    v_anchor DATE;
    v_ls CHAR(2);
    v_level2 CHAR(1);
    v_mostrecentscandate DATE;
    v_scandate DATE;
    cursor getOSinfo_cur is select operatingsystem_id, scandate, mostrecentscandate, level2 from bdna_all_os;
    cursor getlsID_cur is select id from local_scan where
              ((trunc(collect_start_time) - to_date(v_anchor))*24*60*60) <= ((to_date(v_mostrecentscandate) - to_date(v_anchor))*24*60*60)
              and
              ((trunc(collect_end_time) - to_date(v_anchor))*24*60*60) >= ((to_date(v_mostrecentscandate) - to_date(v_anchor))*24*60*60);
    getOSinfo_rec getOSinfo_cur%rowtype;
    getlsID_rec getlsID_cur%rowtype;
    BEGIN
    v_ls := 'ls';
    v_anchor := '01-JAN-01';
    FOR getOSinfo_rec IN getOSinfo_cur LOOP
         v_osid := getOSinfo_rec.operatingsystem_id;
         v_mostrecentscandate := getOSinfo_rec.mostrecentscandate;
         v_scandate := getOSinfo_rec.scandate;
         IF getOSinfo_rec.level2 = 'N' THEN
              v_level2 := 'N';
         ELSIF getOSinfo_rec.level2 = 'Y' THEN
              IF v_mostrecentscandate != v_scandate THEN
                   FOR getlsID_rec IN getlsID_cur LOOP
                        v_lsid := getlsID_rec.id;
                        v_lsidt := v_ls||v_lsid;
                        v_sql := 'select id from '||v_lsidt||'_base where id = '||chr(39)||v_osid||chr(39);
                        EXECUTE IMMEDIATE v_sql into v_sql_baseid;
                        IF SQL%ROWCOUNT > 0 THEN
                             v_lsidt2 := v_lsidt;
                             v_sql := '';
                        END IF;
                   END LOOP;
                   v_sql := 'select number_value from '||v_lsidt2||'_attr_data where
                             lower(attribute_name) IN ('||chr(39)||'numcpus'||chr(39)||', '||chr(39)||'totalmemory'||chr(39)||', '||chr(39)||'cpuutilpercent'||chr(39)||', '||chr(39)||'numprocesses'||chr(39)||')
                             and
                             number_value is not NULL
                             and
                             element_id = '||chr(39)||v_osid||chr(39);
                   EXECUTE IMMEDIATE v_sql into v_sql_numv;
                   IF SQL%ROWCOUNT > 0 THEN
                        v_level2 := 'Y';
                   ELSE v_level2 := 'N';
                   END IF;
              END IF;
              v_level2 := 'Y';
         END IF;
         PIPE ROW (mostRecentLevel2Format(v_osid,v_mostrecentscandate,v_level2));
    END LOOP;
    END;
    END;
    /Now some will ask why I'm using pipelining? Again, I'm green.. I was reading around, looking for a way to make this code run as fast as possible (because it's potentially got to go through 56K records and perform the expensive work on).
    I also realize I'm not providing the type or package code, and that's because I think I'm good on that. The code above compiles just fine without errors and when it runs, it only returns 6 consecutive rows.. I'm expecting 70K lol. So I know I'm doing something wrong.
    Any thoughts?
    Oh forgot to add this is on 11g R1 Enterprise Edition
    Edited by: ErrolDC on Nov 14, 2011 4:52 PM
    Edited by: ErrolDC on Nov 14, 2011 5:07 PM

    ErrolDC wrote:
    Hey folks. I'm still green when it comes to writing PLSQL. It's fun, rewarding and very frustrating. Hence, I'm turning to the experts. If you folks can help me understand what I'm doing wrong here, I'd really appreciate it.
    The code is somewhat specific to my company's product, but I think it should be easy to read and understand what I'm doing. If not, please let me know what I can clarify.Post a complete script that peoople who aren't as familiar with the application as you are can run to re-create the problem and test their ideas. In this case, that includes CREATE TABLE and INSERT statements for the tables used (just the columns needed for this job), a query that uses the function, and the results you want from that query given the data you posted.
    All i'm trying to do is determine if the most recent iteration of data available for a particular host is a full scan or not (level2). I go about this in the following manner:
    1. get the operatingsystem id, it's scandate (preferred), the most recent scandate and it's scan status from a table of where all operating systems data lives. Loop through all the Oses
    (from this I set v_osid, v_mostrecentscandate, v_scandate).
    2. Before doing the crazy logic, pick the low hanging fruit
    2a. if the the level2 status of the host is N, then v_level2 = 'N';
    2b. if the level2 = 'Y' and the mostrecentscandate and scandate are identical, then v_level2 = 'Y';
    2c. for all other cases, go to 3
    3. Using v_mostrecentscandate, find all table id that may hold the most recent instance of data for the host
    4. Loop through through the concatenation of that id + _base. If you find the id in those tables, then store the id for the next step.
    5. When you I find the right id, I now concatenate the id + attrdata. For the host id, I look for any rows where attribute_value in (..) and the corresponding number_value is not null.
    5b. set v_level2 = 'Y'
    5c. otherwise, set v_level2 = 'N'
    6 end the loop
    7 wash, rinse, repeat for each OS.
    create or replace package body mostrecentlevel2 as
    function getMostRecentL2 return bdna_mostrecent_level2 pipelined IS
    v_lsid NUMBER;
    v_sql VARCHAR2(5000);
    v_sql_baseid NUMBER;
    v_sql_numv NUMBER;
    v_lsidt VARCHAR2(5000);
    v_lsidt2 VARCHAR2(5000);
    v_sql_rec VARCHAR2(5000);
    v_osid NUMBER;
    v_anchor DATE;
    v_ls CHAR(2);
    v_level2 CHAR(1);
    v_mostrecentscandate DATE;
    v_scandate DATE;
    cursor getOSinfo_cur is select operatingsystem_id, scandate, mostrecentscandate, level2 from bdna_all_os;
    cursor getlsID_cur is select id from local_scan where
              ((trunc(collect_start_time) - to_date(v_anchor))*24*60*60) <= ((to_date(v_mostrecentscandate) - to_date(v_anchor))*24*60*60)
              and
              ((trunc(collect_end_time) - to_date(v_anchor))*24*60*60) >= ((to_date(v_mostrecentscandate) - to_date(v_anchor))*24*60*60);
    getOSinfo_rec getOSinfo_cur%rowtype;
    getlsID_rec getlsID_cur%rowtype;
    BEGIN
    v_ls := 'ls';
    v_anchor := '01-JAN-01';
    FOR getOSinfo_rec IN getOSinfo_cur LOOP
         v_osid := getOSinfo_rec.operatingsystem_id;
         v_mostrecentscandate := getOSinfo_rec.mostrecentscandate;
         v_scandate := getOSinfo_rec.scandate;
         IF getOSinfo_rec.level2 = 'N' THEN
              v_level2 := 'N';
         ELSIF getOSinfo_rec.level2 = 'Y' THEN
              IF v_mostrecentscandate != v_scandate THEN
                   FOR getlsID_rec IN getlsID_cur LOOP
                        v_lsid := getlsID_rec.id;
                        v_lsidt := v_ls||v_lsid;
                        v_sql := 'select id from '||v_lsidt||'_base where id = '||chr(39)||v_osid||chr(39);
                        EXECUTE IMMEDIATE v_sql into v_sql_baseid;
                        IF SQL%ROWCOUNT > 0 THEN
                             v_lsidt2 := v_lsidt;
                             v_sql := '';
                        END IF;
                   END LOOP;
                   v_sql := 'select number_value from '||v_lsidt2||'_attr_data where
                             lower(attribute_name) IN ('||chr(39)||'numcpus'||chr(39)||', '||chr(39)||'totalmemory'||chr(39)||', '||chr(39)||'cpuutilpercent'||chr(39)||', '||chr(39)||'numprocesses'||chr(39)||')
                             and
                             number_value is not NULL
                             and
                             element_id = '||chr(39)||v_osid||chr(39);
                   EXECUTE IMMEDIATE v_sql into v_sql_numv;
                   IF SQL%ROWCOUNT > 0 THEN
                        v_level2 := 'Y';
                   ELSE v_level2 := 'N';
                   END IF;
              END IF;
              v_level2 := 'Y';
         END IF;
         PIPE ROW (mostRecentLevel2Format(v_osid,v_mostrecentscandate,v_level2));
    END LOOP;
    END;
    END;
    /Now some will ask why I'm using pipelining? Again, I'm green.. I was reading around, looking for a way to make this code run as fast as possible (because it's potentially got to go through 56K records and perform the expensive work on).
    I also realize I'm not providing the type or package code, and that's because I think I'm good on that. The code above compiles just fine without errors and when it runs, it only returns 6 consecutive rows.. I'm expecting 70K lol. So I know I'm doing something wrong. You're calling TO_DATE with a DATE argument. Why are you calling TO_DATE at all?
    It seems like this condition:
    ((trunc(collect_start_time) - to_date(v_anchor))*24*60*60) <= ((to_date(v_mostrecentscandate) - to_date(v_anchor))*24*60*60) is equivalent to
    TRUNC (collect_start_time) <= v_mostrecentscandateThat probably has nothing to do with why you're only getting 6 rows.

  • Produciton order status TECO, but WIP is not equal to zero

    Dear Expert,
    In OKGC,
    1000     0     000002     REL     2     WIP Calculation on Basis of Actual Costs
    1000     0     000002     DLV     3     Cancel Data of WIP Calculation and Results Ana
    1000     0     000002     PREL     1     WIP Calculation on Basis of Actual Costs
    *1000     0     000002     TECO     4     Cancel Data of WIP Calculation and Results Ana
    We checked produciton order status TECO (CO03)
    but WIP is not equal to zero (KKAO)
    Also, we found production order status show "rel" status in KKAO.
    Why order status in CO03 is TECO, but show "REL" in KKAO?
    Thanks in advance.

    Hi,
    We also had similar issue that the WIP is not equal to zero even though the status of the Process Order is DLV/TECO. When we analyzed, we found that few of the operations/resources/activityeps are not yet confirmed in the same month for the order. These operations/resources/activityeps are confirmed in subsequent month, then WIP got automatically Zero.
    Also refer the SAP Note 530563 - WIP calculation: Status DLV and TECO. Which provide the details for how WIP will get calculated.
    Thanks & regards,
    ADI

  • ORA-04091: is mutating, trigger/function may not see

    I am getting this error
    ORA-04091: table SATURN.SARQUAN is mutating, trigger/function may not see it
    ORA-06512: at "BANINST1.F_GETSARQUANSEQNO", line 24
    ORA-06512: at "BANINST1.F_GETSARQUANSEQNO", line 30
    I am trying to do this insert
    INSERT INTO sarquan
                            (sarquan_pidm,sarquan_term_code_entry,sarquan_seqno,
                             sarquan_appl_no, sarquan_question,
                             sarquan_answer, sarquan_activity_date,
                             sarquan_user_id
                    SELECT spriden_pidm,'201090',BANINST1.F_GETSARQUANSEQNO(spriden_pidm,'201090','1'),'1',
                     'Would you prefer September admission?',
                    DECODE (szcasup_sept_adm, 'Y', 'Yes', 'N', 'No'),sysdate,'rmanoei'
               FROM saturn_midd.szcasup, saturn.spriden
              WHERE spriden_id = szcasup_common_appl_id
                AND spriden_ntyp_code = 'CAPP'
                AND (   szcasup_sept_adm IS NOT NULL
                     OR szcasup_feb_adm IS NOT NULL
                     OR szcasup_interview IS NOT NULL
                AND NOT EXISTS (
                       SELECT *
                         FROM  sarquan
                        WHERE sarquan_pidm = spriden_pidm
                          AND spriden_ntyp_code = 'CAPP'
                          AND sarquan_term_code_entry = '201090');
                          I got data when I ran just the select statement, none of the records have data in the sarquan table.
    I got data when I select from this function
    ,BANINST1.F_GETSARQUANSEQNO(spriden_pidm,'201090','1'),'1'
    Any ideas?
    Edited by: peace4all on Aug 12, 2009 4:49 PM

    I can not drop the trigger, I don't own the trigger, it is in production, SARQUAN is a production table
    Now I am getting this error ORA-04091: table SATURN.SARQUAN is mutating, trigger/function may not see it
    ORA-06512: at "BANINST1.F_GETSARQUANSEQNO", line 24
    ORA-06512: at "BANINST1.F_GETSARQUANSEQNO", line 30
    ORA-06512: at "SATURN.ST_SARQUAN_INSERT_ROW", line 2
    ORA-04088: error during execution of trigger 'SATURN.ST_SARQUAN_INSERT_ROW'
    when I do the following
    I know that this pidm does not have any records in the table SARQUAN
    spriden_pidm = 2287953
    So I try to do a simple insert, not using the function, now I am hardcoding the seq, I know it needs to be 1 since there are not records in that table yet,
    the sequence go by pidm
    INSERT INTO saturn.sarquan
                     sarquan_pidm,
                     sarquan_seqno,
                     sarquan_term_code_entry,
                     sarquan_appl_no,
                      sarquan_question,
                     sarquan_answer,
                     sarquan_activity_date,
                     sarquan_user_id
    SELECT spriden_pidm,'1',
    '201090','1',
                     'Would you prefer September admission?',
                    DECODE (szcasup_sept_adm, 'Y', 'Yes', 'N', 'No'),sysdate,'recheverri'
               FROM saturn_midd.szcasup, saturn.spriden
              WHERE spriden_id = szcasup_common_appl_id
                AND spriden_ntyp_code = 'CAPP'
                 and spriden_pidm = 2287953
                AND (   szcasup_sept_adm IS NOT NULL
                     OR szcasup_feb_adm IS NOT NULL
                     OR szcasup_interview IS NOT NULL
                AND NOT EXISTS (
                       SELECT *
                         FROM saturn.sarquan
                        WHERE sarquan_pidm = spriden_pidm
                          AND spriden_ntyp_code = 'CAPP'
                          AND sarquan_term_code_entry = '201090');
                          Edited by: peace4all on Aug 13, 2009 5:35 AM

  • ORA-04091:table XYZ is mutating,trigger/function may not see it ORA-06512

    Hi everybody
    i am facing mutating problem during data deletion fron XYZ table as
    ORA-04091:table XYZ is mutating,trigger/function may not see it ORA-06512 at "user.procdure_name",line 39 ORA-065
    i have table XYZ and have database trigger on this table
    and also have procedure "user.abc" in this procedure m selecting data from xyz table

    You didn't post the actual code. I was more interested in seeing table name and the trigger body.
    Anyways, mutation problem comes when you refer the same table on the trigger, on which it is based for some data manipulation on that table.
    For e.g, If inside your trigger body, you are doing INSERT on the same table, then it'll definitely result in mutation problem because this trigger will be fired endlessly (as it is after insert trigger).
    Please mark answer as helpful / correct, if it helps you
    Navnit

Maybe you are looking for

  • JVM Compatibility

    (new thread please!) Grant Ronald - Forms Product Management. At your request Grant. Compatibility ( Jinit vs Ms JVM vs Sun JVM ) - Not sure what you mean, we certify Jinit, we certify native JVMs we certify the Sun plug in, we certify IE, we certify

  • Trying to add Firebox B Addon, tells me I need 3.6 but am running 4, help please

    I would like to install the Firefox B Add on but when I do to 'add to firefox it tells me the following:- this Persona requires Firefox 3.6. You are currently using Firefox 3.0.13. But I downloaded and installed Firefox 4.0.1 which is confirmed when

  • Organizing photos in Aperture?????

    I am trying to organize the projects and albums that are located on the left hand side of the screen when using Aperture.  You can arrange the projects and albums by name, manual, or kind when you use the preferences drop down menu located below the

  • Deleted WLC from its folder under the Device work center of Cisco prime 1.2

    I kindly need  your help as regarding cisco prime infrastructure. I added the wireless LAN controller to the prime. I later had to troubleshoot the WLC because the reachability status showed UNREACHABLE. Due to my troubleshooting, I synched the WLC a

  • Preprocessing command in java

    in c program... #define to implement constants what is the equal command in java technology.