RACUST errors out - racina: ORA-01422: exact fetch returns more than reques

Hi,
We are using standard RACUST interface( r12, 12.0.0). All the records are successsfully validated however, the standard program errors out at run time with the following error
racina: ORA-01422: exact fetch returns more than requested number of rows

Pl see if MOS Doc 802175.1 (Customer Interface Creates Duplicate Party Sites Used in Multi-Org (MOAC)) can help
HTH
Srini

Similar Messages

  • ORA-01422- exact fetch returns more than requested number of rows in D2K Report

    Hi All,
    Greetings.
    I am using a report which is being called from the from in one of my application. The report is working fine from quiet a long time. I have an error with a particular record alone and it is working fine for all other records.
    When I try to run the report, I am getting the error as Rep-1401- 'cf_vatformula' : Fatal pl/sql error occured.
                                                                                ORA-01422- Exact fetch returns more than requested number of rows.
    I opened the formula column and run the sql codes that are used in the formula column cf_vat and all of them are working fine. None of them are fetching more a single row. But, when I run the report, I am getting the same error as mentioned above.
    Please help me resolve the issue ASAP. Thanks in Advance.
    Regards,
    Bhaskar.

    Hi InoL,
    Thanks for your time.
    I am sure that there is no other procedure used in cf_vatformula. It has select queries in and all of them are fetching the data not more than a single row.
    I have tested each and every select query with every possible output.
    Regards,
    Bhaskar.

  • ORA-01422: exact fetch returns more than requested number of rows in R12

    Hi All,
    Getting the below error in custom report of purchasing.
    REP-1401: 'afterpform': Fatal PL/SQL error occurred.
    ORA-01422: exact fetch returns more than requested number of rows
    To overcome this error I have added some exceptional handling as per below and the report is completed with Normal with output but the ouput is repeating in 150 pages in R12 but the same output in 11i showing only one page. Please advise.
    when no_data_found then
                 :P_po_num_type := 'ALPHANUMERIC'; 
            when too_many_rows then
                 :P_po_num_type := 'ALPHANUMERIC';
            when others then
                 :P_po_num_type := 'ALPHANUMERIC';
    Regards,
    Sushant

    You need to rewrite your query for R12 based on new architecture as 11i report will not work as it is.
    thanks

  • Error during recover datafile - ORA-01422: exact fetch returns more than ..

    Hi,
    we have got actual a serious problem in our database. Some days ago we created a new datafile for a tablespace in the wrong directory:
    ALTER TABLESPACE "ANZSIIDX" ADD DATAFILE '/oralunadata/anzora8/ANZSIIDX08.dbf' SIZE 500M
    We recognized our mistake and generated the datafile with the same name in teh right directory:
    ALTER TABLESPACE "ANZSIIDX" ADD DATAFILE '/oralunaindex/anzora8/ANZSIIDX08.dbf' SIZE 500M
    We set the "wrong" datafile offline in order to rename and replace this in file in the right directory:
    alter database datafile '/oralunadata/anzora8/ANZSIIDX08.dbf' offline;
    ALTER TABLESPACE 'ANZSIIDX'
    RENAME DATAFILE '/oralunadata/anzora8/ANZSIIDX08.dbf',
    TO '/oralunaindex/anzora8/ANZSIIDX09.dbf';
    After this we wanted to bring the datafile online again with a recovery but
    this fails with teh strange error-message:
    SQL> recover datafile 109;
    ORA-00604: error occurred at recursive SQL level 1
    ORA-01422: exact fetch returns more than requested number of rows
    ORA-06512: at line 20
    ORA-00279: change 10322956311023 generated at 04/10/2013 18:51:23 needed for
    thread 1
    ORA-00289: suggestion : /oralunaarchiv/anzora8/anzora8_1_315326_636567403.arc
    ORA-00280: change 10322956311023 for thread 1 is in sequence #315326
    A similar thing happens with our RMAN backup from last weekend, which failed:
    channel c4: backup set complete, elapsed time: 00:32:33
    input datafile fno=00109 name=/oralunadata/anzora8/ANZSIIDX08.dbf
    input datafile fno=00103 name=/oralunaindex/anzora8/ITOPROTOKOLLEIDX01.dbf
    input datafile fno=00097 name=/oralunadata/anzora8/ITOPROTOKOLLE03.dbf
    input datafile fno=00096 name=/oralunadata/anzora8/ITOPROTOKOLLE02.dbf
    channel c4: specifying datafile(s) in backupset
    channel c4: starting compressed incremental level 0 datafile backupset
    continuing other job steps, job failed will not be re-run
    ORA-00600: internal error code, arguments: [krbbfmx_notfound], [109], [12801], [], [], [], [], []
    ORA-01422: exact fetch returns more than requested number of rows
    ORA-00604: error occurred at recursive SQL level 1
    Has anybody an idea, how can we bring back the datafile online in order to run succesfull an RMAN backup?
    Actually we see just the workaraound to move the objects from the affected tablespace to new tablespace
    and the drop the empty tablespace what would be quite time consuming and not really practicable for us.
    kind regards,
    Marco

    Hi,
    actual we see this in v$datafile:
    /oralunaindex/anzora8/ANZSIIDX01.dbf     15     ANZSIIDX     10737418240     1310720     AVAILABLE     15     NO     0     0     0     10737352704     1310712     ONLINE
    /oralunaindex/anzora8/ANZSIIDX02.dbf     46     ANZSIIDX     10737418240     1310720     AVAILABLE     46     NO     0     0     0     10737352704     1310712     ONLINE
    /oralunaindex/anzora8/ANZSIIDX03.dbf     58     ANZSIIDX     10737418240     1310720     AVAILABLE     58     NO     0     0     0     10737352704     1310712     ONLINE
    /oralunaindex/anzora8/ANZSIIDX04.dbf     65     ANZSIIDX     10737418240     1310720     AVAILABLE     65     NO     0     0     0     10737352704     1310712     ONLINE
    /oralunaindex/anzora8/ANZSIIDX05.dbf     78     ANZSIIDX     10737418240     1310720     AVAILABLE     78     NO     0     0     0     10737352704     1310712     ONLINE
    /oralunaindex/anzora8/ANZSIIDX06.dbf     85     ANZSIIDX     10737418240     1310720     AVAILABLE     85     NO     0     0     0     10737352704     1310712     ONLINE
    /oralunaindex/anzora8/ANZSIIDX07.dbf     88     ANZSIIDX     10737418240     1310720     AVAILABLE     88     NO     0     0     0     10737352704     1310712     ONLINE
    /oralunaindex/anzora8/ANZSIIDX09.dbf     109     ANZSIIDX               AVAILABLE     109                                   RECOVER
    /oralunaindex/anzora8/ANZSIIDX08.dbf     110     ANZSIIDX     10737418240     1310720     AVAILABLE     110     NO     0     0     0     10737352704     1310712     ONLINE
    We dont use RMAN-Catalog for backup the information is only stored in the controlfile.
    The recovery datafile command with full path including for the datafile failed with the same error message:
    SQL> connect / as sysdba
    Connected.
    SQL> recover datafile '/oralunaindex/anzora8/ANZSIIDX09.dbf';
    ORA-00604: error occurred at recursive SQL level 1
    ORA-01422: exact fetch returns more than requested number of rows
    ORA-06512: at line 20
    ORA-00279: change 10322956311023 generated at 04/10/2013 18:51:23 needed for
    thread 1
    ORA-00289: suggestion : /oralunaarchiv/anzora8/anzora8_1_315326_636567403.arc
    ORA-00280: change 10322956311023 for thread 1 is in sequence #315326
    I guess it is a bug of oracle which will sometimes occur when you give two datafiles the same name in different directories that this poduces errors as above in the RMAN inerface(packages)!?
    Maybe we could force to set he tablespace offline, rename the new added datafiles and ry to bring the tablespace online but nobody knows if it works really and we get the tablespace online again?
    Therefore at the moment maybe it's the best way to move the objects away from this tablespace and than drop them, isn't it?
    regards,
    Marco

  • ORA-01422 exact fetch returns more than requested number of rows on invoice

    Hello developer,
    Current I m facing problem ORA-01422 exact fetch returns more than requested number of rows in Invoce Standard form when we select PO_Default invoice type for some specific PO Number not for all. I m not able to handle the error bcoz im new in oracle apps. it's urgent for user requirement. Plz guide me how to take approch to handle the situation.........
    select Po_Default invoice type=>enter po number=>press ok button=>got error ORA-01422
    I got query from POST_QUERY TRIGEER like
    function get_po_number (l_po_number varchar2,l_vendor_id OUT number) return number is
    l_po_header_id number;
    --Bug fix:1096002
    --Removed the function call UPPER from the WHERE clause so that the query
    --becomes case sensitive.
    -- BUG 2519682 vendor_id added in the Select statement and futher in the fetch statement
    cursor po_number_cursor is
    SELECT po_header_id,vendor_id
    FROM po_headers
    WHERE type_lookup_code IN ('STANDARD', 'BLANKET', 'PLANNED')
    AND approved_flag = 'Y'
    AND segment1 = l_po_number
    -- Bug 2289727. Enhanced Matching Controls to Finally Closed POs
    AND (NVL(closed_code, 'X') <> 'FINALLY CLOSED'
    OR :parameter.show_final_closed_po_flag = 'Y')
    AND PCARD_ID IS NULL; --bug4627502
    /* Commented out since this is not relevant even if executed.
    AND (segment1 LIKE SUBSTR(l_po_number, 1, 2) || '%' OR
    segment1 LIKE SUBSTR(l_po_number, 1, 1) ||
    SUBSTR(l_po_number, 2, 1) || '%' OR
    segment1 LIKE SUBSTR(l_po_number, 1, 1) ||
    SUBSTR(l_po_number, 2, 1) || '%' OR
    segment1 LIKE SUBSTR(l_po_number, 1, 2) || '%' );
    begin
    open po_number_cursor;
    fetch po_number_cursor INTO l_po_header_id,l_vendor_id;
    close po_number_cursor;
    return(l_po_header_id);
    end get_po_number;
    plz help me how to resolved this issue it's urgent.
    thanks in advance.........

    This bug is documented in the following note on metalink.oracle.com
    APXINWKB - Creating PO Default Invoice Errors with ORA-01422 Exact Fetch Returns More Than Requested Number Of Rows [ID 946578.1]
    The solution is to apply patch 8765847.
    Hope this answers your question,
    Sandeep Gandhi

  • URGENT IN The PL/SQL code..ORA-01422: exact fetch returns more than request

    Hi All,
    I am using the Oracle Streams to replicate the data...
    Below is the procedure
    CREATE OR REPLACE PROCEDURE proc_test(in_any sys.anydata)IS
    lcr sys.lcr$_row_record;
    rc pls_integer;
    v_type varchar2(20);
    col_1 sys.anydata;
    lcr_usercountry varchar2(20);
    TRANS varchar2(20);
    BEGIN
    rc:=in_any.GetObject(lcr);
    v_type:=lcr.get_command_type();
    col_1:=lcr.get_value('NEW','USER_COUNTRY');
    rc:=col_1.GetVarchar2(lcr_usercountry);
    select user_country into TRANS from test.TESTREP where USER_COUNTRY=lcr_usercountry;
    IF (TRANS=lcr_usercountry and TRANS='USA')
    THEN
    insert into strmadmin.history_row_lcrs VALUES (SYSDATE, lcr.GET_SOURCE_DATABASE_NAME(), lcr.GET_COMMAND_TYPE(),
    lcr.GET_OBJECT_OWNER(), lcr.GET_OBJECT_NAME(), lcr.GET_TAG(), lcr.GET_TRANSACTION_ID(), lcr.GET_SCN(),
    lcr.GET_COMMIT_SCN,lcr.GET_VALUES('old'), lcr.GET_VALUES('new', 'n'));
    lcr.EXECUTE(true);
    END IF;
    END;
    The procedure executed successfully, but the data is not replicating...
    I get the below error ORA-01422: exact fetch returns more than request in the dba_apply_error view.... because the query in the above procedure which am using returns more than one value ...select user_country into TRANS from test.TESTREP where USER_COUNTRY=lcr_usercountry;
    may be I need to use the cursor for this....
    Can anyone Please advice me writing the cursor ...
    Thanks in Advance..

    Got the solution ....
    Thanks..

  • ORA- 01422: exact fetch returns more than..

    Hello,
    I am new to PL/SQL world. Could anyone help me solve this problem?
    I am trying to run the following block and receive error.
    DECLARE
    v_name VARCHAR2(10);
    BEGIN
    SELECT ename INTO name
    FROM emp;
    END;
    SQL>/
    DECLARE
    ERROR at line 1:
    ORA-01422: exact fetch returns more than requested number of rows
    ORA-06512: at line 4
    Thanks,
    Don

    The SQL statement
    SELECT ename
      FROM emp;will return, in general, a number of records. Your INTO clause is trying to assign an arbitrary number of enames to a single local VARCHAR2 variable. Thus, you get an error if the SELECT returns more than one row.
    If you want to process the rows of the emp table one by one, you'd want to use a cursor, i.e.
    BEGIN
      for x in (SELECT * FROM emp)
      loop
        -- x.ename will be the ename for the current row of the cursor.
        -- Do something with x.ename
      end loop;
    END;For performance reasons, though, it's always going to be better to do things in SQL rather than PL/SQL, operating on sets at a time rather than a row at a time.
    Justin
    Distributed Database Consulting, Inc.
    www.ddbcinc.com

  • Repo error:ORA-01422:exact fetch returns more than requested number of rows

    Hello,
    on my page I have some input fields and a report based on a query (PL/SQL function body returning SQL-Statement). The Where-Clause from this sql-statement depends on the values of the input fields.
    I listed the sql-Statement via htp.p (q ) and copied this displayed statement in sql-editor. There this statement works fine.
    Is there a line-limit for reports?
    Acutally there more than 500 rows in this table.
    When I limit the return data with an value for the where-clause which returns less than 500 rows the results are shown correctly.
    The layout and pagination row count is already set to 2000.
    Which possiblities do I have to solve this problem?
    Thanks in advance
    Regards
    Ulrike
    Message was edited by:
    [email protected]
    Hi,
    I found the problem.
    Unfortunately I'm unable to delete this thread.
    Regards Ulrike

    select ... into <variable>
    means only 1 row can be returned.
    Your select returns more than one row.
    Either change v_txt into a collection, define a cursor and fetch from it, or change the statement so it returns one row.
    Sybrand Bakker
    Senior Oracle DBA

  • ORA-01422: Exact fetch returns more than requested no of rows

    Hi experts.
    There is on requeter and one Supervisor to approve the request. But if see the errors in Workflow Administration Web Applications,see the above error message. How come this error message, if i have one approver in the notication process.That is: the wf_notification sending multiple notifications from single activity in the loop.
    Any idea?????
    Thx

    It is a problemin workflow Notification.
    Refer to:
    OM QUOTE APPROVAL: WF_NOTIFICATION.SEND ERRORS WITH ORA-01422 [ID 1078855.1]
    ORA-01422 error happens in wf_notification.send when multiple notifications are sent from single activity in loop. The query which returns more than one row is in WF_NOTIFICATION.send
    Mehdi

  • Report error: ORA-01422: exact fetch returns more than requested number of rows

    I am getting this error in tabular form which is to be populated by selecting an item called week description in that page through a dynamic action.
    In main table I have two primary keys and so two foreign keys is detail even though it is not a type of master detail form.
    when I select week description item and related records in tabular form to shown.But it is giving baove error.
    In main table there  two same records ,in that records user name is different that defines the unique ness of record.

    Hi,
    2709643 wrote:
    Please update your profile handler with some meaningful name
    I am getting this error in tabular form which is to be populated by selecting an item called week description in that page through a dynamic action.
    In main table I have two primary keys and so two foreign keys is detail even though it is not a type of master detail form.
    when I select week description item and related records in tabular form to shown.But it is giving baove error.
    In main table there  two same records ,in that records user name is different that defines the unique ness of record.
    It is difficult to tell you the exact solution with the given information.
    please create a sample on apex.oracle.com that helps us to investigate the problem and give you appropriate solution.
    Regards,
    Jitendra

  • ORA-01422: exact fetch returns more than requested number of rows

    HI All,
    I am using oracle forms 10 and my db is 10g
    I have developed a Query find window(ie a canvas to find the data in the table and it will movethe navigat with 10 fields,namely like po number ,guarantee number , guarantee type, issue date,expiry date etc.
    when the user enter the po number in the query find window and click find button i am getting this error.When i ckick ok to that error and its move to next canvas and data get queried.
    In my find button i have this code.
    procedure XXBANK_GUARANTEE_FIND_DATA is
    cursor c_query_find_details
    is
    select Distinct C_PROJECT_ID,C_PO_NUMBER,C_BG_TYPE,C_SUPPLIER_NAME,C_SUPPLIER_SITE_NAME,
    C_GUARANTEE_NUMBER,C_EXPIRY_DATE,C_AMOUNT,C_CURRENCY_CODE,
    C_FUNCTIONAL_AMOUNT,C_STATUS,C_BANK_NAME,C_BANK_BRANCH_NAME,C_GUAR_ISSUE_DATE,
    C_RECEIVED_DATE,C_CONVERSION_TYPE,C_CONVERSION_DATE,C_EXCHANGE_RATE,
    C_APPROVAL_DATE,C_APPROVAL_STATUS,C_REVISION_NUMBER,C_ORIGINAL_RECEIVED,
    C_ORIGINAL_RET_TO_PARTY,C_REMARKS from XXBGS_BANK_GUARANTEE_MASTER
    where (C_PO_NUMBER= :QUERY_FIND_BLK.C_PO_NUMBER or :QUERY_FIND_BLK.C_PO_NUMBER is null)
    and (C_PROJECT_ID=:QUERY_FIND_BLK.C_PROJECT_NAME or :QUERY_FIND_BLK.C_PROJECT_NAME is null)
    and (C_SUPPLIER_NAME= :QUERY_FIND_BLK.C_SUPPLIER_NAME or :QUERY_FIND_BLK.C_SUPPLIER_NAME is null)
    and (C_SUPPLIER_SITE_NAME= :QUERY_FIND_BLK.C_SUPPLIER_SITE or :QUERY_FIND_BLK.C_SUPPLIER_SITE is null)
    and (C_GUARANTEE_NUMBER= :QUERY_FIND_BLK.C_GUARANTEE_NO or:QUERY_FIND_BLK.C_GUARANTEE_NO is null)
    and (C_BG_TYPE= :QUERY_FIND_BLK.C_GUARANTEE_TYPE or :QUERY_FIND_BLK.C_GUARANTEE_TYPE is null)
    and (C_GUAR_ISSUE_DATE= :QUERY_FIND_BLK.C_FROM_DATE or :QUERY_FIND_BLK.C_FROM_DATE is null)
    and (C_RECEIVED_DATE= :QUERY_FIND_BLK.C_TO_DATE or :QUERY_FIND_BLK.C_TO_DATE is null);
    begin
    go_block('BANK_GUARANTEE_BLK');
    CLEAR_BLOCK (no_validate);
    for c_query_find_details_rec in c_query_find_details
    loop
    :BANK_GUARANTEE_BLK.C_PROJECT := c_query_find_details_rec.C_PROJECT_ID;
    :BANK_GUARANTEE_BLK.C_PO_NUMBER := c_query_find_details_rec.C_PO_NUMBER;
    :BANK_GUARANTEE_BLK.C_BG_TYPE := c_query_find_details_rec.C_BG_TYPE;
    :BANK_GUARANTEE_BLK.C_SUPPLIER_NAME := c_query_find_details_rec.C_SUPPLIER_NAME;
    :BANK_GUARANTEE_BLK.C_SUPPLIER_SITE_NAME := c_query_find_details_rec.C_SUPPLIER_SITE_NAME;
    :BANK_GUARANTEE_BLK.C_GUARANTEE_NO := c_query_find_details_rec.C_GUARANTEE_NUMBER;
    :BANK_GUARANTEE_BLK.C_EXPIRY_DATE := c_query_find_details_rec.C_EXPIRY_DATE;
    :BANK_GUARANTEE_BLK.C_AMOUNT := c_query_find_details_rec.C_AMOUNT;
    :BANK_GUARANTEE_BLK.C_CURRENCY_CODE := c_query_find_details_rec.C_CURRENCY_CODE;
    :BANK_GUARANTEE_BLK.C_FUNCTIONAL_AMOUNT := c_query_find_details_rec.C_FUNCTIONAL_AMOUNT;
    :BANK_GUARANTEE_BLK.C_STATUS := c_query_find_details_rec.C_STATUS;
    :BANK_GUARANTEE_BLK.C_BANK_NAME := c_query_find_details_rec.C_BANK_NAME;
    :BANK_GUARANTEE_BLK.C_BANK_BRANCH_NAME := c_query_find_details_rec.C_BANK_BRANCH_NAME;
    :BANK_GUARANTEE_BLK.C_ISSUE_DATE := c_query_find_details_rec.C_GUAR_ISSUE_DATE;
    :BANK_GUARANTEE_BLK.C_RECEIVED_DATE := c_query_find_details_rec.C_RECEIVED_DATE;
    :BANK_GUARANTEE_BLK.C_CONVERSION_TYPE := c_query_find_details_rec.C_CONVERSION_TYPE;
    :BANK_GUARANTEE_BLK.C_CONVERSION_DATE := c_query_find_details_rec.C_CONVERSION_DATE;
    :BANK_GUARANTEE_BLK.C_EXCHANGE_RATE := c_query_find_details_rec.C_EXCHANGE_RATE;
    :BANK_GUARANTEE_BLK.C_APPROVED_DATE := c_query_find_details_rec.C_APPROVAL_DATE;
    :BANK_GUARANTEE_BLK.C_APPROVED_STATUS := c_query_find_details_rec.C_APPROVAL_STATUS;
    :BANK_GUARANTEE_BLK.C_REVISION_NUMBER := c_query_find_details_rec.C_REVISION_NUMBER;
    :BANK_GUARANTEE_BLK.C_ORIGINALRECEIVED := c_query_find_details_rec.C_ORIGINAL_RECEIVED;
    :BANK_GUARANTEE_BLK.C_ORIGINALRETURNEDTOPARTY := c_query_find_details_rec.C_ORIGINAL_RET_TO_PARTY;
    :BANK_GUARANTEE_BLK.C_REMARK:= c_query_find_details_rec.C_REMARKS;
    NEXT_RECORD;
    end loop;
    FIRST_RECORD;
    Exception
         when too_many_rows then
         null;
         when others then
         null;
    end XXBANK_GUARANTEE_FIND_DATA;
    Any help is appricatable.
    Regards
    Srikkanth

    Why are you manually populating your block? Since your are only querying the XXBGS_BANK_GUARANTEE_MASTER table, why not base your BANK_GUARANTEE_BLK on this table and use your :QUERY_FIND_BLK as the source for modifying the DEFAULT_WHERE clause of the BANK_GUARANTEE_BLK block. Then you don't have to do all of the "OR" clauses in your WHERE clause; which is where your problem is. :) Then you just need to test for which items in your QUERY_FIND_BLK are not null and add these to the DEFAULT_WHERE clause programatically. For example:
    DECLARE
      v_def_where   VARCHAR2(2000);
    BEGIN
      IF ( :QUERY_FIND_BLK.C_PROJECT_NAME IS NOT NULL ) THEN
        v_def_where := v_def_where||' C_PROJECT_ID = '||:QUERY_FIND_BLK.C_PROJECT_NAME ;
      END IF;
      IF ( :QUERY_FIND_BLK.C_PROJECT_NAME IS NOT NULL ) THEN
        v_def_where := v_def_where||' C_PROJECT_NAME  = '||:QUERY_FIND_BLK.C_PROJECT_NAME ;
      END IF;
      etc....
      Go_Block('BANK_GUARANTEE_BLK');
      Execute_Query;
    END;If you absolutely must manually populate your block, then I suggest you copy your query into SQL Developer/Toad/your favorite SQL Tool and refine your SQL Statement so that it returns a single record for a PO Number.
    Craig...

  • On LOGIN: 01422 exact fetch returns more than requested number of rows

    hi -- When logging into an application (as any valid user) I get the above error message (01422 - exact fetch returns more than requested number of rows) on page submit. However, when I go into DEBUG mode (where there are also prompts for username and password) I don't get the error message --I'm logged into the app just fine.
    Any idea what this is about? I don't know query APEX is trying to execute;
    it certainly doesn't make sense to me that it works while in DEBUG mode.
    Note: this is an app in development that's been sitting dormant for 6 months due
    to lack of funding. The login worked 6 months ago, but now know. Don't know if
    that's helpful information...
    Thanks,
    Carol

    hi Scott -- Your question made me think to examine not only the login process,
    but other processes I'd added to the page -- and that's where the problem was!
    (My brain is a bit rusty on the APEX re-entry process).
    Thanks for the spark :)
    Carol

  • Error: exact fetch returns more than requested number of rows.

    i need to do a count function in report builder, the sql works in sql developer.
    but in reports i get an error:
    ORA-01422: exact fetch returns more than requested number of rows.
    function CF_SUB_DUE_TO_EXPIRE return number is
    x_sub_due_to_expire number := NULL;
    begin
    select count(o.contract_number)
    into x_sub_due_to_expire
    from xxpub_calendar_plan_hdr_v h, OKS_AUTH_headers_V o, OKS_AUTH_lines_V l
    where o.id = l.chr_id
    and h.inventory_item_id =o.inv_organization_id
    and o.end_date = h.issue_date
    --AND ROWNUM = 1
    group by h.publication_code, h.issue_number;

    Try to sum all the ccounts that you recieve from your privieous query. Like this:
    select sum(count(o.contract_number))
    into x_sub_due_to_expire
    from xxpub_calendar_plan_hdr_v h,
         OKS_AUTH_headers_V o,
         OKS_AUTH_lines_V l
    where o.id = l.chr_id
    and h.inventory_item_id =o.inv_organization_id
    and o.end_date = h.issue_date
    group by h.publication_code, h.issue_number; Or simply remove the group by condition (the resulting count might be different).
    select count(o.contract_number)
    into x_sub_due_to_expire
    from xxpub_calendar_plan_hdr_v h,
         OKS_AUTH_headers_V o,
         OKS_AUTH_lines_V l
    where o.id = l.chr_id
    and h.inventory_item_id =o.inv_organization_id
    and o.end_date = h.issue_date;

  • Exact fetch returns more than requested number of rows oracle error ; unable to find where exactly throwing error in the below code.

    hi i am receiving "exact fetch returns more than requested number of rows oracle error". but i am not able to locate the error in the below code. Any help would be appreciated!!!
    CREATE OR REPLACE PROCEDURE load_scene_collection_item (
    --pdname                                  VARCHAR2,
    -- LOCATION TO ADD/CHANGE below!!!
    pITEM_TYPE_ID                      INTEGER,
    pSCENE_COLLECTION_ID        INTEGER,
    pCOLLECTION_ITEM_NAME     VARCHAR2,
    pCOLLECTION_ITEM_DESC      VARCHAR2,
    pDEFAULT_COORD_X      NUMBER,
    pDEFAULT_COORD_Y      NUMBER,
    pDEFAULT_COORD_Z      NUMBER,
    pDEFAULT_WIDTH            NUMBER,
    pDEFAULT_HEIGHT            NUMBER,
    pDEFAULT_ROTATION      INTEGER,
    pDEFAULT_ALPHA            INTEGER,
    pfname                                 VARCHAR2)    IS
    src_file BFILE;
    dst_file BLOB;
    lgh_file BINARY_INTEGER;
    BEGIN
    src_file := bfilename('BUSINESSBLOBSIMAGES', pfname);
    -- insert a NULL record to lock
    Insert into SCENE_COLLECTION_ITEM
       ( ITEM_TYPE_ID,
       SCENE_COLLECTION_ID,
       COLLECTION_ITEM_NAME,
       COLLECTION_ITEM_DESC,
        COLLECTION_ITEM_IMAGE,
       DEFAULT_COORD_X,
       DEFAULT_COORD_Y,
       DEFAULT_COORD_Z,
       DEFAULT_WIDTH,
       DEFAULT_HEIGHT,
       DEFAULT_ROTATION,
       DEFAULT_ALPHA,
        CREATE_USER,
        CREATE_DATE)
    Values    ( pITEM_TYPE_ID, pSCENE_COLLECTION_ID, pCOLLECTION_ITEM_NAME, pCOLLECTION_ITEM_DESC, EMPTY_BLOB(),   
       pDEFAULT_COORD_X,
       pDEFAULT_COORD_Y,
       pDEFAULT_COORD_Z,
       pDEFAULT_WIDTH,
       pDEFAULT_HEIGHT,
       pDEFAULT_ROTATION,
       pDEFAULT_ALPHA,  
    sys_context('USERENV', 'OS_USER'), 
    sys_extract_utc(systimestamp))
    RETURNING COLLECTION_ITEM_IMAGE INTO dst_file;
    -- LOCATIONs(2) TO ADD/CHANGE above!!!
    -- lock record
    SELECT COLLECTION_ITEM_IMAGE
    INTO dst_file
    FROM SCENE_COLLECTION_ITEM
    WHERE ITEM_TYPE_ID     = pITEM_TYPE_ID
    AND SCENE_COLLECTION_ID = pSCENE_COLLECTION_ID
    AND COLLECTION_ITEM_NAME= pCOLLECTION_ITEM_NAME
    AND COLLECTION_ITEM_DESC= pCOLLECTION_ITEM_DESC
    AND    pDEFAULT_COORD_X = DEFAULT_COORD_X
    AND   pDEFAULT_COORD_Y  = DEFAULT_COORD_Y
    AND   pDEFAULT_COORD_Z  = DEFAULT_COORD_Z
    AND   pDEFAULT_WIDTH    = DEFAULT_WIDTH
    AND   pDEFAULT_HEIGHT   = DEFAULT_HEIGHT
    AND   pDEFAULT_ROTATION = DEFAULT_ROTATION
    AND   pDEFAULT_ALPHA    = DEFAULT_ALPHA
    FOR UPDATE;
    -- LOCATION TO ADD/CHANGE above!!!
    -- open the file
    dbms_lob.fileopen(src_file, dbms_lob.file_readonly);
    -- determine length
    lgh_file := dbms_lob.getlength(src_file);
    -- read the file
    dbms_lob.loadfromfile(dst_file, src_file, lgh_file);
    -- update the blob field
    UPDATE SCENE_COLLECTION_ITEM
    SET COLLECTION_ITEM_IMAGE = dst_file
    WHERE ITEM_TYPE_ID     = pITEM_TYPE_ID
    AND SCENE_COLLECTION_ID = pSCENE_COLLECTION_ID
    AND COLLECTION_ITEM_NAME= pCOLLECTION_ITEM_NAME
    AND COLLECTION_ITEM_DESC= pCOLLECTION_ITEM_DESC
    AND    pDEFAULT_COORD_X = DEFAULT_COORD_X
    AND   pDEFAULT_COORD_Y  = DEFAULT_COORD_Y
    AND   pDEFAULT_COORD_Z  = DEFAULT_COORD_Z
    AND   pDEFAULT_WIDTH    = DEFAULT_WIDTH
    AND   pDEFAULT_HEIGHT   = DEFAULT_HEIGHT
    AND   pDEFAULT_ROTATION = DEFAULT_ROTATION
    AND   pDEFAULT_ALPHA    = DEFAULT_ALPHA
    -- LOCATION TO ADD/CHANGE above!!!
    -- close file
    dbms_lob.fileclose(src_file);
    END load_scene_collection_item;
    Thanks in advance!!!!

    Hi PaulHorth,
    Thanks for the quick reply.
    Actually, i am getting  error while updating the records.
    below is the error message:
    Error starting at line 1 in command:
    exec load_scene_collection_item(3,15,'2 Lane 4way Stop','4 Way Stop Intersection with 2 lanes in each direction',0,0,0,400,517,0,1,'2 Lane 4way Stop.PNG');
    Error report:
    ORA-01422: exact fetch returns more than requested number of rows
    ORA-06512: at "DP_OWNER.LOAD_SCENE_COLLECTION_ITEM", line 55
    ORA-06512: at line 1
    01422. 00000 - "exact fetch returns more than requested number of rows"
    *Cause:    The number specified in exact fetch is less than the rows returned.
    *Action:   Rewrite the query or change number of rows requested

  • PROCEDURE PROBLEM - Exact Fetch Returns More Than Requested Number of Rows

    Here is my procedure:
    CREATE OR REPLACE PROCEDURE question4
      ( cust_first IN customer.custfirstname%TYPE,
       cust_last IN customer.custlastname%TYPE,
       customer_no OUT customer.customerSsn%TYPE,
       cust_address OUT customer.address%TYPE,
       loanID OUT loan.loanNo%TYPE,
       application_date OUT loan.appdate%TYPE,
       remaining_payments OUT loan.remainingpaymentsdue%TYPE,
       loan_amount OUT loan.loanamount%TYPE,
       loan_term OUT loan.loanterm%TYPE,
       interest_rate OUT loan.interestrate%TYPE,
       monthly_payment OUT loan.monthlypayment%TYPE)
       AS
    BEGIN
      SELECT customerssn, address  INTO customer_no, cust_address FROM CUSTOMER WHERE custfirstname= cust_first AND custlastname = cust_last;
      SELECT loanno, remainingpaymentsdue, loanamount, loanterm, interestrate, monthlypayment, appdate INTO loanID, remaining_payments, loan_amount, loan_term, interest_rate, monthly_payment, application_date FROM LOAN WHERE customerSsn = customer_no;
      EXCEPTION
        WHEN OTHERS
        THEN
        NULL;
    END;Here is the anonymous block showing the use of my procedure.
    SET SERVEROUTPUT ON
    DECLARE
      customer_number customer.customerSsn%TYPE := NULL;
      customer_address customer.address%TYPE := NULL;
      loan_number loan.loanNo%TYPE := NULL;
      app_date loan.appdate%TYPE := NULL;
      rem_payment loan.remainingpaymentsdue%TYPE := NULL;
      l_amount loan.loanamount%TYPE := NULL;
      l_term loan.loanterm%TYPE := NULL;
      i_rate loan.interestrate%TYPE := NULL;
      m_payment loan.monthlypayment%TYPE := NULL;
      view_customerSSN NUMBER;
      view_address VARCHAR2(50);
      view_loanID NUMBER;
      view_date DATE;
      view_remaining_payment NUMBER;
      view_loan_amount NUMBER(8,2);
      view_loan_term VARCHAR2(10);
      view_interest_rate FLOAT(20);
      view_monthly_payment NUMBER(8,2);
    BEGIN
      question4 ('Tim', 'Thompson',  customer_number, customer_address, loan_number, app_date, rem_payment, l_amount, l_term, i_rate, m_payment);
      IF (customer_number IS NULL OR customer_address IS NULL OR loan_number IS NULL OR app_date IS NULL
      OR rem_payment IS NULL OR l_amount IS NULL OR l_term IS NULL OR i_rate IS NULL OR m_payment IS NULL) THEN
         DBMS_OUTPUT.PUT_LINE ('NULL VALUE');
      ELSE
        view_customerSSN := customer_number;
        view_address := customer_address;
        view_loanID := loan_number;
        view_date := app_date;
        view_remaining_payment := rem_payment;
        view_loan_amount := l_amount;
        view_loan_term := l_term;
        view_interest_rate := i_rate;
        view_monthly_payment := m_payment;
        DBMS_OUTPUT.PUT_LINE ('CUSTOMER NO : ' ||  view_customerSSN);
        DBMS_OUTPUT.PUT_LINE ('CUSTOMER ADDRESS : ' ||  view_address);
        DBMS_OUTPUT.PUT_LINE ('LOAN NO : ' ||  view_loanID);
        DBMS_OUTPUT.PUT_LINE ('LOAN APPLICATION DATE : ' ||  view_date);
        DBMS_OUTPUT.PUT_LINE ('REMAINING PAYMENTS : ' ||  view_remaining_payment);
        DBMS_OUTPUT.PUT_LINE ('LOAN AMOUNT : ' ||  view_loan_amount);
        DBMS_OUTPUT.PUT_LINE ('LOAN TERM : ' ||  view_loan_term);
        DBMS_OUTPUT.PUT_LINE ('INTEREST RATE : ' ||  view_interest_rate);
        DBMS_OUTPUT.PUT_LINE ('MONTHLY PAYMENT : ' ||  view_monthly_payment);
      END IF;
    END;
    /Error Message:
    Error report:
    ORA-06550: line 21, column 3:
    PLS-00306: wrong number or types of arguments in call to 'QUESTION4'
    ORA-06550: line 21, column 3:
    PL/SQL: Statement ignored
    *06550. 00000 - "line %s, column %s:\n%s"*
    **Cause: Usually a PL/SQL compilation error.*
    **Action:*
    What is the problem here? Could you anyone help me?
    Thanks for your help from now on.
    Have a beautiful day...
    Edited by: RobertPires on May 1, 2011 5:13 PM
    Edited by: RobertPires on May 1, 2011 8:19 PM

    Thanks for your help, Sir. As you see it as above, I fixed the order of parameters, but since I would like to display multiple records, my procedure did not work properly and I got this error message:
    Error report:
    ORA-01422: exact fetch returns more than requested number of rows
    ORA-06512: at "S4048958.QUESTION4", line 20
    ORA-06512: at line 21
    *01422. 00000 - "exact fetch returns more than requested number of rows"*
    **Cause: The number specified in exact fetch is less than the rows returned.*
    **Action: Rewrite the query or change number of rows requested*
    I guess I need to create a cursor in my procedure, but I dunno how. Could you give me some suggestion for this please?
    Thanks again...

Maybe you are looking for

  • Hard Drive vansihed from Desktop - now I can't boot from it.

    Hello I was doing some repair work on my HD form my external portable USB, all went well. But when finished and picking up my macbook I accidentally pulled out the usb cable on the external drive. When I reboot my macbook from the usb drive I could n

  • PDF form not opening in the IE 7.0.6 version

    Hi, I am facing a problem with E-Travel application. The user needs to attach document. After attached the pdf document unable to view the attachment in the browser it shows the blank page not the pdf. But in the earlier version of IE it is able to v

  • How do you make a Portfolio in Photoshop and Publish it.

    Hi I have found many tutorials on making a portfolio in Photoshop but once you have created your layout how are you supposed to make it into a website?  This might be a really stupid question but help would be greatly appreciated. Oh and the Portfoli

  • Javac command line program can use class, need tomcat to do same

    This may be simple, but any assistance to a newby would be greatly aprreciated. I have a this class file: import java.io.*; public class OCrypt static public String getEncryptedText (String plainText) Runtime R; String _encryptedText = ""; char[] som

  • Time Approval Rejection in workflow

    Hi , Can anyone provide the workflow configuration details in CATS and also during the approval process of CATS,if an employee got rejected ,his notification has to reach to his own account instead of Business Workplace. If anyone provide me the solu