Returns more than one result set. How?

I have a stored Proc that returns 4 results for games, what to call them a page of cfm for each result set?
Here's my proc. The Proc is a CFC

umuayo wrote:
> Hi,.
>
> The Proc is a CFC. I need to invoke the cfc from the cfm page to return the results of query cfstoredproc.

Then, just do it.

Of course you can only return a value from a function so you'll need
to put these four results in a table or structure or something to
group them.

Then use the complex variable of your choice in the cfm page.

Tags: ColdFusion

Similar Questions

  • Einreihig subquery returns more than one query

    Hello

    I get the following error: einreihig subquery returns more than one request. I don't know how I should debug this application. As far as I know, subqueries can return only 1 row...: S

    I've only Oracle SQL Developer to run/test of my queries. I can run the query with ROWNUM < 5000, which gives no error. If I run with ROWNUM > 5000 and ROWNUM < 6000 then the error pops up...

    This is the query:
    with
    DATES as 
      (select (select min(REC_DATE) from STOCK) as FROM_DT, (select max(CHANGE_DATE) from STOCK_ADJUST) as TO_DT from DUAL),
    MONTHS as 
      (select add_months(trunc(FROM_DT,'MM'),ROWNUM-1) as DT from DATES connect by ROWNUM <= months_between(TO_DT, FROM_DT)+1),
    CALCULATIONS as
      (select 
        PNM.PNM_AUTO_KEY PNM_KEY,
        MONTHS.DT DT, 
        NVL((select sum(stm.qty_rec) from stock stm WHERE STM.REC_DATE < MONTHS.DT AND STM.PNM_AUTO_KEY = PNM.PNM_AUTO_KEY GROUP BY pnm_auto_key),0) INCOMING, 
        NVL((select sum(saj.qty_adj) from stock_adjust saj 
                                    inner join stock stm on saj.stm_auto_key = stm.stm_auto_key 
                                    inner join parts_master pnm on stm.pnm_auto_key = pnm.pnm_auto_key where SAJ.CHANGE_DATE < MONTHS.DT AND STM.PNM_AUTO_KEY = PNM.PNM_AUTO_KEY group by pnm_auto_key),0) OUTGOING
      from MONTHS, PARTS_MASTER PNM)
    SELECT
      ROWNUM, CALCULATIONS.PNM_KEY PNM_AUTO_KEY, CALCULATIONS.DT COUNT_DATE,CALCULATIONS.INCOMING QTY_RECEIVED, CALCULATIONS.OUTGOING QTY_USED, (CALCULATIONS.INCOMING + CALCULATIONS.OUTGOING) QTY_BALANCE
    FROM
      CALCULATIONS;
    Published by: layout of the code user574699 on November 17, 2008 02:10

    the problem is that you use the same alias in your view online as well as in your main query in the second statement-nvl...

    HTH

  • Single - row subquery returns more than one line.

    Hi Experts

    I am faced with error

    ORA-01427: single - row subquery returns more than one line.

    MyQuery is:

    select
       TO_CHAR(T.MR_REG_DATE,'DD')                     "DATE"
       ,CASE  
         WHEN trunc((MONTHS_BETWEEN(T.MR_REG_DATE,T.MR_DOB))) between 0 and 1 THEN ' 01'||'  - ('||'0 - 1 Month)'
         WHEN trunc((MONTHS_BETWEEN(T.MR_REG_DATE,T.MR_DOB))) BETWEEN 2 AND 12 THEN ' 02'||'  - ('||'2 - 12 Months)'
         WHEN trunc((MONTHS_BETWEEN(T.MR_REG_DATE,T.MR_DOB))) BETWEEN 13 AND 60 THEN ' 03'||'  - ('||'1 - 5 Years)'
         WHEN trunc((MONTHS_BETWEEN(T.MR_REG_DATE,T.MR_DOB))) BETWEEN 61 AND 120 THEN ' 04'||'  - ('||'5 - 10 Years)'
         WHEN trunc((MONTHS_BETWEEN(T.MR_REG_DATE,T.MR_DOB))) > 120 then ' 05'||'  - ('||'> 10 Years)'
        END age
      ,count(T.Mr_Code) No_of_Patient
      ,(  SELECT count(x.mr_code) mr_code
             FROM HMIS_MRINFO X
             where X.mr_reg_date between &FRM_DATE AND &TO_DATE
               and X.mr_code NOT in (select Y.mr_code from hmis_pat_add_dis_detail Y
                                      WHERE Y.mr_reg_date between &FRM_DATE AND &TO_DATE
                                    )
            GROUP BY CASE  
                       WHEN trunc((MONTHS_BETWEEN(X.MR_REG_DATE,X.MR_DOB))) between 0 and 1 THEN ' 01'||'  - ('||'0 - 1 Month)'
                       WHEN trunc((MONTHS_BETWEEN(X.MR_REG_DATE,X.MR_DOB))) BETWEEN 2 AND 12 THEN ' 02'||'  - ('||'2 - 12 Months)'
                       WHEN trunc((MONTHS_BETWEEN(X.MR_REG_DATE,X.MR_DOB))) BETWEEN 13 AND 60 THEN ' 03'||'  - ('||'1 - 5 Years)'
                       WHEN trunc((MONTHS_BETWEEN(X.MR_REG_DATE,X.MR_DOB))) BETWEEN 61 AND 120 THEN ' 04'||'  - ('||'5 - 10 Years)'
                       WHEN trunc((MONTHS_BETWEEN(X.MR_REG_DATE,X.MR_DOB))) > 120 then ' 05'||'  - ('||'> 10 Years)'
                      END 
      ) Missing_MR
    from hmis_mrinfo T,hmis_pat_add_dis_detail M
    where T.mr_code = M.mr_code(+)
      and T.mr_reg_date between &FRM_DATE AND &TO_DATE
      &AGE_GRP
    GROUP BY T.MR_REG_DATE
             ,CASE  
               WHEN trunc((MONTHS_BETWEEN(T.MR_REG_DATE,T.MR_DOB))) between 0 and 1 THEN ' 01'||'  - ('||'0 - 1 Month)'
               WHEN trunc((MONTHS_BETWEEN(T.MR_REG_DATE,T.MR_DOB))) BETWEEN 2 AND 12 THEN ' 02'||'  - ('||'2 - 12 Months)'
               WHEN trunc((MONTHS_BETWEEN(T.MR_REG_DATE,T.MR_DOB))) BETWEEN 13 AND 60 THEN ' 03'||'  - ('||'1 - 5 Years)'
               WHEN trunc((MONTHS_BETWEEN(T.MR_REG_DATE,T.MR_DOB))) BETWEEN 61 AND 120 THEN ' 04'||'  - ('||'5 - 10 Years)'
               WHEN trunc((MONTHS_BETWEEN(T.MR_REG_DATE,T.MR_DOB))) > 120 then ' 05'||'  - ('||'> 10 Years)'
              END 
    ORDER BY T.MR_REG_DATE;
    

    Please give some advice / solution.

    I think this might do it for you

    Select

    TO_CHAR (T.MR_REG_DATE, 'DD') "DATE."

    CASE

    WHEN trunc ((MONTHS_BETWEEN (T.MR_REG_DATE, T.MR_DOB))) between 0 and 1 THEN ' 01' |'.  - ('||' 0-1 month)"

    WHEN trunc ((MONTHS_BETWEEN (T.MR_REG_DATE, T.MR_DOB))) BETWEEN 2 AND 12 THEN ' 02' |'.  - ('||' 2-12 months)"

    WHEN trunc ((MONTHS_BETWEEN (T.MR_REG_DATE, T.MR_DOB))) BETWEEN 13 AND 60 THEN ' 03' |'.  - ('||' 1-5 years)"

    WHEN trunc ((MONTHS_BETWEEN (T.MR_REG_DATE, T.MR_DOB))) BETWEEN 61 AND 120 THEN ' 04' |'.  - ('||' 5-10 years)'

    WHEN trunc ((MONTHS_BETWEEN (T.MR_REG_DATE, T.MR_DOB))) > 120 then ' 05' |'.  ' - ('| ' > 10 years).

    Age of the END

    count (T.Mr_Code) No_of_Patient

    , count (case when t.mr_code NOT in (select Y.mr_code from hmis_pat_add_dis_detail Y))

    WHERE Y.mr_reg_date between & FRM_DATE AND & TO_DATE)

    then t.mr_code

    (end) Missing_MR

    of hmis_mrinfo T, hmis_pat_add_dis_detail M

    where T.mr_code = M.mr_code (+)

    and between T.mr_reg_date & FRM_DATE AND & TO_DATE

    & AGE_GRP

    T.MR_REG_DATE GROUP

    CASE

    WHEN trunc ((MONTHS_BETWEEN (T.MR_REG_DATE, T.MR_DOB))) between 0 and 1 THEN ' 01' |'.  - ('||' 0-1 month)"

    WHEN trunc ((MONTHS_BETWEEN (T.MR_REG_DATE, T.MR_DOB))) BETWEEN 2 AND 12 THEN ' 02' |'.  - ('||' 2-12 months)"

    WHEN trunc ((MONTHS_BETWEEN (T.MR_REG_DATE, T.MR_DOB))) BETWEEN 13 AND 60 THEN ' 03' |'.  - ('||' 1-5 years)"

    WHEN trunc ((MONTHS_BETWEEN (T.MR_REG_DATE, T.MR_DOB))) BETWEEN 61 AND 120 THEN ' 04' |'.  - ('||' 5-10 years)'

    WHEN trunc ((MONTHS_BETWEEN (T.MR_REG_DATE, T.MR_DOB))) > 120 then ' 05' |'.  ' - ('| ' > 10 years).

    END

    ORDER BY T.MR_REG_DATE;

  • How to use more than one condition set?

    Dear Sir

    I want to define more than one type of condition and use it together for all objects on the page, for example, page element, button page and etc.

    Is it possible to manage in "PL/SQL tends" to condition type? ("for example = >"Request = Expression'and'current page! = 1 Expression',..) If no response, is please tell me otherwise.

    Kind regards

    Saeed.

    Hi Saeed,

    Saeed reports says:

    I would like to know the conditions CGI and browsers. Can I view the document or essay on the condition type in pl/sql?

    Yes, you can also view the conditions of CGI Environment Variables and browser in "PL/SQL Expression.

    For example:

    • "The condition type" cgi_env SERVER_NAME = Expression 1 "can be transformed into" PL/SQL Expression"as:
    OWA_UTIL.GET_CGI_ENV('SERVER_NAME') = 'MyServer'
    
    • The condition type for browser condtions can be can be transformed into "PL/SQL Expression" as:
    instr(upper(OWA_UTIL.GET_CGI_ENV('HTTP_USER_AGENT')),upper('Firefox/37.0')) > 0
    

    The following is old, but complete documentation on the Types of conditions:

    https://docs.Oracle.com/CD/E14373_01/AppDev.32/e11838/condition.htm#HTMDB25942

    I hope this helps!

    Kind regards

    Kiran

  • Select Date Max with more than one result

    Hello;

    I need to write a query that returns the maximum date for a specific transaction that is not a problem, but my problem occurs when I have several transactions with the same date max trans.


    Can someone help me write something which will return only one record from a result set that has more than one record

    Example:

    TRAN_ID - LAW #-TRANS_DATE
    -272-1111111-29/10/1999 00:00:00
    -273-1111111-29/10/1999 00:00:00
    -274-1111111-29/10/1999 00:00:00
    -275-1111111-29/10/1999 00:00:00

    You are referring to your alias at the wrong level, try this:

    select * from (
    select account_transaction_id,
           account_number,
           max_days_in_arrears,
           trans_date,
           row_number() over(partition by account_number order by trans_date desc, account_transaction_id desc) as rn
      from account_transaction atr
     where max_days_in_arrears > 90
       and account_number in (100026, 121189, 100223)
       and trans_date = (select distinct max(trans_date)
                           from account_transaction
                          where account_number = atr.account_number
                            and max_days_in_arrears > 90)
     order by account_number, trans_date
    )
    where rn = 1;
    

    and use code tags please, so that your queries can still be read easily and quickly for us to understand.

    Published by: hoek on March 23, 2009 15:48

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

  • DECODE does not work in the WHERE clause when subquery returns more than one line

    Hi gurus,

    I want to write a query against the table CCENTERS (Script given below) and wait for the following result:

    1. in the transition from a value of 0 for the ID, it returns all the rows in the table.
    2. in the passage of one value other than 0, it returns the row corresponding to the given value and all its records of the child.

    CCENTER has parent-child relationship in the column ID and the BASE. I use a query with the DECODE function. but the function in the WHERE clause is not capable of managing the subquery with multiple lines of DECODE.

    *************************************************
    VARIABLE ParaCCenter NUMBER

    BEGIN
    : paraccenter: = 0;
    END;
    /

    CREATE TABLE ccenters
    (id NUMBER,
    name VARCHAR2 (20).
    number base);

    INSERT INTO ccenters VALUES(1,'NUST',null);
    INSERT INTO ccenters VALUES(2,'SEECS',1);
    INSERT INTO ccenters VALUES(3,'NBS',1);
    commit;

    SELECT * from ccenters
    WHERE id IN DECODE(:ParaCCenter, 0, id,)
    (SELECT id FROM ccenters
    START WITH basic =: ParaCCenter
    ID of CONNECTION BY PRIOR = base
    UNION
    SELECT: ParaCCenter OF double
    )
    )
    /
    BEGIN
    : paraCCenter: = 1;
    END;
    /

    SELECT * from ccenters
    WHERE id IN DECODE(:ParaCCenter, 0, id,)
    (SELECT id FROM ccenters
    START WITH basic =: ParaCCenter
    ID of CONNECTION BY PRIOR = base
    UNION
    SELECT: ParaCCenter double))
    /
    The result is
    (SELECT id FROM ccenters
    *
    ERROR at line 3:
    ORA-01427: einreihig subquery returns multiple rows

    How this query can be rewritten for the given feature. Any response will be appreciated.

    Thank you

    Try something like this:

    SELECT * FROM ccenters
    WHERE :ParaCCenter = 0
    OR id in
      (SELECT id FROM ccenters
       START WITH base=:ParaCCenter
       CONNECT BY PRIOR id = base
       UNION
       SELECT :ParaCCenter FROM dual
      )
    
  • 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.

  • Subquery returns more than one value subquery returns more than one value......

    UPDATE CORPORATECARD_TST SET (CORPORATECARD_TST. USERNAME, CORPORATECARD_TST. CREDITCARDIDCD, CORPORATECARD_TST. DATEINSERTED, CORPORATECARD_TST. DATEUPDATED, CORPORATECARD_TST. CUSTOMERNAME, CORPORATECARD_TST. FORMOFPAYCCNUMFIRSTSIX, CORPORATECARD_TST. FORMOFPAYCCNUMLASTFOUR) = (select distinct CORPORATECARD_SQL. USERNAME, CORPORATECARD_SQL. CREDITCARDIDCD, CORPORATECARD_SQL. DATEINSERTED, CORPORATECARD_SQL. DATEUPDATED, CORPORATECARD_SQL. CUSTOMERNAME, CORPORATECARD_SQL. FORMOFPAYCCNUMFIRSTSIX, CORPORATECARD_SQL. Join FORMOFPAYCCNUMLASTFOUR internal CORPORATECARD_SQL CORPORATECARD_TST on CORPORATECARD_SQL. CORPORATECARDID = CORPORATECARD_TST. CORPORATECARDID);

    CREATE TABLE CORPORATECARD_TST

    (

    CORPORATECARDID NUMBER(*, 0) NOT NULL

    VARCHAR2 (50 BYTE) USER NAME NOT NULL

    CREDITCARDIDCD CHAR (2 BYTES) NOT NULL

    DATEINSERTED DATE NOT NULL

    DATEUPDATED DATE NOT NULL

    VARCHAR2 (255 BYTE) CUSTOMERNAME

    FORMOFPAYCCNUMFIRSTSIX CHAR (6 BYTES)

    FORMOFPAYCCNUMLASTFOUR CHAR (4 BYTES)

    )

    CREATE TABLE CORPORATECARD_SQL

    (

    CORPORATECARDID NUMBER(*, 0) NOT NULL

    VARCHAR2 (50 BYTE) USER NAME NOT NULL

    CREDITCARDIDCD CHAR (2 BYTES) NOT NULL

    DATEINSERTED DATE NOT NULL

    DATEUPDATED DATE NOT NULL

    VARCHAR2 (255 BYTE) CUSTOMERNAME

    FORMOFPAYCCNUMFIRSTSIX CHAR (6 BYTES)

    FORMOFPAYCCNUMLASTFOUR CHAR (4 BYTES)

    )

    Here is the data in the table _TST

    2044 TestUser AX 2 February 12 February 2, 12 TestClient 123456 9876

    2007 TestUser AX 30 January 12 January 30, 12 TestClient 123456 9876

    2004 TestUser AX 30 January 12 January 30, 12 TestClient 123456 9876

    2010 TestUser AX 31 January 12 January 31, 12 TestClient 123456 9876

    TestUser AX 19-SEVEN 6. - 11 19 - SEPT. - 11 123456 9876 TestClient

    2045 TestUser AX 2 February 12 February 2, 12 TestClient 123456 9876

    2020 TestUser AX 1 February 12 February 1, 12 TestClient 123456 9876

    2011 TestUser AX 31 January 12 January 31, 12 TestClient 123456 9876

    2012 TestUser AX 31 January 12 January 31, 12 TestClient 123456 9876

    2046 TestUser AX 2 February 12 February 2, 12 TestClient 123456 9876

    2138 TestUser AX 26 July 12 July 26, 12 TestClient 123456 9876

    Here is the data in the table _SQL

    2009 NEW TestUser DS 31 January 12 January 31, 12 NEW TestClient 999999 0

    2044 NEW TestUser VI 2 February 12 February 2, 12 NEW TestClient 999999 0

    2007 NEW TestUser DC 30 January 12 January 30, 12 NEW TestClient 999999 0

    2004 NEW TestUser MC 30 January 12 January 30, 12 NEW TestClient 999999 0

    2010 NEW TestUser VI 31 January 12 January 31, 12 NEW TestClient 999999 0

    6 NEW TestUser AX 19-SEVEN. - 11 19 - SEPT. - 11 NEW TestClient 999999 0

    2045 NEW TestUser VI 2 February 12 February 2, 12 NEW TestClient 999999 0

    2020 NEW TestUser DS 1 February 12 February 1, 12 NEW TestClient 999999 0

    2011 NEW TestUser AX 31 January 12 January 31, 12 NEW TestClient 999999 0

    2012 NEW TestUser AX 31 January 12 January 31, 12 NEW TestClient 999999 0

    2046 NEW TestUser VI 2 February 12 February 2, 12 NEW TestClient 999999 0

    2138 NEW TestUser AX 26 July 12 July 26, 12 NEW TestClient 999999 0

    Here's the MERGE statement...

    MERGE INTO CORPORATECARD_TST D
    USING
    (
    Select distinct
    CORPORATECARD_SQL. CORPORATECARDID
    CORPORATECARD_SQL. USERNAME
    CORPORATECARD_SQL. CREDITCARDIDCD
    CORPORATECARD_SQL. DATEINSERTED
    CORPORATECARD_SQL. DATEUPDATED
    CORPORATECARD_SQL. CUSTOMERNAME
    CORPORATECARD_SQL. FORMOFPAYCCNUMFIRSTSIX
    CORPORATECARD_SQL. FORMOFPAYCCNUMLASTFOUR
    Of
    CORPORATECARD_SQL
    ) S
    WE
    (
    D.CORPORATECARDID = S.CORPORATECARDID
    )
    WHEN MATCHED, THEN UPDATE GAME
    S.USERNAME = D.USERNAME
    D.CREDITCARDIDCD = S.CREDITCARDIDCD,
    D.DATEINSERTED = S.DATEINSERTED,
    D.DATEUPDATED = S.DATEUPDATED,
    D.CLIENTNAME = S.CLIENTNAME,
    D.FORMOFPAYCCNUMFIRSTSIX = S.FORMOFPAYCCNUMFIRSTSIX,
    D.FORMOFPAYCCNUMLASTFOUR = S.FORMOFPAYCCNUMLASTFOUR,

    WHEN NOT MATCHED THEN INSERT
    (
    D.CORPORATECARDID
    D.USERNAME
    D.CREDITCARDIDCD
    D.DATEINSERTED
    D.DATEUPDATED
    D.CLIENTNAME
    D.FORMOFPAYCCNUMFIRSTSIX
    D.FORMOFPAYCCNUMLASTFOUR
    )
    VALUES
    (
    S.CORPORATECARDID
    S.USERNAME
    S.CREDITCARDIDCD
    S.DATEINSERTED
    S.DATEUPDATED
    S.CLIENTNAME
    S.FORMOFPAYCCNUMFIRSTSIX
    S.FORMOFPAYCCNUMLASTFOUR
    )
    ;

    The desired output would be for the _TST and the _SQL to have the same data as the _SQL as below...

    2009 NEW TestUser DS 31 January 12 January 31, 12 NEW TestClient 999999 0

    2044 NEW TestUser VI 2 February 12 February 2, 12 NEW TestClient 999999 0

    2007 NEW TestUser DC 30 January 12 January 30, 12 NEW TestClient 999999 0

    2004 NEW TestUser MC 30 January 12 January 30, 12 NEW TestClient 999999 0

    2010 NEW TestUser VI 31 January 12 January 31, 12 NEW TestClient 999999 0

    6 NEW TestUser AX 19-SEVEN. - 11 19 - SEPT. - 11 NEW TestClient 999999 0

    2045 NEW TestUser VI 2 February 12 February 2, 12 NEW TestClient 999999 0

    2020 NEW TestUser DS 1 February 12 February 1, 12 NEW TestClient 999999 0

    2011 NEW TestUser AX 31 January 12 January 31, 12 NEW TestClient 999999 0

    2012 NEW TestUser AX 31 January 12 January 31, 12 NEW TestClient 999999 0

    2046 NEW TestUser VI 2 February 12 February 2, 12 NEW TestClient 999999 0

    2138 NEW TestUser AX 26 July 12 July 26, 12 NEW TestClient 999999 0

    However, after I compile and run the Sp that has the MERGER, data still looks like this...

    Here is the data in the table _TST

    2044 TestUser AX 2 February 12 February 2, 12 TestClient 123456 9876

    2007 TestUser AX 30 January 12 January 30, 12 TestClient 123456 9876

    2004 TestUser AX 30 January 12 January 30, 12 TestClient 123456 9876

    2010 TestUser AX 31 January 12 January 31, 12 TestClient 123456 9876

    TestUser AX 19-SEVEN 6. - 11 19 - SEPT. - 11 123456 9876 TestClient

    2045 TestUser AX 2 February 12 February 2, 12 TestClient 123456 9876

    2020 TestUser AX 1 February 12 February 1, 12 TestClient 123456 9876

    2011 TestUser AX 31 January 12 January 31, 12 TestClient 123456 9876

    2012 TestUser AX 31 January 12 January 31, 12 TestClient 123456 9876

    2046 TestUser AX 2 February 12 February 2, 12 TestClient 123456 9876

    2138 TestUser AX 26 July 12 July 26, 12 TestClient 123456 9876

    Here is the data in the table _SQL

    2009 NEW TestUser DS 31 January 12 January 31, 12 NEW TestClient 999999 0

    2044 NEW TestUser VI 2 February 12 February 2, 12 NEW TestClient 999999 0

    2007 NEW TestUser DC 30 January 12 January 30, 12 NEW TestClient 999999 0

    2004 NEW TestUser MC 30 January 12 January 30, 12 NEW TestClient 999999 0

    2010 NEW TestUser VI 31 January 12 January 31, 12 NEW TestClient 999999 0

    6 NEW TestUser AX 19-SEVEN. - 11 19 - SEPT. - 11 NEW TestClient 999999 0

    2045 NEW TestUser VI 2 February 12 February 2, 12 NEW TestClient 999999 0

    2020 NEW TestUser DS 1 February 12 February 1, 12 NEW TestClient 999999 0

    2011 NEW TestUser AX 31 January 12 January 31, 12 NEW TestClient 999999 0

    2012 NEW TestUser AX 31 January 12 January 31, 12 NEW TestClient 999999 0

    2046 NEW TestUser VI 2 February 12 February 2, 12 NEW TestClient 999999 0

    2138 NEW TestUser AX 26 July 12 July 26, 12 NEW TestClient 999999 0

  • EXTRACTVALUE returns more than one row error

    Hi gurus

    I have XML file, now I would like to write an SQL to convert tabular. Whne I try to use

    EXTRACTVALUE
    (XML_MESSAGE,
    ' / ATMWithDrawTrans/Trans/Tran/TranDate.

    I'm ExtractValue returns multiple rows. Could you please help me find a query that retrieves these sub table form.

    < ATMWithDrawTrans >
    < Trans >
    < Tran >
    < TranDate > 2001 - 09 - 10 < / TranDate >
    < amount > 105 < / amount >
    < / Tran >
    < Tran >
    < TranDate > 2002 - 03 - 10 < / TranDate >
    < amount > 105 < / amount >
    < / Tran >
    < Tran >
    < TranDate > 2002 - 09 - 10 < / TranDate >
    < amount > 104 < / amount >
    < / Tran >
    < Tran >
    < TranDate > 2003 - 03 - 10 < / TranDate >
    < amount > 104 < / amount >
    < / Tran >
    < Tran >
    < TranDate > 2003 - 09 - 10 < / TranDate >
    < amount > 103 < / amount >
    < / Tran >
    < / Trans >
    < / ATMWithDrawTrans >

    TIA

    Published by: 870046 on July 25, 2011 08:50

    XMLTable will do what you want.

    For example, assuming XML_MESSAGE is a database of XMLType column:

    select x.*
    from your_table t
       , xmltable('/ATMWithDrawTrans/Trans/Tran'
           passing t.xml_message
           columns tran_date date   path 'TranDate'
                 , amount    number path 'amount'
         ) x
    ;
    

    If your version does not support, see XMLSequence in the documentation.

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

  • error:-row subquery returns more than one line, pls help

    SELECT dsg_code, dsg_name, dsg_grade FROM designation_master WHERE dsg_orgn =:parameter.p_orgn and dsg_ctry =:parameter.p_ctry and dsg_loc =: parameter.p_loc and dsg_oru =: parameter.p_oru
    and dsg_code <>: emp_desig and dsg_grade in (decode(:radio_group,)
    1, (SELECT grd_code FROM grade_master WHERE grd_osm_code in (Select distinct grd_osm_code FROM grade_master WHERE grd_orgn =:parameter.p_orgn and grd_ctry =:parameter.p_ctry and grd_loc =: parameter.p_loc and grd_oru =: parameter.p_oru and grd_code =: emp_grade)).
    2, (SELECT grd_code FROM grade_master WHERE grd_osm_code > all (Select distinct grd_osm_code FROM grade_master WHERE the grd_orgn =:parameter.p_orgn and grd_ctry =:parameter.p_ctry and grd_loc =: parameter.p_loc and grd_oru =: parameter.p_oru and grd_code =: emp_grade)).
    3, (SELECT grd_code FROM grade_master WHERE grd_osm_code < all (Select distinct grd_osm_code FROM grade_master WHERE the grd_orgn =:parameter.p_orgn and grd_ctry =:parameter.p_ctry and grd_loc =: parameter.p_loc and grd_oru =: parameter.p_oru and grd_code =: emp_grade)))

    Try something like this:

    SELECT dsg_code,dsg_name,dsg_grade
      FROM designation_master
     WHERE dsg_orgn=:parameter.p_orgn
       AND dsg_ctry=:parameter.p_ctry
       AND dsg_loc =:parameter.p_loc
       AND dsg_oru = :parameter.p_oru
       AND dsg_code!=:emp_desig
       AND (   (    :radio_group=1
                AND dsg_grade in (SELECT grd_code
                                    FROM grade_master
                                   WHERE grd_osm_code in (Select distinct grd_osm_code
                                                            FROM grade_master
                                                           WHERE grd_orgn=:parameter.p_orgn
                                                             and grd_ctry=:parameter.p_ctry
                                                             And grd_loc =:parameter.p_loc
                                                             And grd_oru = :parameter.p_oru
                                                             and grd_code =:emp_grade
                                                          )
                                  )
                )
             OR (    :radio_group=2
                 AND dsg_grade in (SELECT grd_code
                                     FROM grade_master
                                    WHERE grd_osm_code >any (Select distinct grd_osm_code
                                                               FROM grade_master
                                                              WHERE grd_orgn=:parameter.p_orgn
                                                                and grd_ctry=:parameter.p_ctry
                                                                And grd_loc =:parameter.p_loc
                                                                And grd_oru = :parameter.p_oru
                                                                and grd_code =:emp_grade
                                                            )
                                  )
                )
             OR (    :radio_group=3
                 AND dsg_grade in (SELECT grd_code
                                     FROM grade_master
                                    WHERE grd_osm_code 
    

    not tested

  • I can't have more than one value of function?

    I hope all of you can point me to some introductory articles/documents on function.

    I know the function is used to calculate a value and it always returns a single value.

    I want to know I can get more than one value of function? If so please share a few lines of code

    Hello

    Certainly, you CAN define functions with OUT parameters. It is generally not advisable to do so, however. Working with settings, for example, can be called from SQL, among other useful things.

    If you are wanting a function that returns multiple values, you would generally be

    -create a procedure that has several OUT parameters

    -create a function that returns a type of object that encapsulates the values that you want to return

    How to make FUNCTION returns several columns and several outputs line

    can functions return multiple values?

    oracle function to return more than one value

    You must give several values of function that can be found in Sql

  • 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

  • Thunderbird supports more than one e-mail account? How?

    I'm looking for an e-mail program that supports more than one e-mail account easily. Is Thunderbird such a program? How can I have three accounts for different purposes?

    Edit: deleted for your protection - personal information it is not a good idea to post your addresses to the public unless you want to invite a few more spam. (philipp)

    I'm not aware of any limitation on the number of accounts, I had support contact with people with hundreds of account set up.

    File (ALt + F) > new > existing e-mail account
    or
    In the toolbar > New (move your mouse until the submenu) > existing e-mail account. >

Maybe you are looking for