Query clarification required....

with t as
( select '1' voucher_id,'80' account_code,1000 Total_amt from dual
   union all
   select '1' voucher_id,'80' account_code,2000 Total_amt from dual
   union all
   select '1' voucher_id,'80' account_code,3000 Total_amt from dual
   union all
   select '1' voucher_id,'33' account_code,300 Total_amt from dual
   select  voucher_id,account_code,total_amt,sum(total_amt) over ( partition by voucher_id)
                                   tax
               from tThe output is below
(code}
VOUCHER_IDACCOUNT_CODE     TOTAL_AMT     TAX
1     80     1000     6300
1     80     2000     6300
1     80     3000     6300
1     33     300     6300
But i need the last column value should be changed.
IT SHOULD BE 3RD COLUMN VALUE WHERE ACCOUNT CODE IS 33.  SO 300 SHOULD BE DISPLAYED IN ALL THE VALUES OF TAX PARTION BY VOUCHER ID.
FOR THIS VOUCHER 1 I HAVE 300. like this I will have multiple vouchers. but account 33's  total amount should be displayed in tax column..
Pls help
S                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

Oraclehema,
Do you want query as:
with t as
( select '1' voucher_id,'80' account_code,1000 Total_amt from dual
   union all
   select '1' voucher_id,'80' account_code,2000 Total_amt from dual
   union all
   select '1' voucher_id,'80' account_code,3000 Total_amt from dual
   union all
   select '1' voucher_id,'33' account_code,300 Total_amt from dual
   select  voucher_id,account_code,total_amt,sum(total_amt) over ( partition by account_code)
                                   tax
               from tAnd Data As:
VoucherID     Account_Code      Total_amt      Tax
1                33                           300               300
1                80                           3000               6000
1                80                           1000               6000
1                80                           2000               6000I would suggest you to provide a sample expected O/P for sake of understanding..
Regards,
P.

Similar Messages

  • Clarification required on the Sales area data information.

    Hi Master's,
    As per the standard taxation practice,Tax determination depends upon the Tax liability of a Shipt to Party.
    But in a Customer master The Tax classification is maintained in the SALES AREA DATA-BILLING TAB,To my understanding
    the Billing Tab data comes from Sold to party.If so how does Billing tab convey the Tax liability of Ship to party.
    I am Confused,please let me know in terms of Customer master and Partner types:
    1) Which Tabs under the sales data  i.e Shipping Billing...come from which Partner.i.e like Sold to party.
         (Clarification required on the Sales area data information coming from which Partner functions).
    Please suggest,
    Thanks
    Gajender

    Hi
    As per the standard taxation practice,Tax determination depends upon the Tax liability of a Shipt to Party.
    But in a Customer master The Tax classification is maintained in the SALES AREA DATA-BILLING TAB,To my understanding
    the Billing Tab data comes from Sold to party.If so how does Billing tab convey the Tax liability of Ship to party.
    I am Confused,please let me know in terms of Customer master and Partner types:
    1) Which Tabs under the sales data i.e Shipping Billing...come from which Partner.i.e like Sold to party.
    (Clarification required on the Sales area data information coming from which Partner functions).
    There is no need of any confusion here
    All the tabs and data or fields pertains sold to party only
    If for a sold to party say 1001 if he himself is going to be SH and PY and BP then there is no confusion
    If  for a sold to party say 1001 the ship to party is 1002 and PY is 1003 and bill to party is himself that is 1001
    This is what mentioned  or assigned in the partner functions of CMR of 1001 in the sales area data
    This means there are another CMR lies in the name of 1002 and 1003
    Whenever an order comes for 1001 as Sold to party for tax classifications the ship to paty 1002's master record is accessed by the system
    System accesses another record for a particular detail (tax details)
    Similarly for this customer 1001's order for payment terms 1003's CMR is accessed by the system
    System accesses another record for a particular detail ( for terms of payment)
    There is no need for any confusion and if you run this in the system with different data you will understand it much better
    Regards
    Raja

  • Query Generator Error-Clarification required

    Hai Experts,
    I wrote a query select * from OPOR where Docnum>'[%0]
    This works all fine.
    When I replace the OPOR table name with a view name created for the table OPOR, the same statement does not work and returns error incorrect syntax.
    Pls explain why does this happen?
    Thanks
    Anand

    Dear Gordon,
    Thanks for your response. The following is the query I wrote in Query Generator, when I give a literal value, the query worked without any error. When I use dynamic user input string, it returns errror. In this case the database object IR is a view, that I created to facilitate a complicated query.
    I need that, user should be able to input his criteria value. Please help me to achieve this.
    Thanks in advance.
    Regards
    Anand
    SELECT distinct t0.PO,max(t0.Supplier) Supplier,max(t0.OrderNo) OrderNo,max(t0.StyleNo) StyleNo,Max(t0.Process) Process,Max(t0.Date) IssueDate,
    (select isnull(sum(t1.Quantity),0) from IR t1 where t1.PO=t0.PO and t1.Ttype<0) TotalIssued,
    (select isnull(sum(t2.Quantity),0) from IR t2 where t2.po=t0.po and t2.Ttype>0) TotalReceived,
    isnull((select sum(t1.Quantity) from IR t1 where t1.PO=t0.PO and t1.Ttype<0),0)-
    isnull((select sum(t2.Quantity) from IR t2 where t2.po=t0.po and t2.Ttype>0),0) Balance from ir t0 where
    t0.Process='[%1]'
    and isnull((select sum(t1.Quantity) from IR t1 where t1.PO=t0.PO and t1.Ttype<0),0)>0
    Group By t0.po

  • Query Help required

    HI Experts ,
    Could you please help me in getting below output ,
    My Input Table :
    Number
    Loc_A
    LOC_B
    PARENT_NUMBER
    A-01
    Ind
    Aus
    A
    A-02
    Fra
    NZ
    A
    A-03
    Ind
    SL
    A
    A-04
    USA
    Aus
    A
    A-05
    Pak
    WI
    A
    A-06
    Fra
    Ag
    A
    A-07
    Rus
    Ban
    A
    A-08
    SA
    Ind
    A
    A-09
    Ind
    Ind
    A
    My Required Output
    Number
    Loc_A
    LOC_B
    PARENT_NUMBER
    A-01
    Ind
    Aus
    A
    A-02
    Fra
    NZ
    A
    A-03
    Ind
    SL
    null
    A-04
    USA
    Aus
    null
    A-05
    Pak
    WI
    A
    A-06
    Fra
    Ag
    null
    A-07
    Rus
    Ban
    A
    A-08
    SA
    Ind
    A
    A-09
    Ind
    Ind
    null
    I am comparing each and every record with its previous rows values for column Loc_A and Loc_B and if they are getting matched i m inserting null .
    table structure
    with t as
    (select 'A-01' as Num,'Ind' as Loc_A,'Aus' as Loc_B,'A' as Parent_Num from dual
    union all
    select 'A-02' as Num,'Fra' as Loc_A,'NZ' as Loc_B,'A' as Parent_Num from dual
    Union all
    select 'A-03' as Num,'Ind' as Loc_A,'SL' as Loc_B,'A' as Parent_Num from dual
    union all
    select 'A-04' as Num,'USA' as Loc_A,'Aus' as Loc_B,'A' as Parent_Num from dual
    union all
    select 'A-05' as Num,'Pak' as Loc_A,'WI' as Loc_B,'A' as Parent_Num from dual
    union all
    select 'A-06' as Num,'Fra' as Loc_A,'Ag' as Loc_B,'A' as Parent_Num from dual
    union all
    select 'A-07' as Num,'Rus' as Loc_A,'Ban' as Loc_B,'A' as Parent_Num from dual
    union all
    select 'A-08' as Num,'SA' as Loc_A,'Ind' as Loc_B,'A' as Parent_Num from dual
    union all
    select 'A-09' as Num,'Ind' as Loc_A,'Ind' as Loc_B,'A' as Parent_Num from dual
    select * from t;
    Could you please help ,i have 1000's of rows with this kind of data

    Hi,
    I have tried to create a query, this might help you
    WITH t AS (SELECT 'A-01' AS Num,
                      'Ind' AS Loc_A,
                      'Aus' AS Loc_B,
                      'A' AS Parent_Num
                 FROM DUAL
               UNION ALL
               SELECT 'A-02' AS Num,
                      'Fra' AS Loc_A,
                      'NZ' AS Loc_B,
                      'A' AS Parent_Num
                 FROM DUAL
               UNION ALL
               SELECT 'A-03' AS Num,
                      'Ind' AS Loc_A,
                      'SL' AS Loc_B,
                      'A' AS Parent_Num
                 FROM DUAL
               UNION ALL
               SELECT 'A-04' AS Num,
                      'USA' AS Loc_A,
                      'Aus' AS Loc_B,
                      'A' AS Parent_Num
                 FROM DUAL
               UNION ALL
               SELECT 'A-05' AS Num,
                      'Pak' AS Loc_A,
                      'WI' AS Loc_B,
                      'A' AS Parent_Num
                 FROM DUAL
               UNION ALL
               SELECT 'A-06' AS Num,
                      'Ind' AS Loc_A,
                      'Ag' AS Loc_B,
                      'A' AS Parent_Num
                 FROM DUAL
               UNION ALL
               SELECT 'A-07' AS Num,
                      'Rus' AS Loc_A,
                      'Ban' AS Loc_B,
                      'A' AS Parent_Num
                 FROM DUAL
               UNION ALL
               SELECT 'A-08' AS Num,
                      'SA' AS Loc_A,
                      'Ind' AS Loc_B,
                      'A' AS Parent_Num
                 FROM DUAL
               UNION ALL
               SELECT 'A-09' AS Num,
                      'Ind' AS Loc_A,
                      'Ind' AS Loc_B,
                      'A' AS Parent_Num
                 FROM DUAL)
    SELECT t.num,
           t.loc_a,
           t.loc_b,
           CASE
              WHEN (FIRST_VALUE (LOC_A)
                       OVER (ORDER BY NUM RANGE UNBOUNDED PRECEDING)) IN
                         (LOC_A, LOC_B)
                    OR (FIRST_VALUE (LOC_B)
                         OVER (ORDER BY NUM RANGE UNBOUNDED PRECEDING)) IN
                         (LOC_A, LOC_B)
              THEN
              ELSE
                 t.parent_num
           END
              parent_num
      FROM t
    NUM
    LOC_A
    LOC_B
    PARENT_NUM
    A-01
    Ind
    Aus
    A-02
    Fra
    NZ
    A
    A-03
    Ind
    SL
    A-04
    USA
    Aus
    A-05
    Pak
    WI
    A
    A-06
    Ind
    Ag
    A-07
    Rus
    Ban
    A
    A-08
    SA
    Ind
    A-09
    Ind
    Ind
    Only error I have here is the First Value is showing '-'. I have not got enough time to remove it.
    Regards,
    Adarsh

  • Link user query to required print layout

    Hi all,
    I tried linking my user query to a required print layout for user reports.
    I have followed the same procedure as given in  (Query PLD.pdf ) but when I try to save ,
    I get the following error
    Items were found with the same exclusive no [Message 101-19 ]
    Can anybody help me with this
    Thanks
    Nirmala B.

    finally got it

  • SQL Query Assistance Required for Full Outer Join

    Hi,
    Lets say I have two tables, i.e:
    TAB_A (colA1, colA2, colA3, colA4)
    TAB_B (colB1, colB2, colB3, colB4) where colB2 is a FK to colA1
    I am after an SQL query that will cater for both the following two scenarios.
    Scenario 1:
    TAB_A has two rows of data, i.e
    (1, ABC100, 1, WG_A)
    (2, ABC100, 2, WG_B)
    TAB_B has one row of data, i.e
    (1, 1, EMP_222, 4)
    I use the following SQL:
    select a.*, b.*
    from tab_a a FULL OUTER JOIN tab_b b ON (a.colA1 = b.colB2)
    where a.colA2 = 'ABC100'
    This returns two rows:
    1, ABC100, 1, WG_A, 1, 1, EMP_222, 4
    2, ABC100, 2, WG_B
    Now, what I actually would like my query to do is actually only return the row where a tab_b record exists, i.e, should only return one record:
    1, ABC100, 1, WG_A, 1, 1, EMP_222, 4
    This I can achieve by using a RIGHT OUTER JOIN instead above, but this causes issue with my scenario 2, which is the following set-up
    Scenario 2:
    TAB_A has only one row of data this time, i.e
    (2, ABC100, 2, WG_B)
    TAB_B has no data at all this time
    This returns no rows but I actually now want this single record from tab_a returned.
    I basically require an SQL query that will cater for both the top 2 scenarios, i.e, if a tab_b record exists from the outer join then only return this record along with tab_a data. If a tab_b record doesn't exist, then only return the tab_a record.
    Hope the above makes sense.
    Thanks.

    Is it what you need (not very elegant) ?
    SQL> select * from t_outer;
            ID CODE
             1 100
             2 100
    SQL> select * from t_inner;
    no rows selected
    SQL> with tab1 as (
      2  select a.id a_id, a.code, b.id b_id from t_outer a join t_inner b on
      3  (a.id = b.id and a.code = '100'))
      4  select * from tab1
      5  union all
      6  select a.*, null from t_outer a where not exists (
      7  select 1 from tab1)
      8  and a.code = '100'
      9  /
          A_ID CODE             B_ID
             1 100
             2 100
    SQL> insert into t_inner values(2);
    1 row created.
    SQL> with tab1 as (
      2  select a.id a_id, a.code, b.id b_id from t_outer a join t_inner b on
      3  (a.id = b.id and a.code = '100'))
      4  select * from tab1
      5  union all
      6  select a.*, null from t_outer a where not exists (
      7  select 1 from tab1)
      8  and a.code = '100'
      9  /
          A_ID CODE             B_ID
             2 100                 2
    Rgds.

  • Query Description Required

    Hi All,
    I have a requirement, whereby when I run t.code ST03N, I get technical name of a query I would like to have the description of the query is the a way to do so ? Say via SE16 ... and get them ...
    Please assist
    Nathan

    one way is to go to SE16 table RSZELTDIR
    Choose REP for field DEFTP, query tech name for field MAPNAME.
    The field TXTLG gives you the description of the query name

  • Query Help required to Connect JDT1 with OINV tables

    Dear Experts,
    I have the following query which gives me the customer ageing report. I want some addtional fields from the OINV table and the document numbering table like Document Series Name, AR Invoice document Number,AR invoice remarks, BP Projects Number ( filled in accounting tab in BP projects) and in the query in Reference 1 column its giving the Invoice Numbers as posted in the Journal but for manual Journal Entries it not giving the Journal Number which I also want to be shown in Ref 1 or a seperat field.
    The Query is as under :
    select OCRD.cardcode 'Supplier Code',OCRD.cardname 'Name',sysdeb 'Debit Amount',syscred 'Credit Amount',
    case JDT1.transtype
    when '13' then 'INV'
    when '14' then 'AR CN'
    when '24' then 'INCOMING'
    else 'Other'
    end 'Type',
    Ref1,
    fccurrency 'BP Currency',
    CONVERT(VARCHAR(10), refdate, 103)'Posting Date' ,
    CONVERT(VARCHAR(10), duedate, 103) 'Due Date',
    CONVERT(VARCHAR(10), taxdate, 103) 'Doc Date' ,
    CASE
    when (DATEDIFF(dd,refdate,current_timestamp))+1 < 31
    then
    case
    when syscred <> 0 then syscred * - 1
    else sysdeb
    end
    end "0-30 days",
    case when ((datediff(dd,refdate,current_timestamp))+1 > 30
    and (datediff(dd,refdate,current_timestamp))+1< 61)
    then
    case
    when syscred <> 0 then syscred * - 1
    else sysdeb
    end
    end "31 to 60 days",
    case when ((datediff(dd,refdate,current_timestamp))+1 > 60
    and (datediff(dd,refdate,current_timestamp))+1< 91)
    then
    case
    when syscred <> 0 then syscred * - 1
    else sysdeb
    end
    end "61 to 90 days",
    CASE
    when (DATEDIFF(dd,refdate,current_timestamp))+1 > 90
    then
    case
    when syscred= 0 then sysdeb
    when sysdeb= 0 then syscred * - 1
    end
    end "90 + days"
    from JDT1,OCRD where JDT1.shortname = OCRD.cardcode and cardtype = 'c' and intrnmatch = '0'
    ORDER BY OCRD.CARDCODE, taxdate
    Would appreciate if you can help me to get a solution in it.
    Regards,
    Kamlesh

    Dear Gordon,
    While executing the followings modified query it giving an error of
    Incorrect Syntax near the keyword 'to' and incorrect Syntax near 'Series'
    the query is as under :
    {select OCRD.cardcode 'Supplier Code',OCRD.cardname 'Name',sysdeb 'Debit Amount',syscred 'Credit Amount',
    case l.transtype
    when '13' then 'INV'
    when '14' then 'AR CN'
    when '24' then 'INCOMING'
    else 'Other'
    end 'Type',
    j.BaseRef'Trans #',
    case l.transtype
    when '13' then
    (Select Comments from OINV where OINV.Transid=j.Transid)
    else '-'
    end 'Inv.Rem.',
    (Select SeriesName From NNM1 Where Series=j.DocSeries and ObjectCode=l.TransType)'Series',
    to
    (Select Isnull(SeriesName, 'Manual') From NNM1 Where Series=j.DocSeries and ObjectCode=l.TransType)'Series',
    l.Ref1,
    fccurrency 'BP Currency',
    CONVERT(VARCHAR(10), l.refdate, 103)'Posting Date' ,
    CONVERT(VARCHAR(10), l.duedate, 103) 'Due Date',
    CONVERT(VARCHAR(10), l.taxdate, 103) 'Doc Date' ,
    CASE
    when (DATEDIFF(dd,l.refdate,current_timestamp))+1 < 31
    then
    case
    when syscred <> 0 then syscred * - 1
    else sysdeb
    end
    end "0-30 days",
    case when ((datediff(dd,l.refdate,current_timestamp))+1 > 30
    and (datediff(dd,l.refdate,current_timestamp))+1< 61)
    then
    case
    when syscred <> 0 then syscred * - 1
    else sysdeb
    end
    end "31 to 60 days",
    case when ((datediff(dd,l.refdate,current_timestamp))+1 > 60
    and (datediff(dd,l.refdate,current_timestamp))+1< 91)
    then
    case
    when syscred <> 0 then syscred * - 1
    else sysdeb
    end
    end "61 to 90 days",
    CASE
    when (DATEDIFF(dd,l.refdate,current_timestamp))+1 > 90
    then
    case
    when syscred= 0 then sysdeb
    when sysdeb= 0 then syscred * - 1
    end
    end "90 + days"
    from JDT1 l
    Inner Join OJDT j On j.TransId=l.TransId
    ,OCRD where l.shortname = OCRD.cardcode and cardtype = 'c' and intrnmatch = '0'
    ORDER BY OCRD.CARDCODE, l.taxdate}
    Regards,
    Kamlesh

  • Query help required to link two fields

    Hi all,
    I have made an query as under :
    SELECT T2.Period, T0.dept, T0.empID, T0.firstName, T0.lastName, T1.U_ebasic, T1.U_ehra, T1.U_etrspt, T1.U_ecola, T1.U_emeins, T1.U_education, T1.U_grosssal,T1.U_totduc, T1.U_oadd, T1.U_netsal, T1.U_bank, T1.U_branch, T1.U_accno FROM OHEM T0 , [dbo].[@PAYROLL_PR_DETAIL]  T1, [dbo].[@PAYROLL_PROLL_HEAD]  T2 where t2.docentry=t1.docentry and t1.U_ecode=t0.empid
    Now I want that the Department Full NAME as mentioned in the Human Resource screen for that employee should come. Apart from it I also want to link a new field in this query user_code from OUSR table for each employee.
    Can you please help me to make this query.
    Regards,
    kamlesh

    Dear Gordon,
    After rectifiying the spelling mistake I used the following query as under
    SELECT T2.Period, T0.dept, T3.Name, T0.empID, T0.firstName, T0.lastName, T4.USER_CODE,T1.U_ebasic, T1.U_ehra, T1.U_etrspt, T1.U_ecola, T1.U_emeins, T1.U_education, T1.U_grosssal,T1.U_totduc, T1.U_oadd, T1.U_netsal, T1.U_bank, T1.U_branch, T1.U_accno
    FROM dbo.OHEM T0
    INNER JOIN dbo.OUDP T3 ON T3.Code = T0.dept
    INNER JOIN dbo.OUSR T4 ON T4.INTERNAL_K = T0.userId
    INNER JOIN dbo.@PAYROLL_PR_DETAIL T1 ON t1.U_ecode=t0.empid
    INNER JOIN dbo.@PAYROLL_PROLL_HEAD T2 ON t2.docentry=t1.docentry
    but now the syntax error is coming as - 'Incorrect syntax near '@PAYROLL_PR_DETAIL'
    (SEWSY) (s) could not be prepared
    Please guide.
    Regards,
    Kamlesh

  • Excise point of view Clarification required

    HI
    Once we delivered the goods to the Customer , some of the material are damaged in transporation
    I received the Customer compliant but we didn't take the return back those materials , just we are sending material with free of cost
    what sales document type i need to use ( SD or NL)
    is it required to Pay the Excise Duites & VATor CST because net value is ZERO but the goods are moving from plant(esciseable plant) to customer location
    and also Same as Sample we are sending to the customer
    please clarify my doubts in Excise point of vioew

    clarify my doubts in Excise point of vioew
    Whatever be the scenario, if any excisable material goes out of a manufacturing plant, the manufacturer is suppose to pay duty to the extent of quantity being sent.  This is excise law.  The same case for tax also.
    In fact, in excise, if you show the proof of taking back the goods to parent plant as rejections, then you can take the credit of duty paid.
    In SAP, you can consider any document type and depending upon the requirement, you can customize it.
    G. Lakshmipathi

  • Clarification required in File to DB scenario

    Hi all,
    I have a requirement to insert flat file records to a Oracle database.
    Few fields in the database are of type nchar/nvarchar.Is there any special transformation required in PI for these fields, as my records are not getting inserted into DB when i pass a char value for these.If i pass numbers for the same,the records are getting inserted.As of now the datatype of these fields in PI is string.
    Please guide me on this.
    Thanks,
    Sowmya

    Hi,
    I think data type should be same in DB & PI, meanwhile valiables sequence in PI should be same as DB sequence names.
    Find below link for more help on configuration
    /people/sap.user72/blog/2005/06/01/file-to-jdbc-adapter-using-sap-xi-30

  • Clarification required in Script Logic

    Hi All,
    I had written a Script logic which copies the data from one dimension member of entity to another entity.
    The script that we used is pasted here for reference:
    "//Logic for Revenue Transfer for one account to account
    *XDIM_MEMBERSET CATEGORY = BUDGET
    *XDIM_MEMBERSET P_ACCT = REV000003, REV000007, REV000008
    *XDIM_MEMBERSET P_ACTIVITY = P_ACTIVITY_NONE
    *XDIM_MEMBERSET P_DATASRC = U
    *XDIM_MEMBERSET ENTITY = U_RCL_INP, U_MFG_INP, U_FSI_INP, U_ECS_INP, U_KS_INP, U_INDIA_INP, U_BIZP_INP, U_SI_INP
    *XDIM_MEMBERSET INTCO = I_U_RCL, I_U_MFG, I_U_FSI, I_U_ECS, I_U_KS, I_U_INDIA, I_U_BIZP, I_U_SI
    //Revenue Transfer from P_ACCT REV000003 to P_ACCT REV000004
    *WHEN P_ACCT
    *IS "REV000003"
    *REC(FACTOR=1,P_ACCT=REV000004 ,INTCO=ENTITY.INTCO,ENTITY=INTCO.ENTITY)
    //Revenue Transfer from P_ACCT REV000007 to P_ACCT REV000012
    *IS "REV000007"
    *REC(FACTOR=1,P_ACCT=REV000012 ,INTCO=ENTITY.INTCO,ENTITY=INTCO.ENTITY)
    //Revenue Transfer from P_ACCT REV000008 to P_ACCT REV000009
    *IS "REV000008"
    *REC(FACTOR=1,P_ACCT=REV000009 ,INTCO=ENTITY.INTCO,ENTITY=INTCO.ENTITY)
    *ENDWHEN"
    The above script logic is not working if the user doesnt have access to the other entity to which data is copied into.
    However, as per our business requirement, we need to restrict the access to the users to thier respective entites.
    Hence, i would be glad to know, How can I overcome this limitation, or, how can I bypass the authorization through script logic??
    Let me know incase you require any further information about the issue.
    Thanks in Advance
    Regards,
    Chandra

    Hi Nilanjan,
    As Anurodh said, The command *IGNORE_SECURITY is not recognised in the BPC NW. I tried, but is not validated.
    Anurodh,
    Thanks for the link. Seems it is helpful.
    Regards,
    Chandra

  • Query form requires Logical operators and/or Quotes

    In ORACLE 9I Jdeveloper beta I used the BC4J JSP wizard to create a - Query Form. The query form looks nice and runs except I have to also include the logical operators (= > <) and Quotes. For example to query on the name Joe I have to enter it as ="JOE". If I use JOE it gives me a JSP error. The error message shows the generated Select statment with the where clause JOE but is missing the "=" and quotes.
    How do I hard code the "=" and quotes around strings so that the user doesn't have to?

    In ORACLE 9I Jdeveloper beta I used the BC4J JSP wizard to create a - Query Form. The query form looks nice and runs except I have to also include the logical operators (= > <) and Quotes. For example to query on the name Joe I have to enter it as ="JOE". If I use JOE it gives me a JSP error. The error message shows the generated Select statment with the where clause JOE but is missing the "=" and quotes.
    How do I hard code the "=" and quotes around strings so that the user doesn't have to?

  • Sql query result required ....

    SELECT A.BRAND BRAND,ROUND ((Leaf*100)/C.INVPERT,3) Leaf,'%',ROUND((Dust*100)/C.INVPERT,3) Dust,'%',
    ROUND((Fann)*100/C.INVPERT,3) Fann,'%',ROUND((TOT)*100/C.INVPERT,3) TOTAL,'%',
    ROUND((CTOT)*100/D.CUMUPER,3) PRVCUMU,'%'
    FROM
    SELECT BRAND,SUM (LEAF) Leaf,SUM (DUST) Dust,SUM(FANN) Fann,SUM(LEAF+DUST+FANN) TOT,
    SUM(LC) LC,SUM(DC) DC,SUM(FC) FC,SUM(LC+DC+FC) CTOT
    FROM
    SELECT DECODE(A.BRANDCD ,'WB','Wagh Bakri','WIS','Wagh Bakri',WTM','Wagh Bakri',
    'ML', 'Mili','02', 'Others','DL', 'Others','GM', 'Others',
    'GMD','Others','TQ', 'Others','WOD','Waghbakri-Organic[Dling]',
    'WOG','Waghbakri-Organic[Dling]','WOC','Waghbakri-Organic[Dling]',
    'NC', 'Navchetan','NG', 'Nilgiri 100gms Jar','MSC','Msc Leaf 100/250 Pouch') BRAND ,
    SUM(C.INVQTY) LEAF,0 DUST,0 FANN,0 LC,0 DC,0 FC
    FROM
    WB.WBPRODUCTDETAILS A,DSP.DSPINVA B,DSP.DSPINVB C
    WHERE A.COMPCODE = C.COMPCODE AND A.P_UNIQUEID = C.P_UNIQUEID AND
    B.COMPCODE = C.COMPCODE AND B.INVYEAR = C.INVYEAR AND
    B.FACTORYCODE = C.FACTORYCODE AND B.REFINV = C.REFINV AND B.INVNO =
    C.INVNO AND B.INVDATE = C.INVDATE AND B.PARTYCD <> 'A0101G0999' AND
    B.INVDATE ='&DT' AND A.VARIETY = 1 GROUP BY A.BRANDCD,A.VARIETY
    ----------- Second Query--------------------------------------
    (SELECT ROUND ((LPRV*100)/E.PRVPER,2) LPRV,'%',ROUND((DPRV*100)/E.PRVPER,2) DPRV,'%',
    ROUND((FPRV)*100/E.PRVPER,2) FPRV,'%',ROUND((PRV)*100/E.PRVPER,2) PRVTOT,'%',
    ROUND((CPRV)*100/E.PRVPER,2) CUMUTOT,'%'
    FROM
    SELECT BRAND,SUM (LF) LPRV,SUM (DF) DPRV,SUM(FF) FPRV,SUM(LF+DF+FF) PRV,
    SUM(LF+DF+FF) CPRV
    FROM
    SELECT A.BRANDCD BRAND,SUM(C.INVQTY) LF,0 DF,0 FF FROM
    WB.WBPRODUCTDETAILS A,DSP.DSPINVA B,DSP.DSPINVB C
    WHERE A.COMPCODE = C.COMPCODE AND A.P_UNIQUEID = C.P_UNIQUEID AND
    B.COMPCODE = C.COMPCODE AND B.INVYEAR = C.INVYEAR AND
    B.FACTORYCODE = C.FACTORYCODE AND B.REFINV = C.REFINV AND B.INVNO =
    C.INVNO AND B.INVDATE = C.INVDATE AND B.PARTYCD <> 'A0101G0999' AND
    B.INVDATE = TO_DATE('&DT')-1 AND A.VARIETY = 1 GROUP BY A.BRANDCD,A.VARIETY
    Ouput Like this
    ===============
    Brand Wise Sales in % For 31-MAY-07
    Variety Leaf Dust Fann Total Prev.Cumu
    Mili 6.54 % 0.64 % 0.65 % 7.84 % 14.00 %
    Navchetan 1.99 % 0.00 % 0.00 % 1.99 % 1.90 %
    Nilgiri 100gms Jar 0.00 % 0.00 % 0.00 % 0.00 % 0.00 %
    Others 1.64 % 0.00 % 0.00 % 1.64 % 0.73 %
    Wagh Bakri 58.86 % 16.45 % 13.21 % 88.53 % 83.36 %
    Waghbakri-Organic[Dling] 0.00 % 0.00 % 0.00 % 0.00 % 0.02 %
    ==============================================================
    Total-->in % 69.04 17.10 13.86 100.00 100.00 1st Query
    Prev.Day-->in % 72.04 12.11 21.86 100.00 100.00 2nd Query
    I am giving two queries half.
    How Can I do this ?
    Regards
    Vipul Patel

    put your query like his
    <pre>
    </pre>
    but instead of <> use [ ]

  • Sql query tuning required

    Dear Experts,
    I have a sql query which taking more than 2 hour of time ot execute.
    the explain plan is :
    PLAN_TABLE_OUTPUT
    Plan hash value: 2694368390
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
    | 0 | SELECT STATEMENT | | 1 | 379 | 44561 (1)| 00:08:55 |
    | 1 | INLIST ITERATOR | | | | | |
    | 2 | TABLE ACCESS BY INDEX ROWID | OPS_CITY_MAST | 2 | 30 | 5 (0)| 00:00:01 |
    |* 3 | INDEX UNIQUE SCAN | OPS_CITY_MAST_IDX_01 | 2 | | 3 (0)| 00:00:01 |
    | 4 | TABLE ACCESS BY INDEX ROWID | OPS_BR_MAST | 1 | 16 | 2 (0)| 00:00:01 |
    |* 5 | INDEX UNIQUE SCAN | OPS_BR_MAST_IDX_01 | 1 | | 1 (0)| 00:00:01 |
    | 6 | TABLE ACCESS BY INDEX ROWID | OPS_CHG_GROUP_AMT | 1 | 15 | 4 (0)| 00:00:01 |
    |* 7 | INDEX UNIQUE SCAN | OPS_CHG_GROUP_AMT_IDX_02 | 1 | | 3 (0)| 00:00:01 |
    | 8 | TABLE ACCESS BY INDEX ROWID | OPS_CHG_GROUP_AMT | 1 | 15 | 4 (0)| 00:00:01 |
    |* 9 | INDEX UNIQUE SCAN | OPS_CHG_GROUP_AMT_IDX_02 | 1 | | 3 (0)| 00:00:01 |
    | 10 | TABLE ACCESS BY INDEX ROWID | OPS_CHG_GROUP_AMT | 1 | 15 | 4 (0)| 00:00:01 |
    |* 11 | INDEX UNIQUE SCAN | OPS_CHG_GROUP_AMT_IDX_02 | 1 | | 3 (0)| 00:00:01 |
    | 12 | TABLE ACCESS BY INDEX ROWID | OPS_CHG_GROUP_AMT | 1 | 15 | 4 (0)| 00:00:01 |
    |* 13 | INDEX UNIQUE SCAN | OPS_CHG_GROUP_AMT_IDX_02 | 1 | | 3 (0)| 00:00:01 |
    | 14 | TABLE ACCESS BY INDEX ROWID | OPS_CHG_GROUP_AMT | 1 | 15 | 4 (0)| 00:00:01 |
    |* 15 | INDEX UNIQUE SCAN | OPS_CHG_GROUP_AMT_IDX_02 | 1 | | 3 (0)| 00:00:01 |
    | 16 | TABLE ACCESS BY INDEX ROWID | OPS_CHG_GROUP_AMT | 1 | 15 | 4 (0)| 00:00:01 |
    |* 17 | INDEX UNIQUE SCAN | OPS_CHG_GROUP_AMT_IDX_02 | 1 | | 3 (0)| 00:00:01 |
    | 18 | SORT GROUP BY NOSORT | | 1 | 31 | 10 (0)| 00:00:01 |
    | 19 | NESTED LOOPS | | | | | |
    | 20 | NESTED LOOPS | | 2 | 62 | 10 (0)| 00:00:01 |
    | 21 | TABLE ACCESS BY INDEX ROWID | OPS_UULT_WB_DTLS | 2 | 24 | 6 (0)| 00:00:01 |
    |* 22 | INDEX RANGE SCAN | OPS_UULT_WB_DTLS_IDX_03 | 2 | | 3 (0)| 00:00:01 |
    |* 23 | INDEX UNIQUE SCAN | OPS_UPD_ULT_IDX_01 | 1 | | 1 (0)| 00:00:01 |
    |* 24 | TABLE ACCESS BY INDEX ROWID | OPS_UPD_ULT | 1 | 19 | 2 (0)| 00:00:01 |
    | 25 | NESTED LOOPS | | | | | |
    | 26 | NESTED LOOPS | | 1 | 379 | 44561 (1)| 00:08:55 |
    | 27 | NESTED LOOPS | | 1 | 360 | 44559 (1)| 00:08:55 |
    | 28 | NESTED LOOPS | | 1 | 333 | 44558 (1)| 00:08:55 |
    | 29 | NESTED LOOPS | | 1 | 312 | 44557 (1)| 00:08:55 |
    | 30 | NESTED LOOPS | | 1 | 302 | 44555 (1)| 00:08:55 |
    | 31 | NESTED LOOPS | | 1 | 281 | 44553 (1)| 00:08:55 |
    |* 32 | HASH JOIN | | 4383 | 1112K| 35779 (2)| 00:07:10 |
    |* 33 | HASH JOIN RIGHT OUTER | | 4383 | 1070K| 34631 (2)| 00:06:56 |
    | 34 | TABLE ACCESS FULL | OPS_CUST_CNTR | 7270 | 94510 | 68 (0)| 00:00:01 |
    |* 35 | HASH JOIN | | 4383 | 1014K| 34562 (2)| 00:06:55 |
    | 36 | NESTED LOOPS OUTER | | 4414 | 875K| 33135 (2)| 00:06:38 |
    |* 37 | HASH JOIN | | 4414 | 827K| 32963 (2)| 00:06:36 |
    | 38 | TABLE ACCESS FULL | OPS_ST_UN_MAST | 36 | 504 | 3 (0)| 00:00:01 |
    |* 39 | HASH JOIN | | 4414 | 767K| 32959 (2)| 00:06:36 |
    |* 40 | HASH JOIN | | 4414 | 543K| 28417 (2)| 00:05:41 |
    | 41 | NESTED LOOPS | | | | | |
    | 42 | NESTED LOOPS | | 4414 | 495K| 26483 (2)| 00:05:18 |
    |* 43 | HASH JOIN | | 4949 | 483K| 16641 (2)| 00:03:20 |
    |* 44 | TABLE ACCESS BY INDEX ROWID| OPS_WAYBL | 4423 | 367K| 2292 (1)| 00:00:28 |
    |* 45 | INDEX RANGE SCAN | OPS_WAYBL_IDX_11 | 5050 | | 16 (0)| 00:00:01 |
    | 46 | TABLE ACCESS FULL | OPS_PULTD_WB_DTLS | 4474K| 64M| 14298 (2)| 00:02:52 |
    |* 47 | INDEX UNIQUE SCAN | OPS_TS_RECONSILE_IDX_02 | 1 | | 1 (0)| 00:00:01 |
    |* 48 | TABLE ACCESS BY INDEX ROWID | OPS_TS_RECONSILE | 1 | 15 | 2 (0)| 00:00:01 |
    | 49 | TABLE ACCESS FULL | OPS_CC_CORCEE_ADDR | 998K| 10M| 1922 (2)| 00:00:24 |
    | 50 | TABLE ACCESS FULL | OPS_ADDR_MAST | 1006K| 49M| 4531 (1)| 00:00:55 |
    | 51 | TABLE ACCESS BY INDEX ROWID | OPS_WB_DOD_DTLS | 1 | 11 | 1 (0)| 00:00:01 |
    |* 52 | INDEX UNIQUE SCAN | OPS_WB_DOD_DTLS_IDX_02 | 1 | | 0 (0)| 00:00:01 |
    | 53 | TABLE ACCESS FULL | OPS_TRIP_SHT | 423K| 13M| 1422 (2)| 00:00:18 |
    | 54 | TABLE ACCESS FULL | OPS_PROV_LT_DLVRY | 446K| 4361K| 1142 (2)| 00:00:14 |
    | 55 | TABLE ACCESS BY INDEX ROWID | OPS_PLTD_WB_DTLS | 1 | 21 | 2 (0)| 00:00:01 |
    |* 56 | INDEX UNIQUE SCAN | OPS_PLTD_WB_DTLS_IDX_04 | 1 | | 1 (0)| 00:00:01 |
    | 57 | TABLE ACCESS BY INDEX ROWID | OPS_ULTD_WB_DTLS | 1 | 21 | 2 (0)| 00:00:01 |
    |* 58 | INDEX UNIQUE SCAN | OPS_ULTD_WB_DTLS_IDX_02 | 1 | | 1 (0)| 00:00:01 |
    |* 59 | TABLE ACCESS BY INDEX ROWID | OPS_UPD_LT_DLVRY | 1 | 10 | 2 (0)| 00:00:01 |
    |* 60 | INDEX UNIQUE SCAN | OPS_UPD_LT_DLVRY_IDX_01 | 1 | | 1 (0)| 00:00:01 |
    | 61 | TABLE ACCESS BY INDEX ROWID | OPS_TRPT_VHLS | 1 | 21 | 1 (0)| 00:00:01 |
    |* 62 | INDEX UNIQUE SCAN | OPS_TRPT_VHLS_IDX_01 | 1 | | 0 (0)| 00:00:01 |
    | 63 | TABLE ACCESS BY INDEX ROWID | PO_VENDORS | 1 | 27 | 1 (0)| 00:00:01 |
    |* 64 | INDEX UNIQUE SCAN | VENDOR_UNIQUE | 1 | | 0 (0)| 00:00:01 |
    |* 65 | INDEX UNIQUE SCAN | OPS_GATE_PASS_IDX_01 | 1 | | 1 (0)| 00:00:01 |
    |* 66 | TABLE ACCESS BY INDEX ROWID | OPS_GATE_PASS | 1 | 19 | 2 (0)| 00:00:01 |
    Predicate Information (identified by operation id):
    3 - access("OCM"."ID"=:B1 OR "OCM"."ID"=:B2)
    5 - access("OBM"."ID"=:B1)
    7 - access("CGA"."DOC_TYPE"='WB' AND "CGA"."DOC_ID"=:B1 AND "CGA"."CHG_GROUP_ID"=6)
    9 - access("CGA"."DOC_TYPE"='WB' AND "CGA"."DOC_ID"=:B1 AND "CGA"."CHG_GROUP_ID"=7)
    11 - access("CGA"."DOC_TYPE"='GP' AND "CGA"."DOC_ID"=:B1 AND "CGA"."CHG_GROUP_ID"=15)
    13 - access("CGA"."DOC_TYPE"='GP' AND "CGA"."DOC_ID"=:B1 AND "CGA"."CHG_GROUP_ID"=16)
    15 - access("CGA"."DOC_TYPE"='GP' AND "CGA"."DOC_ID"=:B1 AND "CGA"."CHG_GROUP_ID"=17)
    17 - access("CGA"."DOC_TYPE"='GP' AND "CGA"."DOC_ID"=:B1 AND "CGA"."CHG_GROUP_ID"=23)
    22 - access("DT"."WAYBL_ID"=:B1)
    23 - access("ULT"."ID"="DT"."UPD_ULT_ID")
    24 - filter("ULT"."FROM_BR_MAST_ID"=:B1)
    32 - access("OPL"."ID"="TS"."PROV_LT_DLVRY_ID")
    33 - access("CNTR"."ID"(+)="SYS_ALIAS_10"."CUST_CNTR_ID")
    35 - access("TSREC"."TRIP_SHT_ID"="TS"."ID")
    37 - access("ST"."ID"="AD"."ST_UN_MAST_ID")
    39 - access("AD"."ID"="CCADD"."ADDR_MAST_ID")
    40 - access("CCADD"."ID"="SYS_ALIAS_10"."CC_CEE_ADDR_ID")
    43 - access("SYS_ALIAS_10"."ID"="DTL"."WAYBL_ID")
    44 - filter("SYS_ALIAS_10"."GL_TRFD" IS NULL OR "SYS_ALIAS_10"."GL_TRFD"='Y')
    45 - access(TRUNC(INTERNAL_FUNCTION("FIRST_DLVRY_DT"))=TO_DATE(' 2011-08-15 00:00:00', 'syyyy-mm-dd
    hh24:mi:ss'))
    47 - access("DTL"."ID"="TSREC"."PULTD_WB_DTLS_ID")
    48 - filter("TSREC"."STATUS_LID"=157)
    52 - access("SYS_ALIAS_10"."ID"="OWD"."WAYBL_ID"(+))
    56 - access("LTDTL"."PROV_LT_DLVRY_ID"="OPL"."ID" AND "LTDTL"."WAYBL_ID"="DTL"."WAYBL_ID")
    58 - access("ULTDTL"."PLTD_WB_DTLS_ID"="LTDTL"."ID")
    59 - filter("UPLT"."PROV_LT_DLVRY_ID"="OPL"."ID")
    60 - access("ULTDTL"."UPD_LT_DLVRY_ID"="UPLT"."ID")
    62 - access("OTV"."ID"="OPL"."TRPT_VHLS_ID")
    64 - access("PO"."VENDOR_ID"="OTV"."VENDOR_ID")
    65 - access("SYS_ALIAS_9"."ID"="ULTDTL"."GATE_PASS_ID")
    66 - filter("SYS_ALIAS_9"."GL_TRFD" IS NULL OR "SYS_ALIAS_9"."GL_TRFD"='Y')
    so, please help me.
    Regards,
    Viveka Nand
    Edited by: 891502 on Oct 14, 2011 4:39 AM

    891502 wrote:
    now am putted in the correct format,In the link it tells you to provide the query. Which you have not done.
    It tells you how to format the plan. Which you have not done.
    It tells you to provide database version and optimizer parameters. Which you have not done.
    It tells you to provide autotrace statistics and trace output. Which you have not done.
    So in what way is this format correct ?
    so, please give me the way to resolved it.With the information you have provided we can say with certainty that if you write your query this way it will be fast.
    select null from dual;

Maybe you are looking for

  • I have acp medicine cd. I copied it to hard disk. Now used start.htm to launch the webpage based application.table of contents is not loading, search not workin

    acp medicine cd is version 2006. I have java 7 update 45. Java Plug-in 10.45.2.18 Using JRE version 1.7.0_45-b18 Java HotSpot(TM) Client VM User home directory = C:\Users\Admin.lt01 c: clear console window f: finalize objects on finalization queue g:

  • IDVD ver 4.0.1 video freeze

    problem with the DVD - Besides the DVD requiring 2 days to "burn" the finished DVD freezes about 2/3 through the video. The audio continues, but the video remains frozen on the same image. Mac 10.4.2; 512 MB DDR SDRAM; Processor Dual 1.42 GHz PowerPC

  • Movement type specific to Order Type

    HI I have created new movement type Z01 instead of 101 and I want to use this Z01 for specific order type and for Others system should take into account standard 101 movement. I have checked movement type setting in PP but it client level setting and

  • IS QT Pro for me

    Hi I work in FCE4 with footage from a Sony camcorder that is AVCHD. I use easy set up Codec 1080i60. I export to Qucktime for use with idvd for making movies. The quality is ok but not as great as it could be. If I upgrade to QT Pro, will I be a ble

  • Unable to open any PDF using the Reader

    I downloaded a free trial version of Acrobat Pro, which after the tiral period requried a $19.?? monthly fee.  I decided not to buy.  Did not serve my purpose.  When the trial period ended my Reader no longer works.  I tried to download the reader ag