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

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.

  • 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...

  • 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

  • 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;

  • 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

  • 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

  • Stuck with Exact fetch returns more than requested number of rows!

    Hi
    I've written the following code where i want to insert an id number into a package to update a record.
    declare myvar NUMBER; begin SELECT App.id into myvar FROM people_units pu LEFT OUTER JOIN(
    SELECT pu.id,pu.record_date,pu.unit_instance_code,pu.person_code,pu.calocc_code,pu.record_date As received
    FROM people_units pu) App ON pu.person_code = App.person_code AND Trunc(pu.record_date) = Trunc(App.record_date)
    WHERE pu.id = 79474; ebs_units_pkg.AddProgressHistory(myvar,'AUTO');end;
    when i run the query in SQL i get the error message ORA-01422 - Exact fetch returns more than expected number of rows.
    Can anyone help me rseolve this error? The select statement may return more than one row which im guessing is the cause of the problem. If the select statement does return more than one value. 2 rows for example, i would like the package to update the 2 rows. Ive never really done any work with PL/SQL before so at a loss at where to begin!!

    Do the select and the update all in one step. It will be much easier then.
    Example:
    UPDATE people_units
    SET yourColumn = calculatedValue
    WHERE id = 79474

  • 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 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...

  • 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

  • Exact fetch returns more than requested number of rows

    Hi All, I have written sample code, in the 2nd curosr loop it is retriving me lot of records, yes will have if i select the statement. but i need all the organization id to be displayed. then i will check item exists in that organization if not assign the item.
    Can any help me in this code to in working condition.
    declare
    l_organization_id pls_integer;
    l_org_id pls_integer;
    l_chk pls_integer;
    cursor c1 is
    select item_id, organization_id, item_code, org_id, bar_code, active_flag, description,
    from jbks_item_master
    where trunc(last_update_date) >= '02-AUG-2009'
    and trunc(last_update_date) <= '02-AUG-2009'
    and org_id = 21;
    cursor c2 (l_org_id in number)is -- here is the problem
    select distinct currency_code
    from jbks_inv_org_master
    where org_id = l_org_id;
    begin     
    for r1 in c1 loop
    for r2 in c2(r1.org_id) loop
    select organization_id, org_id
    into l_organization_id, l_org_id
    from jbks_inv_org_master
    where currency_code = r2.currency_code;
    end loop; -- c2
    begin
    select 1
    into l_chk
    from jbks_item_master
    where organization_id = l_organization_id;
    exception
    when no_data_found then
    insert into jbks_item_master
    (item_id, organization_id, item_code, org_id, bar_code, active_flag, description)
    values (r1.item_id, l_organization_id, r1.item_code, l_org_id, r1.bar_code, r1.active_flag, r1.description);
    end;
    end loop; --c1
    end;
    thnxs
    Siva

    Hi Sivaprasad,
    sivaprasad wrote:  i need all the organization id to be displayed.but in you query its written like this
    cursor c1 is
    select item_id, organization_id, item_code, org_id, bar_code, active_flag, description,
    from jbks_item_master
    where trunc(last_update_date) >= '02-AUG-2009'
    and trunc(last_update_date) <= '02-AUG-2009'
    and org_id = 21;           -----remove this to get data for all org_id.

  • Exact fetch returns more than requested number: Retrieve first row

    I have this statement:
    FOR l IN C1 LOOP
    select amount,customer_id   INTO F_AMT,I_custid from zerorize where doc_id = l.doc_id and trans_type = C_py;
    END LOOP;I hit the this error:
    ORA-01422: exact fetch returns more than requested number of rows
    ORA-06512: at line 172I will like to amend my sql statement in such a way it will retrieve the first row. How am I suppose to add my where condition clause?

    gerd_99 wrote:
    BluShadow wrote:
    If you don't have a means of restricting your query to only return 1 row based on data you would have to use the row number...
    e.g.
    select data, data2, .....
    from (
    select data, data2, ....., rownum rn
    from table
    where rn = 1
    In this case you even don´t need the inline view:I know, but if an "order by" is included in the inline view then it's necessary as rownum is assigned before the ordering is done, hence it is always safer to do it this way. ;)

  • 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

  • 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..

Maybe you are looking for

  • Error in User integration with SRM

    Hi Everyone, We are using SRM5.0 and Classic Scenario. We have a issue with user integration. One user for whom i am trying to integrate into SRM system but it is not integrating properly. In USERS_GEN, I am getting error as ' Assignment : Business p

  • Ipod will not update music from itunes on library have music but no sound

    My itunes music library plays fine on the computer but when I tried to transfer it I get no sound. I got an error message that it cannot open URL. I don't want to have to restore this tell me it's not so. I have over 2500 songs.

  • Email Submit Button - Crash (Not severe)

    To reproduce: 1. Create a new blank form. Select Next. 2. Select Defaults. Select Next. 3. Select any Return Method (E.g. Print) Select Next. 4. Select Finish to start. 5. Insert an Email Submit Button. 6. Leave the Email Address and Subject fields b

  • [Solved] Google Earth has caught signal 11

    I'm trying to run Google Earth 7 (latest, AUR: google-earth), but it alway crash after splash screen, output from terminal: aurelio@Victor-A /opt/google/earth/free % google-earth Google Earth has caught signal 11. We apologize for the inconvenience,

  • Firefox refuses to update past v2 despite numerous attempts

    Hi! After seeing repeated nag msgs from youtube etc informing me I was using an out of date browser, I downloaded v 3.6 from mozilla website. I ran the program... it did 'a little housekeeping' and updated my FF, or so I thought... fast forward a cou