Post query giving error

Declare
cursor fin_ACNTs IS
SELECT aCODE,dr,cr,seq
FROM acnts
where CCODE = :xH_ccode
and Tcode = :XH_tCODE
aND tNO = :xh_Tno
order by seq;
total_rows NUMBER;
the above query will return 2 or 3 rows. for example,
aCODE DR CR SEq
P30737 1907.600 .000 B1
P30737 .000 1907.600 B2
I have 3 rows wise control fields on my form canvas
r1c1 r1c2 r1c3 r1c4
r2c1 r2c2 r2c3 r2c4
r3c1 r3c2 r3c3 r3c4
& I want to Store the above query result in Such way that
the 1st row returned should be saved in r1c1 r1c2 r1c3 r1c4
and the 2nd row returned in r2c1 r2c2 r2c3 r2c4
if the query returns 2 rows
i tried to incorporate it in thiS way, but needs SOme help;
declare
cursor fin_ACNTs IS
SELECT aCODE,dr,cr,seq
FROM acnts
where CCODE = :xH_ccode
and Tcode = :XH_tCODE
aND tNO = :xh_Tno
order by seq;
total_rows NUMBER;
begin
FOR i IN fin_ACNTs LOOP
:ctrl.Rc1 := i.aCODE;
:ctrl.R[i]C2 := i.dr;
:ctrl.R[i]C3 := i.cr;
:ctrl.R[i]C4 := i.seq;
num_total_rows := fin_ACNTs%ROWCOUNT;
END LOOP;
end;
while compling the trigger am getting the errors;
Error 49 line 15 column 5
Bad bind var :ctrl.R
Error 103 line 15 column 5
Encountered th symbol "[" when expecting one of the following
:= . ( @ % ; indicator

TYVM, Mr. Kuba,
those 4 rows r1c1....did get filled properly. I have now 1 more problem. about this form so,
I have a columnar tables
inventotry_header (Inv_head) and
inventory_detail (Inv_detail)
in post-database-commit i am saving some details in to a 3rd table, ACNTS
Inv_head is linked to inv_detail thru primary-foreign key, table ACNTS is independant.
i have joined inv_head==>ACNTs in forms.
i wrote this post-query Suggested by you. i want to display ONLY the control fields r1c1.....
derived from the acnts table in post query and keep acnts table fields hidden.
the acnts table should just be saved in the background(in post-database-commit) and
its values will be displayed on form thru the control fields.
but when i make the visible property of the acnts table fields to "NO", the post query result does not display
the control fields r1c1.... and on querying, at first record it gives error,
FRM-40106 No navigable items in destinations block
and why i dont want to use the acnts tables for display, because i want to assign & display the control fields
as i enter the details in inv_head and inv_detail, in the sequence of r1c1 r1c2 r1c3 r1c4....
which i dont think will be possible with acnts tables (which is a linked actual db table).
hope i have made it clear.

Similar Messages

  • Top N query giving error for oracle 8.0.6

    Dear All,
    We are executing this query SELECT XBLNR, WERKS, MATNR, MDV01, BACKFLQUANT, STATUS, SAPTIMESTAMP, PITSTIMESTAMP, PMTIMESTAMP, BATCH FROM (SELECT XBLNR, WERKS, MATNR, MDV01, BACKFLQUANT, STATUS, SAPTIMESTAMP, PITSTIMESTAMP, PMTIMESTAMP, BATCH FROM PMBPITS.PITS_UNITY WHERE STATUS = '01' ORDER BY PMTIMESTAMP) WHERE ROWNUM < 20
    on oracle 8.0.6 but this is giving the following error
    ora - 00907 missing right parenthesis error
    1. Is it that in the inner select we cannot use order by and where clause together.
    2. We also found that if we remove order by from inner select then the query is not giving error
    pls help . points will be awarded

    Hi,
    what ever the Aman said is correct. You check this is supported in 8.1.5, SQL allows you to embed the ORDER BY clause in a subquery and place the ROWNUM condition in the top-level query;
    'Top-N query' is a ORACLE 8i feature which is supported in SQL. However,
    Bug:855720 states the following:
    "PL/SQL does not support top-N queries (ORDER BY in SUBSELECT/SUBQUERY
    or VIEW. Since this feature is available in SQL, but not in PL/SQL,
    it has been logged as a Bug that will be fixed in 8.1.6."
    - Pavan Kumar N

  • SQL Query giving error in SAP B1 8.82 PL 09

    Hi all,
    Please check the query below.
    If we remove the Where condition from the Query it works fine.
    Otherwise it gives error. The error screen is also attached.
    [Microsoft][SQL Server Native Client 10.0][SQL Server]The data types ntext and
    ntext are incompatible in the equal to operator. 'Blanket Agreement'(OOAT)(OUQR)

    Dear Nagarajan K,
    First of all Thank You for prompt reply to my query.
    Select * from oinv T0 where T0.[DocDate] >=[%0] AND  T0.[DocDate] <=[%1]
    The issue with the above posted query is if you remove the filter conditions i.e where T0.[DocDate] >=[%0] AND  T0.[DocDate] <=[%1]
    The query works.
    Put the filter condition back and it gives eror:
    [Microsoft][SQL Server Native Client 10.0][SQL Server]The data types ntext and
    ntext are incompatible in the equal to operator. 'Blanket Agreement'(OOAT)(OUQR)
    What is possibly going wrong because data is there.

  • Post query giving messages

    Hi all i need help
    I have a database block and in that i an a non database item which i am using it for display purpose and i am getting the for the non database item thru the post query.
    After i retreive my block status is changing and when i immediately press save button without changing any records its giving me 2 records saved message.
    how can i supress this?
    BEGIN
    SELECT DISTINCT W_VLV_FNCT_CD INTO :WVG.W_VLV_FNCT_CD FROM WH_VALVES WHERE
         W_VLV_NUM = :WVG.W_VLV_NUM;
    EXCEPTION WHEN OTHERS THEN
         NULL;
    END;
    /*SET_RECORD_PROPERTY :system.TRIGGER_Record,'WVG','STATUS','QUERY_STATUS');*/
    :WVG.W_VLV_FNCT_CD COLUMN IS A NON DATABASE ITEM.
    Thanks
    -Samsam

    Hi,
    Do two things First check that when ur form opens no field in ur form is getting value from anywhere. May be through parameters or through when new form instance.
    Second Do not use exception When others use exception
    when no record found. Try these things. hoping that first point will solve ur problem.

  • Infoset query giving error post upgrade

    Hi All,
    We have upgraded our system from BW 3.5 to BI 7. Post upgrade we are getting error while opening/executing queries on infoset.
    In ST22 the error is UNCAUGHT_EXCEPTION -CX_RSD_NAME_ERROR.
    The infoset is active.
    Thanks for the help.
    Regards,
    Niraj

    Dear Both,
    I resolved the problem by applying the solution suggested by Wond.
    The SP details are as below,
    SAP_BW     700     0015     SAPKW70015     SAP NetWeaver BI 7.0
    We were facing this issue in development system. We didn't faced this issue in sandbox which was a copy of production. We are in process of upgrading now quality.
    Points assigned to Wond.
    Thanks to both for help.
    Regards,
    Niraj

  • Select query giving error

    Hi can Some one help me how to fit the query in the Main query, I need to selete SYS_ID the below Work around query is getting the output correctly
    but when i tried to put in the main query am getting ORA-00933 not sure how to fix this. Can some one advice me where am making wrong.
    Work Around query :
       SELECT ALTID.B_SYS_ID FROM N08.B_ALT_ID_TB ALTID WHERE ALTID.B_ALT_ID
               IN ( SELECT MEDCO.RE_MEDCD_ID_NUM 
                 FROM N09.T_MEDCD_ID MEDCO
              INNER JOIN N09.T_POLY POLY
                    ON POLY.RE_UNIQUE_ID = MEDCO.RE_UNIQUE_ID) AS B_SYS_ID
    Need to integerate the above column in the below query.
    Main Query :
    SELECT 'Diff' AS SC,
         POLY.ID,
          ALTID.B_SYS_ID FROM N08.B_ALT_ID_TB ALTID WHERE ALTID.B_ALT_ID
               IN ( SELECT MEDCO.RE_MEDCD_ID_NUM 
                 FROM N09.T_MEDCD_ID MEDCO
              INNER JOIN N09.T_POLY POLY
                    ON POLY.RE_UNIQUE_ID = MEDCO.RE_UNIQUE_ID) AS B_SYS_ID,
        NULL AS BEG_DT,
      NULL AS ID,
    FROM
       N09.T_POLY POLY
    Oracle Version : 10gR2
    Thanks in advance.

    Hi,
    Hillbird wrote:
    Hi Frank,
    Thanks for your responces. The Error am getting is at line number 7 & col# 55 -- ON POLY.RE_UNIQUE_ID = MEDCO.RE_UNIQUE_ID) AS B_SYS_ID,.
    I also changed the alias name in thesubquery as S-poly and left the main query alias as POLY. You still haven't posted a completed query, or any sample data and results.
    But still i am getting the same error message.
    Error Message
    ORA-00933 : Sql command not properly ended
    oo933 00000 - "Sql command not properly ended"
    Vendor Code 933 Error at line 7 column 55
    Iam framing a select query, The work around query is used to checkhow to reterive the value from the DB and with the business rules. on which the framing
    select query the B_sys_id comes in column 3 and i still have more columns to select. Hence i even tried as below
    SELECT 'Diff' AS SC,
    POLY.ID,
    ALTID.B_SYS_ID FROM N08.B_ALT_ID_TB ALTID WHERE ALTID.B_ALT_ID
    IN ( SELECT MEDCO.RE_MEDCD_ID_NUM 
                 FROM N09.T_MEDCD_ID MEDCO
                 WHERE POLY.RE_UNIQUE_ID = MEDCO.RE_UNIQUE_ID),
    NULL AS BEG_DT,
    NULL AS ID,
    FROM
    N09.T_POLY POLY
    But still the same error message i got.
    Hence i just tried as below
    SELECT 'Diff' AS SC,
    1 as dummy,
    2 as dummy_1,
    ALTID.B_SYS_ID FROM N08.B_ALT_ID_TB ALTID WHERE ALTID.B_ALT_ID
    IN ( SELECT MEDCO.RE_MEDCD_ID_NUM 
                 FROM N09.T_MEDCD_ID MEDCO
              INNER JOIN N09.T_POLY POLY
    ON POLY.RE_UNIQUE_ID = MEDCO.RE_UNIQUE_ID)
    This is working.
    Can you please let me know what is that i need to do if i want to add more columns in the select clause after
    this line ON POLY.REUNIQUE_ID = MEDCO.RE_UNIQUE_ID)_
    Thanks.
    A query (not counting sub-queries) has, at most, only one of each type of clause: one SELECT clause, followed by one FROM clause, followed (optionally) by one WHERE clause. All items to be returned go together in the one SELECT clause. All tables needed are named in the on FROM clause. All filtering conditions go together in the one WHERE clause.
    Perhaps you meant something like this:
    SELECT  'Diff'           AS SC
    ,          POLY.ID
    ,           ALTID.B_SYS_ID
    ,       NULL AS BEG_DT
    ,     NULL AS ID
    FROM     N08.B_ALT_ID_TB ALTID
    JOIN    N09.T_POLY     POLY   ON  altid.column_a  = poly.column_b
    WHERE      ALTID.B_ALT_ID     IN (
                          SELECT  MEDCO.RE_MEDCD_ID_NUM 
                             FROM    N09.T_MEDCD_ID           MEDCO
                             WHERE   POLY.RE_UNIQUE_ID      = MEDCO.RE_UNIQUE_ID
                      )With the little information I have, I can't even guess what the real join condition(s) might be. I used
    ON  altid.column_a  = poly.column_bjust to show the correct syntax.

  • Select...Model query giving error when compiled in form6i's WVI trigger

    friends i have this installed at my home;
    Forms [32 Bit] Version 6.0.8.25.2 (Production)
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
    and i have a query which is running fine at the back-end,
    select avgprice
    from (
    select t.*
    from (
    select seq_no
    , invxh_DATE
    , INVXH_code
    , invxh_No
    , invxH_total_qty
    , INVXH_net_AMOUNT_Scy INVXH_net_AMOUNT_Scy
    , balqty
    , ROUND(balamt, 3) balamt
    , ROUND(avgprice, 10) avgprice
    , ROUND(cost, 3) cost
    from (select b.*,
    sum(decode(invxh_code, 'BUY', INVXH_total_QTY, -INVXH_total_QTY)) OVER (ORDER BY INVXh_DATE) BALQTY,
    row_number() over (order by INVXH_date) seq_no
    from invs_TXN_head b
    where INVXH_BROK_code = 'B00001'
    aND INVXH_Securit_CODE = 'S00001'
    and INVXH_date < to_DATE('25/02/2008','dd/mm/yyyy'))
    model
    dimension by (seq_no)
    measures (invxh_DATE
    , INVXh_code
    , INVXH_no
    , INVXH_total_qty
    , balqty
    , INVXH_net_AMOUNT_Scy
    , 0 balamt
    , 0 balamt2
    , 0 avgprice
    , 0 cost)
    rules (
    balamt[seq_no is any] = nvl(balamt[cv() - 1], 0) +
    decode(INVXH_code[cv()], 'BUY', INVXH_net_AMOUNT_Scy[cv()] , -(balamt[cv() -1] /
    balqty[cv() -1] * invxh_TOTAL_qty[cv()]) ) ,
    cost[seq_no is any] = decode(INVXH_code[cv()], 'SEL', balamt[cv() -1] /
    balqty[cv() -1] * invxh_TOTAL_qty[cv()], 0),
    avgprice[seq_no is any] = decode(INVXH_code[cv()], 'BUY', balamt[cv()] /
    balqty[cv()] , avgprice[cv() - 1])
    ) t
    order by seq_no desc
    ) where rownum = 1
    AVGPRICE
    2.17612187560
    but when i try make use of this query in 1 of my form Item's When-Validate-Trigger, replacing with form variables,
    declare
         avgprice1 number;
    begin
    select avgprice INTO AVGPRICE1
    from (
    select t.*
    from (
    select seq_no
    , invxh_DATE
    , INVXH_code
    , invxh_No
    , invxH_total_qty
    , INVXH_net_AMOUNT_Scy INVXH_net_AMOUNT_Scy
    , balqty
    , ROUND(balamt, 3) balamt
    , ROUND(avgprice, 10) avgprice
    , ROUND(cost, 3) cost
    from (select b.*,
    sum(decode(invxh_code, 'BUY', INVXH_total_QTY, -INVXH_total_QTY)) OVER (ORDER BY INVXh_DATE) BALQTY,
    row_number() over (order by INVXH_date) seq_no
    from invs_TXN_head b
    where INVXH_BROK_code = :INVXH_brok_CODE
    aND INVXH_Securit_CODE = :invxh_Securit_CODE
    and INVXH_date < to_DATE('25/02/2008','dd/mm/yyyy'))
    model
    dimension by (seq_no)
    measures (invxh_DATE
    , INVXh_code
    , INVXH_no
    , INVXH_total_qty
    , balqty
    , INVXH_net_AMOUNT_Scy
    , 0 balamt
    , 0 balamt2
    , 0 avgprice
    , 0 cost)
    rules (
    balamt[seq_no is any] = nvl(balamt[cv() - 1], 0) +
    decode(INVXH_code[cv()], 'BUY', INVXH_net_AMOUNT_Scy[cv()] , -(balamt[cv() -1] /
    balqty[cv() -1] * invxh_TOTAL_qty[cv()]) ) ,
    cost[seq_no is any] = decode(INVXH_code[cv()], 'SEL', balamt[cv() -1] /
    balqty[cv() -1] * invxh_TOTAL_qty[cv()], 0),
    avgprice[seq_no is any] = decode(INVXH_code[cv()], 'BUY', balamt[cv()] /
    balqty[cv()] , avgprice[cv() - 1])
    ) t
    order by seq_no desc
    ) where rownum = 1;
    :INVXH_gainloSs_AMOUNT_lcy := :INVXH_NET_AMOUNT_Scy - (:INVXH_TOTAL_QTY * avgprice1);
    end;
    it does'nt get complied & gives error as;
    Encountered the symbol "(" when expecting one of the following
    +, from+
    its actually pointing to this line of the above query;
    sum(decode(invxh_code, 'BUY', INVXH_total_QTY, -INVXH_total_QTY)) OVER (ORDER BY INVXh_DATE) BALQTY,
    at this position...*OVER (...*
    is it a form6i-10g compatibility issue or what else..?
    TYVM

    ok,, i have put my code in a stored function 'WTAG1' in the database. its working fine at the back-end.
    i am calling it now from forms WVI trigger in this way;
    declare
         avgprice1 number(14,10);
    begin
         avgprice1 := GET_WTAVG(:invxh_BROK_code, :INVXH_securit_CODE, TO_DATE(:INVXH_DATE,'DD/MM/YYYY'));      
    :INVXH_gainloSs_AMOUNT_lcy := :INVXH_NET_AMOUNT_Scy - (:INVXH_TOTAL_QTY * NVL(avgprice1,0));
    end;
    at run time m getting ORA-06502 ERROR,dont know why..?
    :INVXH_gainloSs_AMOUNT_lcy property is 9,999,999.000
    AT the back-end the query works fine aS below;
    SQL> @WTAG1
    Function created.
    SQL> SELECT GET_WTAVG('B00001','S00001',TO_DATE('27/4/2008','DD/MM/YYYY')) AG FROM DUAL;
    AG
    2.1761218756
    this iS my function;
    create or replace function GET_WTAVG(P_BROK_CODE IN VARCHAR2, P_SECURIT_CODE IN VARCHAR2, P_DATE IN DATE)
    return NUMBER Is
      v_avgprice NUMBER(14,10);
    BEGIN
    SELECT avgprice INTO V_avgprice
      FROM   (SELECT t.*
              FROM   (SELECT seq_no,
                             invxh_date,
                             invxh_code,
                             invxh_no,
                             invxh_total_qty,
                             invxh_net_amount_scy invxh_net_amount_scy,
                             balqty,
                             round(balamt, 3) balamt,
                             round(avgprice, 10) avgprice,
                             round(cost, 3) cost
                      FROM   (SELECT b.*,
                                     SUM(decode(invxh_code,
                                                'BUY',
                                                invxh_total_qty,
                                                -invxh_total_qty)) over(ORDER BY invxh_date) balqty,
                                     row_number() over(ORDER BY invxh_date) seq_no
                              FROM   invs_txn_head b
                              WHERE  invxh_brok_code = P_BROK_CODE
                              AND    invxh_securit_code = P_sECURIT_CODE
                              AND    invxh_date < to_char(P_DATE,'DD/MM/YYYY'))
    model
    dimension BY(seq_no)
    measures(invxh_date
    , invxh_code
    , invxh_no, invxh_total_qty
    , balqty
    , invxh_net_amount_scy
    , 0 balamt
    , 0 balamt2
    , 0 avgprice
    , 0 cost)
    rules
    balamt[seq_no IS ANY] = nvl(balamt[cv() - 1], 0) +
                            decode(invxh_code[cv()], 'BUY', invxh_net_amount_scy[cv()], - (balamt[cv() - 1] /
                            balqty[cv() - 1] * invxh_total_qty[cv()])),
    cost[seq_no IS ANY]   = decode(invxh_code[cv()], 'SEL', balamt[cv() - 1] /
                            balqty[cv() - 1] * invxh_total_qty[cv()], 0),
    avgprice[seq_no IS ANY] = decode(invxh_code[cv()], 'BUY', balamt[cv()] / balqty[cv()], avgprice[cv() - 1]))) t
              ORDER  BY seq_no DESC)
      WHERE  rownum = 1;
    RETURN V_avgprice;
    exception
    when TOO_MANY_ROWS
    then return 'Too Many Authors in that State';
    when NO_DATA_FOUND
    then return 'No Authors in that State';
    when others
    then raise_application_error(-20011,'Unknown Exception in authName Function');
    END GET_WTAVG;
    /

  • Full outer join query giving error

    Hi I have written the below query to get the fields below as an out put but am getting the error missing keyword..am not understanding where did i missed..i have done step by step query analysis..but could not find the error.
    Please help me in resolving the issue.
    Expected output Columns :*
    COUNTRY , TRN_TYPE ,SKU ,BIX_Customer ,PERIOD ,CURRENTSTOCK ,STOCK_VALUE ,SALES ,SALES_VALUE ,TARGET
    Query :_
    select (case when a.country is null then b.country when b.country is null then c.country else a.country end) AS COUNTRY,
    (case when a.Sale_Type is null then b.Stk_type when b.stk_type is null then c.Stk_type else a.Sale_Type end) AS TRN_TYPE,
    (case when a.sku is null then b.sku when b.sku is null then c.sku else a.sku end) AS SKU,
    (case when a.bix_customer is null then b.bix_customer_code when b.bix_customer_code is null then c.bix_customer_code else a.bix_customer end)AS BIX_Customer ,
    (case when a.period is null then TO_number(b.period) when b.period is null then TO_NUMBER(c.period) else a.period end) AS PERIOD,
    nvl(b.CURRENTSTOCK,0) AS CURRENTSTOCK,
    nvl(b.stock_value,0) AS STOCK_VALUE,
    nvl(a.sales,0) AS SALES,
    nvl(a.SALES_VALUE,0) AS SALES_VALUE,
    nvl(c.TARGET_QTY,0) AS TARGET
    from
    (select UPPER(c.cust_country_name) AS COUNTRY,
    DECODE(ds.account_key,7156,'SAMPLE',7157,'BONUS',7485,'SALE') AS Sale_Type,
    substr(i.item_code,7) AS SKU,
    c.bix_customer_code AS BIX_Customer,
    ds.descr as descr ,
    ds.period as period,
    sum(ds.quantity) AS SALES,
    sum(case when ds.local_value is null then ds.euro_value else ds.local_value END) AS SALES_VALUE
    FROM distributor_sales ds, customer c, item i
    where ds.customer_key=c.customer_key
    and ds.item_key= i.item_key
    group by ds.period,
    ds.account_key,
    c.cust_country_name,
    substr(i.item_code,7),
    c.bix_customer_code,
    ds.descr) a
    full outer join
    (SELECT UPPER(b.cust_country_name) AS COUNTRY,
    DECODE(s.stock_type,'SALE','SALE','SALES','SALE','BONUS','BONUS','SAMPLE','SAMPLE') AS Stk_type,
    substr(c.item_code,7) AS SKU,
    s.descr as descr,
    s.period as period,
    b.bix_customer_code,
    sum(s.CLOSING_STOCK) CURRENTSTOCK,
    sum(s.closing_stock*s.cif_price) STOCK_VALUE
    FROM STOCK s, customer b, item c
    WHERE s.customer_key=b.customer_key
    and s.item_key= c.item_key
    group by
    s.descr,
    s.stock_type,
    s.period, b.bix_customer_code,b.cust_country_name,substr(c.item_code,7) ) b
    full outer join
    (SELECT UPPER(cu.cust_country_name) AS COUNTRY,
    DECODE(t.description,'SALES TARGET','SALE') AS Stk_type,
    substr(it.item_code,7) AS SKU,
    t.channel as channel,
    t.period as period,
    cu.bix_customer_code as bix_customer_code,
    sum(t.quantity) TARGET_QTY
    FROM sales_target t, customer cu, item it
    WHERE t.customer_key=cu.customer_key
    and t.item_key= it.item_key
    group by
    t.channel,
    t.description,
    t.period, cu.bix_customer_code,cu.cust_country_name,substr(it.item_code,7) ) c
    on a.SKU=b.SKU
    and a.sku=c.SKU
    and b.sku=c.SKU
    and a.BIX_Customer=b.bix_customer_code
    and a.BIX_Customer=c.bix_customer_code
    and b.bix_customer_code=c.bix_customer_code
    and a.Sale_Type=b.Stk_type
    and a.Sale_Type=c.Stk_type
    and b.Stk_type=c.Stk_type
    and a.descr=b.descr
    and b.descr=c.channel
    and a.descr=c.channel
    and a.country=b.country
    and a.country=c.COUNTRY
    and b.country=c.COUNTRY
    and a.period=b.period
    and a.period=c.period
    and b.period=c.period;

    <tt>Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production</tt>
    You must be aware that you must cascade full outer joins
    with
    t1 as
    (select 1 key,1.1 data from dual union all
    select 3,1.3 from dual union all
    select 6,1.6 from dual union all
    select 7,1.7 from dual
    t2 as
    (select 2 key,2.2 data from dual union all
    select 3,2.3 from dual union all
    select 4,2.4 from dual union all
    select 6,2.6 from dual
    t3 as
    (select 4 key,3.4 data from dual union all
    select 5,3.5 from dual union all
    select 6,3.6 from dual union all
    select 7,3.7 from dual
    select nvl(x.key,t3.key) key,
           x.data_1,
           x.data_2,
           t3.data data_3
      from (select nvl(t1.key,t2.key) key,
                   t1.data data_1,
                   t2.data data_2
              from t1
                   full outer join
                   t2
                on t1.key = t2.key
           ) x
           full outer join
           t3
        on t3.key = x.key
    order by keyunless you can live with duplicate key rows you cannot avoid whenever all table pairs contain common keys (try the below using data from above)
    select coalesce(t1.key,t2.key,t3.key) key,
           t1.data data_1,
           t2.data data_2,
           t3.data data_3
      from t1
           full outer join
           t2
        on t1.key = t2.key
           full outer join
           t3
        on t3.key = t1.key
       and t3.key = t2.key
    order by key
    select coalesce(t1.key,t2.key,t3.key) key,
           t1.data data_1,
           t2.data data_2,
           t3.data data_3
      from t2
           full outer join
           t3
        on t2.key = t3.key
           full outer join
           t1
        on t1.key = t2.key
       and t1.key = t3.key
    order by key
    select coalesce(t1.key,t2.key,t3.key) key,
           t1.data data_1,
           t2.data data_2,
           t3.data data_3
      from t1
           full outer join
           t3
        on t1.key = t3.key
           full outer join
           t2
        on t2.key = t1.key
       and t2.key = t3.key
    order by keyRegards
    Etbin
    Edited by: Etbin on 10.4.2013 9:53
    If you're after
    select *
      from (select *
              from (select *
                      from t1
                   ) a
                   full outer join
                   (select *
                      from t2
                   ) b
                on t1.key = t2.key
           ) x
           full outer join
           t3
        on t3.key = x.key
    order by keyyou're presently at
    select *
      from (
                   (select *
                      from t1
                   ) a
                   full outer join
                   (select *
                      from t2
                   ) b
                on t1.key = t2.key
           ) x
           full outer join
           t3
        on t3.key = x.key
    order by keyORA-00933: SQL command not properly ended

  • Giving error message when saving the Query

    Hello,
    I have added a new calculated key figure to the structure in a Query but when I try to save the Query it is giving error message is below.
    Error Message:
    u201CThis internal error is an intended termination resulting from a program state that is not permitted.
    Procedure
    Analyze the situation and inform SAP.
    If the termination occurred when you executed a query or Web template, or during interaction in the planning modeler, and if you can reproduce this termination, record a trace (transaction RSTT).
    For more information about recording a trace, see the documentation for the trace tool environment as well as SAP Note 899572u201D.
    Could any one please suggest me how can I over come with this problem.
    Thanks
    Prathap.

    Hi Prathap,
    There is some problem in the definition of the Query.
    Please click on the check button before saving the query, it gives where the problem exists in it.
    Hope it helps.
    Veeerendra.

  • While posting cash journal giving error

    Hi friends,
    I have updated cash in hand balance through f-02.
    When i am posting payments to vendor through FBCJ,(amount is 10 Rs.) giving error as Payment amount is larger than Cash on hand. Change amount.
    I updated cash in had account by 1000 rs.
    Please suggest.
    Regards,
    Suresh

    Hai
    See Cash journal is a seperate interface..
    You should have posted this cash in hand 1000 rs thru cash journal itself as reciept business transaction u are getting error bcz if u see ur opening balance it will be zero thats why system is  giving amount is higher.
    So again post cash in hand account 1000 rs in recirpts business transaction.
    Before to that u have to create a business transaction with cas in hand gl account.
    Regards
    Raghavendra.M
    SAP-Practice

  • Query Saving takes long time and giving error

    Hi Gurus,
    I am creating one query that have lot of calculations (CKF & RKF).
    When I am trying to save this query it is taking long time and it is giving error like RFC_ERROR_SYSTEM_FAILURE, Query Designer must be restarted, further work not possible.
    Please give me the solution for this.
    Thanks,
    RChowdary

    Hi Chowdary,
    Check the following note: 316470.
    https://websmp130.sap-ag.de/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/sapnotes/index2.htm?numm=316470
    The note details are:
    Symptom
    There are no authorizations to change roles. Consequently, the system displays no roles when you save workbooks in the BEx Analyzer. In the BEx browser, you cannot move or change workbooks, documents, folders and so on.
    Other terms
    BW 2.0B, 2.0A, 20A, 20B, frontend, error 172, Business Explorer,
    RFC_ERROR_SYSTEM_FAILURE, NOT_AUTHORIZED, S_USER_TCD, RAISE_EXCEPTION,
    LPRGN_STRUCTUREU04, SAPLPRGN_STRUCTURE, PRGN_STRU_SAVE_NODES
    Reason and Prerequisites
    The authorizations below are not assigned to the user.
    Solution
    Assign authorization for roles
    To assign authorizations for a role, execute the following steps:
    1. Start Transaction Role maintenance (PFCG)
    2. Select a role
    3. Choose the "Change" switch
    4. Choose tab title "Authorizations"
    5. Choose the "Change authorization data" switch
    6. Choose "+ Manually" switch
    7. Enter "S_USER_AGR" as "Authorization object"
    8. Expand "Basis: Administration"/"Authorization: Role check""
    9. From "Activity" select "Create or generate" and others like "Display" or "Change"
    10. Under "Role Name", enter all roles that are supposed to be shown or changed. Enter "*" for all roles.
    11. You can re-enter authorization object "S_USER_AGR" for other activities.
    Assign authorization for transactions
    If a user is granted the authorization for changing a role, he/she should also be granted the authorization for all transactions contained in the role. Add these transaction codes to authorization object S_USER_TCD.
    1. Start the role maintenance transaction (PFCG).
    2. Select a role.
    3. Click on "Change".
    4. Choose the "Authorizations" tab.
    5. Click on "Change authorization data".
    6. Click on "+ manually".
    7. Specify "S_USER_TCD" as "Authorization object".
    8. Expand "Basis - Administration"/"Authorizations: Transactions in Roles".
    9. Under "Transaction", choose at least "RRMX" (for BW reports), "SAP_BW_TEMPLATE" (for BW Web Templates), "SAP_BW_QUERY" (for BW Queries and/or "SAP_BW_CRYSTAL" (for Crystal reports) or "*". Values with "SAP_BW_..." are not transactions, they are special node types (see transaction code NODE_TYPE_DEFINITION).
    Using the SAP System Trace (Transaction ST01), you can identify the transaction that causes NOT_AUTHORIZED.
    Prevent user assignment
    Having the authorization for changing roles, the user is not only able to change the menu but also to assign users. If you want to prevent the latter, the user must loose the authorization for Transactions User Maintenance (SU01) and Role maintenance (PFCG).
    Z1>Note
    Refer to Note 197601, which provides information on the different display of BEx Browser, BEx Analyzer and Easy Access menu.
    Please refer to Note 373979 about authorizations to save workbooks.
    Check in the transaction ST22 for more details on the Query designer failure or query log file.
    With Regards,
    Ravi Kanth.
    Edited by: Ravi kanth on Apr 9, 2009 6:02 PM

  • Giving error in update query

    This is my update query in oracle but it is giving error:
    Update (select NM.Nominal_Amount,NM.Number_of_Units,NM.Current_Spot,NM.Published_Spot,NM.Strike_Price
    from note_master NM ,
    (     select NORM.Note_Master_ID, NORM.Asset, NORM.Currency , 50 as Spot_Price_Calc,      NVL(TOADD.NA,0) As NA, NVL(TOADD.NS,0)
    As NS, NVL(TOADD.NA_P,0) As NA_P, NVL(TOADD.NS_P,0) As NS_P, NVL(TOADD.SA,0) As SA,      (50 * (NORM.Strike_Price_Per/100)) as
    rike_Price_Calc,      (Case When UPPER(NORM.Misc2) = 'Q' THEN (NORM.No_Of_Shares * 50 * (NORM.Strike_Price_Per/100)) Else
    NORM.Nominal_Amount End )as Nominal_Amount_Calc,     (Case When UPPER(NORM.Misc2) ='N' THEN (NORM.Nominal_Amount /( 50 * (NORM.Strike_Price_Per/100)))
    Else NORM.No_Of_Shares End )as NO_Of_Shares_Calc,     (Case When UPPER(NORM.Misc2) = 'Q' THEN (NORM.No_Of_Shares * 50 * (NORM.Strike_Price_Per/100) * NORM.Issue_Price )/100
    Else (NORM.Nominal_Amount * NORM.Issue_Price )/100 End )as Settlement_Amt_Calc     from      (          select Note_Master_Id, MIN(Spot_Price) as Spot_Price, Min(Strike_Price) as
    Strike_Price, SUM(Nominal_Amount) as Nominal_Amount, SUM(No_Of_Shares) as No_Of_Shares , MIN(Issue_Price) as Issue_Price, MIN(Asset) as Asset, MIN(Currency) as Currency,
    MIN(Strike_Price_Per) as Strike_Price_Per, MIN(Misc2) as Misc2      from      (          Select Note_Master_Id, Spot_Price, Strike_Price, Nominal_Amount, No_Of_Shares, Issue_Price, Asset,
    Currency , Strike_Price_Per,Misc2      from Sample_ADF_FinIQ_Common.Note_Order_RM      Where Order_Status_Flag = 'YYYYYYNNNNNNNNNN'      And RO_ID = 'R000000002'     ) NORM      Group by Note_Master_Id     ) NORM
    Left Outer JOIN Sample_ADF_FinIQ_Common.RATESSPOTBIDASK RSBA     On RSBA.PairCode = (NORM.Asset )          Left Outer JOIN      (     select Note_Master_ID,sum(Nominal_Amount)
    as NA, sum(No_Of_Shares) as NS, sum(NominalAmt_Pending) as NA_P, sum(NoOfShares_Pending) as NS_P,sum(Settlement_Amt) as SA      from Note_Order_RM     
    Where RO_ID <> 'R000000002'     group by Note_Master_ID ) TOADD     On TOADD.Note_Master_ID = NORM.Note_Master_ID ) RESULT1 where NM.Note_Master_ID = RESULT1.Note_Master_ID )
    set      Price_Updated_YN = 'Y'           ,
    Nominal_Amount = RESULT1.NA + RESULT1.Nominal_Amount_Calc          , Number_Of_Units = RESULT1.NS + RESULT1.NO_Of_Shares_Calc          ,
    Current_Spot = RESULT1.Spot_Price_Calc           , Published_Spot = RESULT1.Spot_Price_Calc           , Strike_Price = RESULT1.Strike_Price_Calc
    where NM.Note_Master_ID = RESULT1.Note_Master_ID;
    error :
    rror at Command Line:17 Column:105
    Error report:
    SQL Error: ORA-00904: "RESULT1"."STRIKE_PRICE_CALC": invalid identifier
    00904. 00000 - "%s: invalid identifier"
    can anybody help.
    Thanks

    Still one more typo problem exists in you sql stament , equal to(=) operator is missing in your original statement look below
    original
    Where RO_ID 'R000000002'     group by Note_Master_ID ) TOADD     On TOADD.Note_Master_ID = NORM.Note_Master_ID ) RESULT1 where NM.Note_Master_ID = RESULT1.Note_Master_ID )
    set Price_Updated_YN = 'Y'
    modified
    Where RO_ID='R000000002'     group by Note_Master_ID ) TOADD     On TOADD.Note_Master_ID = NORM.Note_Master_ID ) RESULT1 where NM.Note_Master_ID = RESULT1.Note_Master_ID )
    set Price_Updated_YN = 'Y' Ok, once try with this code, some syntax prob i modified it.
    Update (select NM.Nominal_Amount,NM.Number_of_Units,NM.Current_Spot,NM.Published_Spot,NM.Strike_Price
    from note_master NM ,
    (     select NORM.Note_Master_ID, NORM.Asset, NORM.Currency , 50 as Spot_Price_Calc, NVL(TOADD.NA,0) As NA, NVL(TOADD.NS,0)
    As NS, NVL(TOADD.NA_P,0) As NA_P, NVL(TOADD.NS_P,0) As NS_P, NVL(TOADD.SA,0) As SA, (50 * (NORM.Strike_Price_Per/100)) as
    Strike_Price_Calc, (Case When UPPER(NORM.Misc2) = 'Q' THEN (NORM.No_Of_Shares * 50 * (NORM.Strike_Price_Per/100)) Else
    NORM.Nominal_Amount End )as Nominal_Amount_Calc,     (Case When UPPER(NORM.Misc2) ='N' THEN (NORM.Nominal_Amount /( 50 * (NORM.Strike_Price_Per/100)))
    Else NORM.No_Of_Shares End )as NO_Of_Shares_Calc,     (Case When UPPER(NORM.Misc2) = 'Q' THEN (NORM.No_Of_Shares * 50 * (NORM.Strike_Price_Per/100) * NORM.Issue_Price )/100
    Else (NORM.Nominal_Amount * NORM.Issue_Price )/100 End )as Settlement_Amt_Calc     from (      select Note_Master_Id, MIN(Spot_Price) as Spot_Price, Min(Strike_Price) as
    Strike_Price, SUM(Nominal_Amount) as Nominal_Amount, SUM(No_Of_Shares) as No_Of_Shares , MIN(Issue_Price) as Issue_Price, MIN(Asset) as Asset, MIN(Currency) as Currency,
    MIN(Strike_Price_Per) as Strike_Price_Per, MIN(Misc2) as Misc2 from (      Select Note_Master_Id, Spot_Price, Strike_Price, Nominal_Amount, No_Of_Shares, Issue_Price, Asset,
    Currency , Strike_Price_Per,Misc2 from Sample_ADF_FinIQ_Common.Note_Order_RM Where Order_Status_Flag = 'YYYYYYNNNNNNNNNN' And RO_ID = 'R000000002'     ) NORM Group by Note_Master_Id     ) NORM
    Left Outer JOIN Sample_ADF_FinIQ_Common.RATESSPOTBIDASK RSBA     On RSBA.PairCode = (NORM.Asset )      Left Outer JOIN (     select Note_Master_ID,sum(Nominal_Amount)
    as NA, sum(No_Of_Shares) as NS, sum(NominalAmt_Pending) as NA_P, sum(NoOfShares_Pending) as NS_P,sum(Settlement_Amt) as SA from Note_Order_RM     
    Where RO_ID 'R000000002'     group by Note_Master_ID ) TOADD     On TOADD.Note_Master_ID = NORM.Note_Master_ID ) RESULT1 where NM.Note_Master_ID = RESULT1.Note_Master_ID )
    set Price_Updated_YN = 'Y' ,
    Nominal_Amount = RESULT1.NA + RESULT1.Nominal_Amount_Calc      , Number_Of_Units = RESULT1.NS + RESULT1.NO_Of_Shares_Calc      ,
    Current_Spot = RESULT1.Spot_Price_Calc , Published_Spot = RESULT1.Spot_Price_Calc , Strike_Price = RESULT1.Strike_Price_Calc
    where NM.Note_Master_ID = RESULT1.Note_Master_ID;Edited by: darkStargate on Dec 8, 2011 7:42 PM

  • Why this query is giving error in report

    I have a simple query ...
    SELECT &P_FLEXDATA C_FLEXDATA,
    CHART_OF_ACCOUNTS_ID C_NUM
    FROM GL_CODE_COMBINATIONS
    It is running fine in SQL prompt but when I create it as a report query then it is giving error: ORA-00904 "C_FLEXDATA": invalid identifier
    Please advise ....
    I shall be ever thankful...
    Best Regards

    Hello,
    You are using a "lexical" reference in the SQL query (&P_FLEXDATA).
    You must set a default value for P_FLEXDATA in order the SQL Query to be parsed successfuly
    Regards

  • "FRM:40654 Record has been updated by another user" - Error in POST-QUERY

    Hi,
    I'm using Forms version 6.0.8.26.0
    In one of the forms, its data block is based on a view.
    In POST-QUERY trigger, I try to change the value for a database item. This operation results in following error:
    "FRM-40654: Record has been updated by another user. Re-query to see change."
    After this message the value of the item is automatically being set back to what was queried from the DB.
    I tried setting the DML Returning Value to 'Yes'. It doesn't help :(
    Any suggestions please?
    Thanks,
    Usha

    Hy
    try to set key-locking delayed
    and check
    if one field from the view as primary key
    or
    manually create On-Update, On-Insert, On-Delete and On-Lock triggers
    or
    write an INSTEAD OF TRIGGER

  • During cancelation of MIRO document giving error message "RG23 Part II post

    Dear guru's,
    I am facing a tipical issue while i am going to reverse the MIRO document it is giving error "RG23 Part II posting not yet done" .
    Senario is -- user has created MIGO  with Myp103  and then 105, system promted excise tab and excise ref.  and excise date is their .
    But no Part1 generated.
    So no part2 .
    Now A/c has passed the bill and fi doc generated.  Now we want revrse this bill (MIRO) and respectively MIGO (105/103 ) and again capture it with correct excise entry.
    we want to understand, How this happned at 105 why part1 not generated and with out part2 how bill passed.
    now waht can bo done to reverse this.
    thanks in advance.
    Ajeet

    Hello,
    Please check the status of excise invoices if they are "In process" stage. Unless the status is "Posted" you will not be allowed to do MIRO. Further, select only those line items which belong to excise invoice.
    Another possibillity of the error could be that the user must have changed the excise invoice date after it was referred in MIGO.
    If so, to avoid such issues and to stop the users from doing the above, please review the notes : 1285986, 1346926, 1406505.
    I hope this helps.
    Thanks and regards,
    Suresh.

Maybe you are looking for

  • Adding a view in a component of BSP application

    Hi All, I want to create new component for a BSP and add a view to it. my scenario is : I have a problem in creating a pop-up view whenever a button in a WEB UI is clicked. I have added a button in the items tab of sales order creation(in WEB UI),so

  • Can't get anything at all to open in CS6

    I can't get anything at all to open in CS6 (on a Mac OS X 10) and can't create `new. Yesterday it was working perfectly.

  • The Discussion Forum

    The discussion forum which Oracle has come up with a new look , i feel is more cumbersome to use. The earlier forum was much better in terms of usage . Although the look and feel wise the new forum is much better but its not user friendly . Sorry to

  • Where is Mini Bridge

    Hi guys, I am new to Adobe Creative Cloud. I just installed Ps, Ai, and Id. The thing is I can't find the Mini Bridge panel where its supposed to be; under Extensions in the Window menu. In fact, the entire Extensions Menu option is disabled. Can any

  • I have an error when i uploding my file pdf.

    why i can`t convert my pdf to word when i uploading my file put error but really i dont know what i have to do!!!!!1 help me please 55mb is my pdf