First 4.0.0.12.84 (ORA-01427 einreihig subquery returns more than one line)

Hi Jeff,

I use the ai2 since September 13 and I got this error when I run several reports from the RAC (2 knots) databases.

For ex.    in the DBA Panel, according to the Performance option, when I try to launch ASHES for las 5 minutes, the ORA-01427 out immediately.

I want just to be sure you're already aware of this problem and taken into account for the next version.

Thanks in advance,

Andraly Ng

EA3 just came out a few hours ago - have a go at it and let us know what you think!

Tags: Database

Similar Questions

  • "ORA-01427: einreihig subquery returns more than one line.

    Hi all
    I have a SQL query where I need a subquery for certain fields (like fields are optional), and the thing is some of the subqueries are works well, but when I use some, it gives me an error * "ORA-01427: einreihig subquery returns more rows" *, so I looked to the top of the internet and found if I give *' and rownum = 1' * in the subquery ". It eliminates the error and there certainly, but the thing is I have test the XML data. I have two addresses that should appear on the report and both follow the same path, but one is required optional and another so I put the option in the subquery, but in the XML data, I see that both addresses are the same, but they need to be different, because the status of the relationship with that I question is different. I ALSO POST MY SQL so that if anyone of you has an idea can help out me. Once more, the sql, I put here has the SQL subqueries with ' and rownum = 1', which gives me bad output

    Select S_FN_INCEXP_CON. RELATION_TYPE_CD as RELATION_TYPE_CD,
    S_ORDER. ORDER_NUM as ORDER_NUM,
    S_ORDER. FRGHT_AMT as FRGHT_AMT,
    S_ORDER. ORDER_DT as ORDER_DT,
    S_ORDER. CARRIER_CD as CARRIER_CD,
    S_ORDER. CARRIER_PRIO_CD as CARRIER_PRIO_CD,
    S_ORDER. ACCNT_ORDER_NUM as ACCNT_ORDER_NUM,
    S_CONTACT. FST_NAME as FST_NAME,
    S_CONTACT. Last_name like LAST_NAME,
    S_ADDR_PER. ADDR_NAME as ADDR_NAME-> it's the address required
    S_ADDR_PER. POSTAL CODE such as POSTAL code,
    S_CON_ADDR. ADDR_MAIL_CD as ADDR_MAIL_CD,
    S_ADDR_PER. EMAIL_ADDR as EMAIL_ADDR,
    S_ADDR_PER. PH_NUM as PH_NUM,
    S_SRC_PAYMENT. PAYMENT_NUM as PAYMENT_NUM,
    S_ORDER. STATUS_CD as STATUS_CD,
    (select S_FN_INCEXP_CON_1.RELATION_TYPE_CD
    of SIEBEL. S_CONTACT S_CONTACT_1,
    SIEBEL. S_FN_INCEXP_CON S_FN_INCEXP_CON_1
    where S_ORDER. ROW_ID = S_FN_INCEXP_CON_1.FN_INCM_EXP_ID
    and S_FN_INCEXP_CON_1.CONTACT_ID = S_CONTACT_1.ROW_ID
    and S_FN_INCEXP_CON_1.RELATION_TYPE_CD! = ALL ('Donor', 'Notified Party', ' in memory of ', ' in honor of ')) RELATION_TYPE_CD_1

    , (select S_CONTACT_1.FST_NAME |') '|| S_CONTACT_1.LAST_NAME
    of SIEBEL. S_CONTACT S_CONTACT_1,
    SIEBEL. S_FN_INCEXP_CON S_FN_INCEXP_CON_1
    where S_ORDER. ROW_ID = S_FN_INCEXP_CON_1.FN_INCM_EXP_ID
    and S_FN_INCEXP_CON_1.CONTACT_ID = S_CONTACT_1.ROW_ID
    and S_FN_INCEXP_CON_1.RELATION_TYPE_CD! = ALL ('Donor', 'Notified Party', ' in memory of ', ' in honor of ')) NAME.

    (select S_ORDER_TYPE.NAME
    of SIEBEL. S_ORDER_TYPE S_ORDER_TYPE
    where S_ORDER. ORDER_TYPE_ID = S_ORDER_TYPE. ROW_ID
    and S_ORDER_TYPE.NAME = 'Général'), GENERAL

    (select S_ORDER_TYPE.NAME
    of SIEBEL. S_ORDER_TYPE S_ORDER_TYPE
    where S_ORDER. ORDER_TYPE_ID = S_ORDER_TYPE. ROW_ID
    and S_ORDER_TYPE.NAME = 'Memory') MEMORY,

    (select S_ORDER_TYPE.NAME
    of SIEBEL. S_ORDER_TYPE S_ORDER_TYPE
    where S_ORDER. ORDER_TYPE_ID = S_ORDER_TYPE. ROW_ID
    and S_ORDER_TYPE.NAME = 'Honour') HONOR,.

    (select S_FN_INCEXP_CON_1.RELATION_TYPE_CD
    of SIEBEL. S_CONTACT S_CONTACT_1,
    SIEBEL. S_FN_INCEXP_CON S_FN_INCEXP_CON_1
    where S_ORDER. ROW_ID = S_FN_INCEXP_CON_1.FN_INCM_EXP_ID
    and S_FN_INCEXP_CON_1.CONTACT_ID = S_CONTACT_1.ROW_ID
    and S_FN_INCEXP_CON_1.RELATION_TYPE_CD = ' in memory of ') R1,.

    (select S_FN_INCEXP_CON_1.RELATION_TYPE_CD
    of SIEBEL. S_CONTACT S_CONTACT_1,
    SIEBEL. S_FN_INCEXP_CON S_FN_INCEXP_CON_1
    where S_ORDER. ROW_ID = S_FN_INCEXP_CON_1.FN_INCM_EXP_ID
    and S_FN_INCEXP_CON_1.CONTACT_ID = S_CONTACT_1.ROW_ID
    and S_FN_INCEXP_CON_1.RELATION_TYPE_CD = ' in honor of ") R2,.


    (select S_FN_INCEXP_CON_1.RELATION_TYPE_CD
    of SIEBEL. S_CONTACT S_CONTACT_1,
    SIEBEL. S_FN_INCEXP_CON S_FN_INCEXP_CON_1
    where S_ORDER. ROW_ID = S_FN_INCEXP_CON_1.FN_INCM_EXP_ID
    and S_FN_INCEXP_CON_1.CONTACT_ID = S_CONTACT_1.ROW_ID
    and S_FN_INCEXP_CON_1.RELATION_TYPE_CD = 'notified Party') R3.

    (select S_ADDR_PER. ADDR_NAME | ',' | S_ADDR_PER. Zip code
    of SIEBEL. S_ADDR_PER S_ADDR_PER,
    SIEBEL. S_CON_ADDR S_CON_ADDR,
    SIEBEL. S_CONTACT S_CONTACT_1,
    SIEBEL. S_FN_INCEXP_CON S_FN_INCEXP_CON_1
    where S_ORDER. ROW_ID = S_FN_INCEXP_CON_1.FN_INCM_EXP_ID
    and S_FN_INCEXP_CON_1.CONTACT_ID = S_CONTACT_1.ROW_ID
    and S_CONTACT. ROW_ID = S_CON_ADDR. CONTACT_ID
    and S_CON_ADDR. ADDR_PER_ID = S_ADDR_PER. ROW_ID
    and rownum = 1
    and S_FN_INCEXP_CON_1.RELATION_TYPE_CD IN 'Notified Party') NP_ADDR-> it's the optional address


    (select S_PARTY_REL. REL_TYPE_CD
    of SIEBEL. S_PARTY_REL S_PARTY_REL,
    SIEBEL. S_CONTACT S_CONTACT_1,
    SIEBEL. S_FN_INCEXP_CON S_FN_INCEXP_CON_1
    where S_ORDER. ROW_ID = S_FN_INCEXP_CON_1.FN_INCM_EXP_ID
    and S_FN_INCEXP_CON_1.CONTACT_ID = S_CONTACT_1.ROW_ID
    and S_PARTY_REL. REL_PARTY_ID = S_CONTACT_1.ROW_ID
    and S_FN_INCEXP_CON_1.RELATION_TYPE_CD = ' in memory of ') RLNSHIP


    of SIEBEL. S_CONTACT S_CONTACT,
    SIEBEL. S_FN_INCEXP_CON S_FN_INCEXP_CON,
    SIEBEL. S_ORDER S_ORDER,
    SIEBEL. S_ADDR_PER S_ADDR_PER,
    SIEBEL. S_CON_ADDR S_CON_ADDR,
    SIEBEL. S_SRC_PAYMENT S_SRC_PAYMENT
    where S_ORDER. ROW_ID = S_FN_INCEXP_CON. FN_INCM_EXP_ID
    and S_FN_INCEXP_CON. CONTACT_ID = S_CONTACT. ROW_ID
    and S_CONTACT. ROW_ID = S_CON_ADDR. CONTACT_ID
    and S_CON_ADDR. ADDR_PER_ID = S_ADDR_PER. ROW_ID
    and S_FN_INCEXP_CON. RELATION_TYPE_CD = 'donor '.
    and S_SRC_PAYMENT. ORDER_ID = S_ORDER. ROW_ID

    Use
    ' and S_CONTACT_1.ROW_ID = S_CON_ADDR. CONTACT_ID'
    your 3rd condition in where clause.

    So it would be to get the address of the 'notified part' information instead of the donor

  • ORA-01427: row subquery returns more than one line

    Hello
    I get the above error but I'm not sure how

    its on the line in bold (it says line 16)

    Thanks in advance

    (s_entry IN varchar2)
    return ind_field_value_table
    IS
    found_count number (10);
    T_RETURN ind_field_value_table: = ind_field_value_table();
    Start

    for news (select master, table_name, column_name
    from all_tab_columns
    where <>'SYS' owner and owner <>'SYSTEM '.
    and (Data_type = 'CHAR' OR Data_type = 'NCHAR' OR Data_type = "NVARCHAR2" OR Data_type = 'VARCHAR2')
    Order by owner, table_name, column_name)

    loop

    immediate execution
    ' *'select count (1) of "| cur. Owner | '.' || cur.table_name | 'where ' | cur.column_name | ' = ' || '''' || s_entry | ''' '*
    in found_count;

    found_count: = nvl (found_count, 0);

    If found_count <>0 then
    T_RETURN.extend;
    T_RETURN (T_RETURN. (Count): = ind_field_value (cur.owner, cur.table_name, cur.column_name);
    end if;

    end loop;

    Return t_return;
    end;

    Create an exception handler to dig deeper into the analysis and may use a string instead of direct statement on run immediately, it is often easier for debugging of object, for example:

    ...
    begin
    stmt:='select count(*) .....';
    execute immediate stmt into your_count;
    exception when others then dbms_output.put_line(sqlerrm||' '||stmt);
    end;
    ...
    

    Nicolas.

  • Update TBL to TBL (ORA-01427 ' row subquery returned more line ")

    Hello...

    I'm new in this stuff and need a little help... Thank you very much for your answers!

    I have the error ORA-01427 when run this script:

    Update tblproduct
    the value (instock) = (select b2.instock - tblproduct b2, b1, b3 tblorder tblitem b1.quantity
    where b1.productid = b2.productid and b1.orderid = b3.orderid and b3.orderid to 3025)

    The main purpose of the script is the actualization of the butts of the inventory when the order is completed.

    The TBLITEM primary key (ORDERID and PRODUCTID). This prevents repeat the question on the agenda.


    The structure of tables are:

    1. (TBLITEM)

    Name Null? Type
    ---------------------------------- -------------- ---------------

    PRODUCTID NOT NULL NUMBER (10)
    ORDERID NOT NULL NUMBER (10)
    QUANTITY NOT NULL NUMBER (10)
    PRICE FLOAT (126)
    ITEMID NUMBER (5)



    2. (TBLPRODUCT)

    Name Null? Type
    ----------------------------------------- --------------- --------------------

    PRODUCTID NOT NULL NUMBER (10)
    PRODNAME NOT NULL VARCHAR2 (25)
    DESCRIPTION VARCHAR2 (255)
    PRICE NOT NULL NUMBER (7.2)
    NUMBER (7.2) TAX
    STATUS NOT NULL VARCHAR2 (25)
    NUMBER (10) NOT NULL INSTOCK
    REORDERPOINT NOT NULL NUMBER (10)
    DATE OF RESTOCKDATE
    CATEGORYID NOT NULL NUMBER (10)
    VENDOR NUMBER NO. (10)


    2. (TBLORDER)

    Name Null? Type
    ----------------------------------------- ------------ ----------------

    ORDERID NOT NULL NUMBER (10)
    NOT NULL ORDERDATE DATE
    DATE OF ORDERCOMPT
    USERID NOT NULL NUMBER (10)
    ACCOUNTID NOT NULL NUMBER (10)
    STATUS NOT NULL VARCHAR2 (25)
    NUMBER (2) CANCELLED


    THANKS FOR YOUR HELP ONCE AGAIN!

    Published by: user10084733 on April 20, 2009 12:25

    It is the right way to update your table.

    update tblproduct b2
    set (instock) = (select b2.instock - b1.quantity
                     from tblitem b1, tblorder b3
                     where b1.productid = b2.productid
                     and b1.orderid = b3.orderid
                     and b3.orderid in 3025)
    where exists ( select 1
                   from tblitem b1, tblorder b3
                   where b1.productid = b2.productid
                   and b1.orderid = b3.orderid
                   and b3.orderid in 3025)
    ;
    
    Without the where condition you are updating the full table.
    
  • Why this sql returns ORA-01427: einreihig subquery returns multiple rows.

    Select

    case when 'Y'=(select  emp_sw

    of the customer

    where cust_co_num =   :custconum   )

    then ( Select cust_id from )

    client where

    cust_co_num = :custconum 

    )

    on the other

    (select...)

    end while pays_id

    of the double

    or any other solution for this?

    Thank you!!

    Maybe

    with

    data in the form of

    (select cust_id 100, 'Y' emp_sw, 1 cust_co_num of all the double union)

    Select 200, "n", 1 Union double all the

    Select 300, 'Y', 3 double Union all

    Select 400, ', 2 double

    )

    Select cust_id, emp_sw, cust_co_num

    data d

    where cust_id = case when exists (select null

    from the data

    where cust_co_num =: custconum

    and emp_sw = 'Y '.

    )

    then cust_id

    end

    or cust_id in (select cust_id

    from the data

    where cust_co_num =: custconum

    and emp_sw = n

    )

    Concerning

    Etbin

  • ORA-01427: einreihig subquery returns multiple rows

    I've been off queries running for awhile, and this error is making me take what I left little hair.   I searched and found a lot of topics about this, but it does not appear to meet this request.  Rather than continue blabbering...


    SELECT THE DME. ITEM_Description, IMPC. ITEM_NUM

    Y2006 as Sum2006, Y2007 as Sum2007, Y2008 as Sum2008, as Sum2009, as Sum2010 Y2010 Y2009

    ,(Select Y2011)

    of TestDB.Book_Sect02_ImpleCosts, TestDB.Book_Sect02_ImpleDesc

    where recommended = 'PM' and BUDGETTYPE = 'MDY' and BUDGETFY = 2016

    and shareby = 'ME' and recommended in (select TestDB.Book_Recommendations recommended)

    and Book_Sect02_ImpleCosts.ITEM_NUM = Book_Sect02_ImpleDesc.ITEM_NUM

    and Book_Sect02_ImpleDesc.Item_Description = DME. Item_Description) as Sum2011

    OF IMPC, TestDB.Book_Sect02_ImpleDesc DME TestDB.Book_Sect02_ImpleCosts

    WHERE the recom = 'PM' and BUDGETTYPE = 'DMY' and BUDGETFY = 2016

    and shareby = 'ME' and recommended in (select TestDB.Book_Recommendations recommended)

    and IMPC. ITEM_NUM = DME. ITEM_NUM

    ORDER OF IMPC. ITEM_NUM;

    Basically, I want to find and eliminate the duplicate line, but I'm not.  The other problem is, I have no direct access to the database.  I am a contractor and must be based on e-mailing a DBA Government to execute the query for me.  Thank you in advance.


    Considering the hoops I need to jump through to solve this problem, it is clear to me... the error does not occur, with the same query on my Production System and it does on my Test System.  I have requested that data be deleted at the Test and updated with Production data.  I hope that this will solve the problem.   I need to keep the data, because it's test, so hopefully this will allow me to move forward.   Thank you all for your help.

  • Error - ORA-01422: exact fetch returns more than number of lines

    Hello

    I get the error when running script below. Please help me.

    /****************** ERROR ******************/

    Error report:
    ORA-01422: exact fetch returns more than number of lines
    ORA-06512: at line 71
    01422 00000 - "exact fetch returns more than number of lines."
    * Cause: Exact extraction specified number is less than the returned rows.
    * Action: Rewrite the query or change the number of rows requested



    /****************** SCRIPT ******************/

    DECLARE

    l_xml XMLTYPE: = XMLTYPE ("< LoggingInformation >
    < commandeEmplacement >
    < name > ServiceCall1 < / name >
    < StartTime > 2010-01-18T 11: 11:41.570664 - 00:00 < / StartTime >
    < EndTime > 2010-01-18T 11: 11:43.8987741 - 00:00 < / EndTime >
    < ElapsedTime > 00:00:02.3281101 < / ElapsedTime >
    < status > completed < / status >
    < ExceptionMessage > error here... < / ExceptionMessage >
    < ExceptionStackTrace > Stack Trace here... < / ExceptionStackTrace >
    < ServiceLoggingEntries >
    < item >
    < foo > 1 < / foo >
    < / ServiceInformation >
    < item >
    < foo > 2 < / foo >
    < / ServiceInformation >
    < / ServiceLoggingEntries >
    < InformationLoggingEntries >
    < ProcessInformation >
    < bar > 1 < / >
    < / ProcessInformation >
    < ProcessInformation >
    < bar > 2 < / >
    < / ProcessInformation >
    < / InformationLoggingEntries >

    < / commandeEmplacement >
    < commandeEmplacement >
    < name > ServiceCall2 < / name >
    < StartTime > 2010-01-18T 11: 11:41.570664 - 00:00 < / StartTime >
    < EndTime > 2010-01-18T 11: 11:43.8987741 - 00:00 < / EndTime >
    < ElapsedTime > 00:00:02.3281101 < / ElapsedTime >
    < status > completed < / status >
    < ExceptionMessage > error here... < / ExceptionMessage >
    < ExceptionStackTrace > Stack Trace here... < / ExceptionStackTrace >
    < ServiceLoggingEntries >
    < item >
    < foo > 3 < / foo >
    < / ServiceInformation >
    < item >
    < foo > 4 < / foo >
    < / ServiceInformation >
    < / ServiceLoggingEntries >
    < InformationLoggingEntries >
    < ProcessInformation >
    < bar > 3 < / >
    < / ProcessInformation >
    < ProcessInformation >
    < bar > < / > 4
    < / ProcessInformation >
    < / InformationLoggingEntries >
    < / commandeEmplacement >

    < commandeEmplacement >
    < name > ServiceCall3 < / name >
    < StartTime > 2010-01-18T 11: 11:41.570664 - 00:00 < / StartTime >
    < EndTime > 2010-01-18T 11: 11:43.8987741 - 00:00 < / EndTime >
    < ElapsedTime > 00:00:02.3281101 < / ElapsedTime >
    status of <>failed < / status >
    < ExceptionMessage > error here... < / ExceptionMessage >
    < ExceptionStackTrace > Stack Trace here... < / ExceptionStackTrace >
    < / commandeEmplacement >
    (< / LoggingInformation > ');

    v_txt VARCHAR2 (2000);

    BEGIN

    SELECT XMLTYPE. Extract (value (TT),'/ CommandInformation/Name/Text () '). GETSTRINGVAL()
    IN v_txt
    TABLE (XMLSEQUENCE (l_xml. Extract('/LoggingInformation/CommandInformation'))) tt;

    DBMS_OUTPUT. Put_line (v_txt);

    END;

    Select...

    means only 1 row can be returned.

    Your select returns more than one line.
    Change v_txt in a collection, define a cursor and the extraction of it or change the statement, i.e. it returns a single line.

    ---------
    Sybrand Bakker
    Senior Oracle DBA

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

    Hello world

    I want to create a procedure only allows me to perform selection et Update in my database, I have already create the procedure and compiled without problems but when I want to run this procedure, I have this error

    ORA-01422: exact fetch returns more than number of lines

    This syntax of my procedure

    create or replace procedure app is

    i nombre := 100 ;

    o_username employees.first_name% TYPE ;

    o_lastn employees. Last_name %TYPE

    o_sal. employees % of SALARY TYPE ;

    Start

    loop

    / * display * /.

    Select first_name, LAST_NAME, SALARY

    in o_username, o_lastn, o_sal

    of admin.employees where employee_id = i;

    DBMS_OUTPUT. Put_line (' name: ' | o_username);

    DBMS_OUTPUT. Put_line (' first name: ' | o_lastn);

    DBMS_OUTPUT. Put_line (' salary: ' | o_sal)

    / * put a days * /.

    Update employees

    put salary = salary + salary *0.25 where employee_id = i;

    commit;

    / * dbms_put.put_line (' new salary is: ' | ') sell2_tab (i)); * /

    i := i + 1 ;

    / * list the data * /

    / * dbms_put.put_line (' new salary is: ' ") ;*/

    output when i = 200;

    end loop;

    end app;

    thnx

    create or replace procedure APP is

    Constant START_ID EMPLOYEES. EMPLOYEE_ID % TYPE: = 100;

    Constant END_ID EMPLOYEES. EMPLOYEE_ID % TYPE: = 200;

    O_USERNAME EMPLOYEES. Type % name;

    O_LASTN EMPLOYEES. Last_name type %;

    O_SAL EMPLOYEES. Kind of % of SALARY;

    Start

    for rec (select FIRST_NAME, LAST_NAME, salary

    the admin. EMPLOYEES

    where EMPLOYEE_ID between START_ID and END_ID)

    loop

    DBMS_OUTPUT. Put_line (' name: ' | rec. NAME);

    DBMS_OUTPUT. Put_line ("first name:" | ") Rec. LAST_NAME);

    DBMS_OUTPUT. Put_line (' salary: ' | rec. SALARY) / * setting days * /.

    end loop;

    Update EMPLOYEES

    Set SALARY = SALARY + SALARY * 0.25

    where EMPLOYEE_ID between START_ID and END_ID;

    commit;

    end app;

  • Error creating a salary. ORA-01422: exact fetch returns more than the requested number of rows in the hr_maintain_proposal_swi procedure insert_salary_proposal package

    Hi all

    We try to add new proposal for a salary of some employees from form August 1, 2015 (the Date of the beginning of employee)

    There is no existing salary proposal doesn't exist for these employees.

    We get below error.


    ORA-01422: exact fetch returns more than the requested number of rows in the hr_maintain_proposal_swi procedure insert_salary_proposal package


    Help, please.

    Thank you

    Tarun

    Hi John,.

    If it helps, take a look at the following note:

    ORA-01422 exact Fetch returns more than number of lines requested in Hr_maintain_proposal_swi (Doc ID 1673527.1)

    Kind regards

    Rajen

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

    Dear experts of PL/SQL,

    I encounter this problem when running under procedure, how this can be exceeded? Procedure was running well for the last few weeks and we have this problem all of a sudden:

    ORA-01422: exact fetch returns more than number of lines

    CREATE OR REPLACE PROCEDURE DBA_MAINT. () SQL_EXEC_DRILLDOWN

    beginsnapid in numbers

    endsnapid in numbers

    )

    AS

    begin_date varchar2 (30);

    End_date varchar2 (30);

    statName VARCHAR2 (64);

    err_msg VARCHAR2 (100);

    The CNT number;

    cursor c1

    is

    Select stat_name,

    Sum in the NTC

    de)

    Select instance_number,

    stat_name,

    ((VALUE) max - min (VALUE)) COUNTY

    of dba_hist_sysstat

    where stat_name in ("run the County", 'parse count (total)', "parse count (hard)")

    and snap_id between beginsnapid

    and endsnapid

    Instance_number group, stat_name)

    Stat_name group

    Union of all the

    Select stat_name,

    Sum in the NTC

    de)

    Select instance_number,

    stat_name,

    Round (((value) - (VALUE) min Max) / 1000000) COUNTY

    of DBA_HIST_SYS_TIME_MODEL

    where stat_name in ("DB CPU", "background time cpu", 'sql execute elapsed time', 'analysis elapsed time', ' parse hard time elapsed ")

    and snap_id between beginsnapid

    and endsnapid

    Instance_number group, stat_name)

    Stat_name Union group all the

    Select stat_name,

    MySQL as cnt

    de)

    Select a.stat_name stat_name,

    (b.value - a.value) VALUE

    dba_hist_sysstat a, dba_hist_sysstat b

    where a.dbid = b.dbid

    and a.instance_number = b.instance_number

    and a.stat_id = b.stat_id

    and a.snap_id = beginsnapid

    and b.snap_id = endsnapid

    and a.stat_name in ('physical reads',

    "physical Scriptures."

    "physical read IO total number of applications."

    "physical write IO requests total."

    "Physics read total multi block requests."

    "total multi block request writing for the physical box,.

    ("reading session logic")

    and a.instance_number = b.instance_number)

    Stat_name group;

    Start

    Start

    Select distinct TO_CHAR (END_INTERVAL_TIME, "MM/DD/YYYY HH24 '")

    in begin_date

    of dba_hist_snapshot

    where snap_id = beginsnapid;

    Select distinct TO_CHAR (END_INTERVAL_TIME, "MM/DD/YYYY HH24 '")

    in end_date

    of dba_hist_snapshot

    where snap_id = endsnapid;

    -DBMS_OUTPUT. Put_line (begin_date);

    -DBMS_OUTPUT. Put_line (end_date);

    exception

    When no_data_found

    then

    null;

    end;

    C1_rec IN C1

    LOOP

    Start

    Insert

    in DBA_MAINT. Values (DB_SQL_EXEC_DETAILS)

    beginsnapid,

    endsnapid,

    begin_date,

    End_date,

    c1_rec.stat_name,

    c1_rec. CNT

    );

    -DBMS_OUTPUT. Put_line (c1_rec.stat_name |) »      '|| c1_rec. CNT);

    exception

    When no_data_found

    then

    null;

    end;

    end loop;

    commit;

    end;

    /

    Reasons to explain above, but I think it would be more appropriate select latest END_INTERVAL_TIME as follows

    Select TO_CHAR ((max (END_INTERVAL_TIME)), "MM/DD/YYYY HH24")

    in begin_date

    of dba_hist_snapshot

    where snap_id = beginsnapid;

    Select TO_CHAR ((max (END_INTERVAL_TIME)), "MM/DD/YYYY HH24")

    in end_date

    of dba_hist_snapshot

    where snap_id = endsnapid;

  • ERRO ORA-01422: exact fetch returns more than number of lines

    SET SERVEROUTPUT ON
    create or replace procedure copy
    AS

    cursor c2 IS
    Select t.country_code
    transactions t;

    v_lc_details_current_hist c2% rowtype;
    v_country_code transactions.country_code% TYPE;

    Start


    Open c2;
    loop

    extract the c2 in v_lc_details_current_hist;


    OUTPUT WHEN c2% NOTFOUND;



    Select the country_code in v_country_code of transactions;

    DBMS_OUTPUT. Put_line (v_country_code);

    end loop;

    Close c2;

    end;
    /



    I'm gettintha error ORA-01422: exact fetch returns more than number of lines

    Please help me

    [email protected] wrote:
    Select the country_code in v_country_code of transactions;
    -It's to return several rows, and the SELECT INTO statement expects that one line.

    A SELECT INTO statement can be used if you want a query to return only one row. Otherwise use bulk collect and a variable of class to contain the result lines multiples.

  • error report: ORA-01422: exact fetch returns more than number of lines

    I get this error in table form that should be filled by selecting a week called item description in this page by a dynamic action.

    In the main table, I have two primary keys and so two foreign keys in the secondary table even if it is not a type of form master detail.

    When I select the week description point and the related records in the form of sound. But it gives the above error.

    In the main table, there are two records of same, in this user name folders is different which defines the unique character of the file.

    It is really basic and happens if you have something like this in your code - the SQL code is supposed to return exactly ONE value and it returns two or more:

    Denes Kubicek

  • 01427 00000 - "einreihig subquery returns several lines.

    Hi all
    How can I solve it
    SELECT 
           v.code
          ,v.bar_code
          ,v.arb_name
          ,v.eng_name
          ,v.branch_no
          ,(SELECT sum(quantity) FROM viw_whs_items_movement GROUP BY branch_no)
    FROM  viw_whs_items_movement V
    This code gives me this error
    01427 00000 - "einreihig subquery returns several lines.
    I know that I have more value, but I need this value

    Result group
    SELECT sum(v.quantity) 
    FROM viw_whs_items_movement v 
    GROUP BY v.branch_no
    ##########################
    SUM(V.QUANTITY)
    ---------------
             114453 
               2501 
               8137 
              13270 
              15230 
             120626 
              22536 
               2926 
              12848 
              37509 
              20911 
               7503 
               6248 
              17221 
                462 
                 24 
              15041 
              10307 
              12524 
             526627 
              10564 
               8230 
              13204 
               2840 
              80769 
            1418238 
             215694 
              15238 
               5063 
             104187 
                913 
             147079 
              11293 
              12678 
              18855 
    
     35 rows selected 

    Must be scalar subqueries. You demonstrate your subquery returns more than one line. Where the error.

    A solution would be to establish a correlation between the results of the subquery by joining the branch_id with branch_id of the outer query. However, as the two queries use the same table, you can simply use an analytical SUM():

    SELECT
           v.code
          ,v.bar_code
          ,v.arb_name
          ,v.eng_name
          ,v.branch_no
          ,sum(quantity) over (partition by branch_no) as branch_tot
    FROM  viw_whs_items_movement V      
    

    Cheers, APC

  • Error ORA-01422 apex: exact fetch returns more than the required number of line

    Hi people,

    Apex 4.1
    I have a page that works like a charm.

    Based on my application I need I have to perform the same operation for the different regions. As a quick and better method, I copied the page and branched, it inspires tab for this region.

    The problem is that the original page works fine.
    I haven't changed anything except the parent set to this copied page tab and works that I find with the above error.

    It allows me to make the first entry on this page, but when I try to access the page again it gives me this error.

    The error in detail is as below:

    is_internal_error: false
    ora_sqlcode:-1422
    ora_sqlerrm: ORA-01422: exact fetch returns more than number of lines
    Component.type: APEX_APPLICATION_PAGE_PROCESS
    Component.ID: 214936714355373108
    Component.Name: EMP_LEAVE_INFO line
    error_backtrace:
    ORA-06512: at line 1
    ORA-06512: at "SYS." DBMS_SYS_SQL", line 1926
    ORA-06512: at "SYS." WWV_DBMS_SQL', line 973
    ORA-06512: at "SYS." WWV_DBMS_SQL', line 999
    ORA-06512: at "APEX_040200.WWV_FLOW_DYNAMIC_EXEC", line 806
    ORA-06512: at "APEX_040200.WWV_FLOW_DML", line 336
    ORA-06512: at "APEX_040200.WWV_FLOW_PROCESS", line 332

    >
    As a quick and better method, I copied the page and branched, it inspires tab for this region.
    >

    Copy paste is never advisable. It can be fast in some cases, there is an anti-pattern.

    Be aware that the automatic extraction of the APEX line is based on a component of demand.

    It is possible that your automatic rowfetch is based on the element of your previous page. If you for example to change the name of the table, but do not change the reference is the primary key value, then you can pass a value to your table that was not unique. This would result in ORA-01422.

    Find the value of the session element and run your query.

    Concerning

    Nico

  • 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 got this error:
    ORA-01422: exact fetch returns more than requested number of rows
    ORA-06512: at line 172
    I want to change my sql statement in such a way, it gets the first line. How am I suppose to add my where clause condition?

    If you don't have a way to restrict your query to return only 1 row according to the data, you can use the line number...
    for example

    select data, data2, .....
    from (
    select data, data2, ....., rownum rn
    from table
    )
    where rn = 1
    

Maybe you are looking for