Need help in PO Approval Group Query

Hi,
I need a Query which will list of users that has the Approval Group “BUYER” and “BUYER_DEMO” assigned to them.
It will be needful if anyone provides me the Query
Thanks and Regards

Hi
Try this.
SELECT PAPF.employee_number
,PAPF.full_name
FROM po_control_groups_all PCGA
,po_position_controls_all PPCA
,per_all_assignments_f PAAF
,per_all_people_f PAPF
WHERE PCGA.control_group_name IN ('BUYER','BUYER_DEMO')
AND PCGA.control_group_id = PPCA.control_group_id
AND PPCA.position_id = PAAF.position_id
AND PAAF.person_id = PAPF.person_id
Thanks and Regards,
JD

Similar Messages

  • NEED HELP IN MATRIX WITH GROUP REPORT

    Dear All,
    I need small help in MATRIX WITH GROUP REPORT In Report Builder Test Report
    In my report, having periods as rows and location as columns as shown below,
    1) LOC-A
    JAN-10 FEB-10
    ITEM-GROUP -1 1 2
    ITEM-GROUP-2 3 4
    ITEM-GROUP 3 5 6
    2) LOC- B
    MAR-10 APR-10
    ITEM-GROUP -1 7 8
    ITEM-GROUP-2 9 10
    ITEM-GROUP-3 11 12
    But comming to my requirement, the periods should be in fix in matrix as shown below
    1) JAN-10 FEB-10 MAR-10 APR-10
    LOC-A
    ITEM-GROUP -1 1 2
    ITEM-GROUP-2 3 4
    ITEM-GROUP 3 5 6
    LOC- B
    ITEM-GROUP -1 0 0 7 8
    ITEM-GROUP-2 0 0 9 10
    ITEM-GROUP-3 0 0 11 12
    I am unable to get this kind of output format
    Please kindly waiting for reply from our team....
    Regards
    krishna.P

    For the periods, create a seperate dummy query and then use it as column group in the multi query matrix.

  • Need help in rewriting a sql query

    Can any one please tell me if there is any utility that can help me correcting the sql I have I need to tune the query as its taking lot of time. I want to use some tool that will help me re-formating the query.
    Any help in this regard will be highly appreciated.

    If you think that Oracle SQL Tuning Tools like SQL Tuning Advisor and SQL Access Advisor are not helping.
    You might look into thrid party tools like Quest- SQL Navigator and TOAD.
    But I don't advise this based on the following:
    Re: Oracle Third Party Tools and Oracle Database
    Oracle have enough tools of its own to satisfy the various needs.
    Adith

  • Need help inLOV's in AF Query

    Hi,
    I need help in adding LOV's in AF Query. Please do the need full.
    Regards,

    Hi all,
    My issue was resolved i have followed the link"http://andrejusb.blogspot.com/2008/11/adf-query-component-and-view-criteria.html"
    Regards,

  • Need help to re-format the query

    Hi All,
    Could any one please help me to rewrite this query or explain me how to do it as it is taking 20 mins to execute....
    SELECT
    AC.ACC_NO||DECODE(MI.MSG_CLASS,'ROF',(SELECT LMI2.PAYMENT_SET      
                                       FROM
            MIF LMI2 WHERE LMI2.MID =
            (SELECT CHILDMID FROM MFAMILY WHERE PARENTMID= MI.MID AND RELATION='ROF')),MI.PAYMENT_SET)||
            DECODE(MI.MSG_CLASS,'ROF', (SELECT LMI2.SERVICE FROM MIF LMI2 WHERE LMI2.MID = (SELECT CHILDMID FROM
      MFAMILY WHERE PARENTMID=MI.MID AND RELATION='ROF')),MI.SERVICE) HASH_KEY,
      MI.MID ,
      DECODE(MI.MSG_CLASS,'ROF',(SELECT LMI2.PAYMENT_SET FROM MIF LMI2
      WHERE LMI2.MID = (SELECT CHILDMID FROM MFAMILY WHERE PARENTMID=MI.MID AND
      RELATION='ROF')),MI.PAYMENT_SET) PAYMENT_SET,
      MI.AMOUNT,
      NVL(DECODE(MI.MSG_CLASS,'ROF',MI.CRAMOUNT, MI.DBAMOUNT) ,0) AMT,
      AC.ACC_NO,
      DECODE(MI.MSG_CLASS,'ROF',(SELECT LMI2.BATCH_COMPANY_CD FROM MIF LMI2 WHERE
      LMI2.MID = (SELECT CHILDMID FROM MFAMILY WHERE PARENTMID=MI.MID AND
      RELATION='ROF')),MI.BATCH_COMPANY_CD) BATCHCOMP,
      AC.ACC_ALIAS, NVL(AC.IBAN,
      NVL(AC.ACC_ALIAS,AC.ACC_NO)) IBAN_ACCNO,
      AC.CURRENCY , AC.ACCOUNTNAME ,
      CASE
           WHEN (SIGN(MI.PROCESS_DT - TO_DATE(:B2 ,'YYYYMMDD'))) = '1'
           THEN 'F'
           ELSE 'C' END FUTURE_IND,
           (CASE
                WHEN (MI.MSG_STATUS = 'CANCELED' OR   MI.STATBFHELD = 'CANCELED')
                THEN 'C'
                WHEN MI.BATCH_PAYMENT_TP = 'RMTRT'
                THEN 'R'
                WHEN (MI.REJECT_RETURN='REJT' OR MI.MSG_CLASS = 'ROF' OR MI.MSG_STATUS = 'REJECTED')
                THEN 'A'
                WHEN (MI.REJECT_RETURN='RETN' OR (MI.BATCH_PAYMENT_TP='RTACH' AND MSG_CLASS='ROF'))
                THEN 'B'
                WHEN  MI.MSG_STATUS='FORWARD_PROCESSING'
                THEN 'F'
                WHEN (MI.MSG_STATUS NOT IN  ('COMPLETE','CANCELED','REJECTED') OR (MI.MSG_STATUS='AGED' AND
                     MI.STATBFHELD NOT IN ('COMPLETE','CANCELED','REJECTED')) )
                THEN 'U'
                WHEN  MI.PROCESS_DT = TO_DATE(:B2 ,'YYYYMMDD')
                THEN 'P' END)
      PAY_STATUS,
      MT.DB_FEE_ACCOUNT_CCY,
      (SELECT MESSAGEFREETEXT.CONTENTS
           FROM
           MESSAGEFREETEXT
           WHERE
                FIELDNAME ='MANDATEREFERENCE'
                     AND MESSAGEFREETEXT.MID= MI.MID) MANDREF,
      (SELECT MESSAGEFREETEXT.CONTENTS
           FROM MESSAGEFREETEXT
           WHERE FIELDNAME ='DIRECT_DEBIT_REFERENCE' AND MESSAGEFREETEXT.MID=MI.MID)  DDREF,
      MT.CUSTOMER_BATCH_REFERENCE LOCINFO,
      (SELECT  MESSAGEFREETEXT.CONTENTS
           FROM MESSAGEFREETEXT WHERE FIELDNAME =  'SECOND_PARTY_ID' AND MESSAGEFREETEXT.MID=MI.MID) SECPRTYINF,
      (SELECT  MESSAGEFREETEXT.CONTENTS
           FROM MESSAGEFREETEXT WHERE FIELDNAME = 'HUB_PAY_PROD_TYP' AND MESSAGEFREETEXT.MID=MI.MID) PAYPRODTYP,
      DECODE(MI.MSG_CLASS,'ROF',(SELECT LMI2.CHANNEL_REFERENCE FROM MIF LMI2
                          WHERE LMI2.MID = (SELECT CHILDMID FROM MFAMILY WHERE PARENTMID=MI.MID AND
                                         RELATION='ROF')),MI.CHANNEL_REFERENCE) CHNREF,
      (SELECT  MESSAGEFREETEXT.CONTENTS
           FROM MESSAGEFREETEXT
           WHERE FIELDNAME =  'CHN_BATCH_REF' AND MESSAGEFREETEXT.MID=MI.MID) CHNBATREF,
      TO_CHAR(DECODE(MI.MSG_CLASS,'ROF',(SELECT LMI2.VALUE_DATE FROM MIF LMI2
                     WHERE LMI2.MID = (SELECT CHILDMID FROM MFAMILY WHERE PARENTMID=MI.MID AND
                                    RELATION='ROF')),MI.VALUE_DATE),'DD/MM/YYYY') VALUEDT,
      DECODE(MI.MSG_CLASS,'ROF',(SELECT LMI2.ORIG_REFERENCE FROM MIF LMI2 WHERE LMI2.MID = (SELECT
                          CHILDMID FROM MFAMILY WHERE PARENTMID=MI.MID AND RELATION='ROF')),
                                                        MI.ORIG_REFERENCE) ORIGREF,
      CASE
           WHEN (MI.OFFICE <> MI.ORIG_OFFICE)
           THEN MT.DR_SIDE_RATE_AM
           ELSE
                CASE
                     WHEN MI.DBCURRENCY = MI.CRCURRENCY
                     THEN
                          CASE
                               WHEN MI.CRCURRENCY = :B4
                               THEN MT.DR_RATE ELSE MT.CR_RATE
                          END
                     ELSE
                          CASE
                               WHEN   MI.CRCURRENCY = :B4
                               THEN MT.DR_RATE ELSE MT.CR_RATE
                          END
                END
           END EXCHRT,
      MT.BBK_ADDR1,
      MT.BBK_ADDR2,
      MT.BBK_ADDR3 ,
      MT.BBK ,
      MT.BNF_ADDR1,
      MT.BNF_ADDR2,
      MT.BNF_ADDR3,
      MT.BNF_ADDR4 ,
      MT.BNF ,
      DECODE(MT.BNF_IDCODE,'AC',MT.BNF_ID,' ') ORGBNFID,
      DECODE(NVL(MI.ORIG_INSTRUCT_AMOUNT,0),0, MI.ORIG_AMOUNT) ORGINSTAMT,
      NVL(TRIM(MI.ORIG_INSTRUCT_CURRENCY),  MI.ORIG_CURRENCY) ORGINSTCUR,
      CASE
           WHEN MOP LIKE 'DRFT%'
           THEN 'DD'
           WHEN MOP   LIKE 'CHEQ%'
           THEN 'CO'
           WHEN MOP LIKE 'SWIFT'
           THEN 'TT'
           WHEN MOP LIKE 'DDP%'
           THEN 'T'
           WHEN MOP LIKE 'BOOK'
           THEN 'T' ELSE 'LP'
      END PYMTTP,
      MT.OBI ,
      TO_CHAR(MI.PROCESS_DT,'YYYYMMDD') PROCESSDT,
      MI.REFERENCE,
      MT.BBK_BIC,
      MT.BBK_IDCODE,
      DECODE(MT.BBK_IDCODE,'AC',' ',SUBSTR(MT.BBK_ID,1,12)) BBKID,
      MI.LOCAL_REF,
      MI.CURRENCY INDCURR,
      MI.MSG_STATUS,
      MI.PK_BATCH_SUBSET,
      TO_CHAR(SBBATCH.PROCESS_DT,'YYYYMMDD') SBPROCESSDT,
      DECODE(MI.MSG_CLASS,'ROF',MI.CRCURRENCY, MI.DBCURRENCY) DBCURR,
      MI.ORIG_REFERENCE ORIGREFRET
      FROM
           MIF MI,
           MTF1000 MT,
           ACCOUNTS AC,
           (     SELECT
                     MF.PK_BATCH_SUBSET,
                     MF.PROCESS_DT,
                     MTF.ORG_ID,
                     MTF.MP_CR_ACC,
                     MTF.CR_ACC_NO
                FROM
                     MIF MF,
                     MTF1000
                     MTF
                WHERE
                     ((MSG_STATUS IN ('COMPLETE','CANCELED','REJECTED')) OR
                     (MSG_STATUS = 'AGED' AND STATBFHELD IN ('COMPLETE','CANCELED','REJECTED')))
                AND
                     BATCH_MSG_TP = 'S' AND MF.MID = MTF.MID )
           SBBATCH
      WHERE
           MI.MSG_TYPE =   :B3
      AND MI.PROCESS_DT = TO_DATE(:B2 ,'YYYYMMDD')
      AND MI.BATCH_MSG_TP = 'I'
      AND DECODE(MI.MSG_CLASS,'ROF',
           (SELECT LMI2.SERVICE FROM MIF LMI2 WHERE LMI2.MID =
           (SELECT CHILDMID FROM MFAMILY WHERE PARENTMID=MI.MID AND RELATION='ROF')),MI.SERVICE)
           IN ('NET','HCN','BIB','LST','MRI')
      AND MI.PK_BATCH_EXCH IN (SELECT PK_BATCH_EXCH FROM BATCH_EXCH)
      AND MI.MID = MT.MID
      AND SBBATCH.PK_BATCH_SUBSET = MI.PK_BATCH_SUBSET
      AND TRIM(DECODE(MI.MSG_CLASS,'ROF',MT.CR_ACC_NO, NVL(MT.ORG_ID,NVL(MT.MP_DB_ACC,MT.ACC_NO))) )=AC.ACC_NO
      AND AC.OFFICE = :B1
      ORDER BY HASH_KEY,PAY_STATUS

    Hi,
    please try this.
    The first decode or at least part of it repeats at least 7 times.
         DECODE(MI.MSG_CLASS,'ROF',
                                         (SELECT LMI2.PAYMENT_SET  
                                    FROM MIF LMI2 WHERE LMI2.MID =
          (SELECT CHILDMID FROM MFAMILY WHERE PARENTMID=MI.MID AND RELATION='ROF')
                                            ),MI.PAYMENT_SET
                   ||
        DECODE(MI.MSG_CLASS,'ROF',
                                         (SELECT LMI2.SERVICE
                                                                                 FROM MIF LMI2 WHERE LMI2.MID =
                   (SELECT CHILDMID FROM MFAMILY WHERE PARENTMID=MI.MID AND RELATION='ROF')
                                             ),MI.SERVICE) HASH_KEY,
    is similar to this
    select mif.* from mif, mfamily where mif.mid=mfamily.childmid
    and relation = 'ROF' and msg_class='ROF'
    insert it as an inline view and add a conditition
    from ...
    (select mif.* from mif, mfamily where mif.mid=mfamily.childmid
    and relation = 'ROF' and msg_class='ROF') rof
    Where ...
    and mi.mid=Rof.mid (+)...
    and your code above would look like
    nvl(rof.payment_set,mi.payment_set) || nvl(rof.service,mi.service) HASH_KEY,
    nvl(rof.payment_set,mi.payment_set) PAYMENT_SET
    replace all the same decode above with corresponding nvl(...)Hope this helps.

  • Need help on Regular expression and query

    Hi Guru's, Hope you all are doing great!.
    I have a scenario's where i need do insert the data into table.
    I have three scenarios :
    select 'Kodali,Raj,S' str from dual
    union
    select 'Alex Romano' from dual
    union
    select 'ppppp' from dual
    Alex Romano
    Kodali,Raj,S
    pppppNow what i want is .
    1. Alex Romano
    if there is space between the string then i want to insert into first name and last name columns
    2. Kodali,Raj,S
    if its a comma between the string then i want to insert into last name , first name and middle name
    3. if there is only one string then same insert into first name and last name.
    I wrote the query earlier to handle only comma and now i am trying but not able to use this all scenarios
    Can you please help me out.
    WITH t AS (
    select 'Kodali,Raj,S' str from dual
    union
    select 'Alex Romano' from dual
    union
    select 'ppppp' from dual
    select DECODE(trim(a),NULL,'a',trim(a)),DECODE(trim(b),NULL,'b',trim(b)),decode(trim(c),NULL,'c' ,trim(c))
    from
      SELECT max(decode(level,1,regexp_substr(str,'[^,]+',1,level))) a --INTO lFNAME
              , max(decode(level,2,regexp_substr(str,'[^,]+',1,level))) b --INTO lLNAME
              , max(decode(level,3,regexp_substr(str,'[^,]+',1,level))) c --INTO lMNAME      
       FROM   t
      CONNECT BY regexp_substr(str,'[^,]+',1,level) IS NOT NULL
      GROUP BY str
    ) ;Currently i am putting a b and c if its null.
    Thanks in advance!

    user590978 wrote:
    Hi Guru's, Hope you all are doing great!.
    I have a scenario's where i need do insert the data into table.
    I have three scenarios :
    select 'Kodali,Raj,S' str from dual
    union
    select 'Alex Romano' from dual
    union
    select 'ppppp' from dual
    Alex Romano
    Kodali,Raj,S
    pppppNow what i want is .
    1. Alex Romano
    if there is space between the string then i want to insert into first name and last name columns
    2. Kodali,Raj,S
    if its a comma between the string then i want to insert into last name , first name and middle name
    3. if there is only one string then same insert into first name and last name.
    I wrote the query earlier to handle only comma and now i am trying but not able to use this all scenarios
    Can you please help me out.
    WITH t AS (
    select 'Kodali,Raj,S' str from dual
    union
    select 'Alex Romano' from dual
    union
    select 'ppppp' from dual
    select DECODE(trim(a),NULL,'a',trim(a)),DECODE(trim(b),NULL,'b',trim(b)),decode(trim(c),NULL,'c' ,trim(c))
    from
    SELECT max(decode(level,1,regexp_substr(str,'[^,]+',1,level))) a --INTO lFNAME
    , max(decode(level,2,regexp_substr(str,'[^,]+',1,level))) b --INTO lLNAME
    , max(decode(level,3,regexp_substr(str,'[^,]+',1,level))) c --INTO lMNAME      
    FROM   t
    CONNECT BY regexp_substr(str,'[^,]+',1,level) IS NOT NULL
    GROUP BY str
    ) ;Currently i am putting a b and c if its null.
    Thanks in advance!It's never a popular suggestion, but why not fix the design to begin with?
    It's the year 2013, can a client not pass you a "complex" data structure consisting of first, middle and last name?
    Why rely on an unreliable construct when there are so many more usable way to achieve this?
    Cheers,

  • Need help in writing a select query to pull required data from 3 tables.

    Hi,
    I have three tables EmpIDs,EmpRoles and LatestRoles. I need to write a select Query to get roles of all employees present in EmpIDs table by referring EmpRoles and LatestRoles.
    The condition is first look into table EmpRoles and if it has more than one entry for a particular Employee ID than only need to get the Role from LatestRoles other wise consider
    the role from EmpRoles .
    Sample Script:
    Create Table #EmpIDs
    (EmplID int )
    Create Table #EmpRoles
    (EMPID int,Designation varchar(50))
    Create Table #LatestRoles
    EmpID int,
    Designation varchar(50)
    Insert into #EmpIDs values (1),(2),(3)
    Insert into #EmpRoles values (1,'Role1'),(2,'Role1'),(2,'Role2'),(3,'Role1')
    Insert into #LatestRoles values (2,'Role2')
    Employee ID 2 is having two roles defined in EmpRoles so for EmpID 2 need to fetch Role from LatestRoles table and for
    remaining ID's need to fetch from EmpRoles .
    My Final Output of select query should be like below.
    EmpID Role
    1 Role1
    2 Role2
    3 Role1
    Please help.
    Mohan

    Mohan,
    Can you check if this answers your requirement:
    Create Table #EmpIDs
    (EmplID int )
    Create Table #EmpRoles
    (EMPID int,Designation varchar(50))
    Create Table #LatestRoles
    EmpID int,
    Designation varchar(50)
    Insert into #EmpIDs values (1)
    Insert into #EmpIDs values (2)
    Insert into #EmpIDs values (3)
    Insert into #EmpRoles values (1,'Role1')
    Insert into #EmpRoles values (2,'Role2')
    Insert into #EmpRoles values (2,'Role1')
    Insert into #EmpRoles values (3,'Role1')
    Insert into #LatestRoles values (2,'Role2')
    --Method 1
    select e.EmplID,MIN(ISNULL(l.Designation,r.Designation)) as Designation
    from #empids e
    left join #emproles r on e.emplID=r.EmpID
    left join #latestRoles l on e.emplID=l.EmpID
    group by e.EmplID
    --Method 2
    ;with cte
    as
    select distinct e.EmplID,r.Designation,count(*) over(partition by e.emplID) cnt
    from #empids e
    left join #emproles r on e.emplID=r.EmpID
    select emplID,Designation
    from cte
    where cnt=1
    UNION ALL
    select a.EmplID,l.Designation
    from
    (select distinct EmplID from cte where cnt>1) a
    join #Latestroles l on a.EmplID=l.EmpID
    order by emplID
    Thanks,
    Jay
    <If the post was helpful mark as 'Helpful' and if the post answered your query, mark as 'Answered'>

  • Need help with division within a query

    Hello all~
    I am trying to divide these two columns to get a % of case numbers involving an accident. Im pretty sure you need to use decode to avoid the divide by 0 error but not sure how to implement this within my query. When i run this query below, it gives me the result of "1", which is not correct. Can someone help me please?
    Oracle Version 10g
    ACCIDENT is a datatype VARCHAR
    CASE_NUMBER is a datatype VARCHAR
    select to_char(count(ACCIDENT),'999,999,999') as "ACCIDENT",
    to_char(COUNT(CASE_NUMBER),'999,999,999')as "CASE NUMBER",
    round(ratio_to_report(count(accident))
    OVER()*100,2)as "%"
    from      "PURSUIT"
    WHERE ACCIDENT = 'Y'
    AND
    (:P1_BEG_DATE IS NULL AND :P1_END_DATE IS NULL
    OR
    pursuit_date BETWEEN to_date(:p1_beg_date,'MM/DD/YYYY') and to_date
    (:p1_end_date,'MM/DD/YYYY'))
    AND(:P1_TROOP=pursuit.officer_troop OR :p1_troop IS NULL) 
    AND(:P1_RADIO=pursuit.officer_radio OR :p1_radio IS NULL)
    group by case_numberThanks
    Deanna

    Are you sure that the ANDs and ORs in your WHERE clause will take precedence properly?
    Also, if you always select only cases where there has been an accident, what percentage would you like to display? Surely in this case the percentage of cases involving in accident in cases where there was an accident.. is 100%?
    as a simpler example
    SELECT
      accident,
      ROUND(RATIO_TO_REPORT(count(*)) OVER() * 100)
    FROM
      pursuit
    GROUP BY
      accidentHere's a trick to neaten up those IS NULLs:
    SELECT
      accident,
      ROUND(RATIO_TO_REPORT(count(*)) OVER() * 100)
    FROM
      pursuit
    WHERE
      pursuit_date >= COALESCE(:p1_beg_date, pursuit_date) AND
      pursuit_date <= COALESCE(:p1_end_date, pursuit_date) AND
      officer_troop LIKE :p1_troop AND
      offcier_radio LIKE :p1_radio
    GROUP BY
      accidentTo wildcard a date, simply pass NULL in; the coalesce will replace the null with the pursuit_date from the record (thus the >= and <= becomes true)
    To wildcard the troop or the radio, simply pass a '%' symbol as the value of the parameter. If the front end code is already set up to pass nulls, use the COALESCE trick above

  • Help with poplist record group query

    Hi, I want to populate a poplist based on the following query:
    SELECT value
    FROM table.value
    WHERE code_parent IS NULL
    UNION ALL
    SELECT 'ALL'
    FROM dual
    ORDER
    BY code
    Now I know that you need 2 columns in the record group to populate a poplist, but I cannot seem to modify the query to have 2 columns. I am basically adding the 'ALL' value, which will have a label of 'ALL' and a value of 'ALL'.
    The first select I can easily modify to be an acceptable record group for a dynamic poplist, Its the union that im having problems with. The following select does not work. Help would be appreciated.
    SELECT table.value, table.value
    FROM table.value
    WHERE code_parent IS NULL
    UNION ALL
    SELECT 'ALL', 'ALL'
    FROM dual
    ORDER
    BY table.value

    Based on the error I'd guess that one of your columns are defined as a number and the union columns are both varchar2. Match the datatype with the column it corresponds to:
    UNION
    SELECT 'ALL', 0
    FROM DUAL
    ORDER BY 1
    The order by clause also needs to reference the column number instead of the column name since the union clause does not have a column name.

  • Need help in Report From SQL Query

    Hi All,
    I am facing a problem with a report. I need your help.
    I am creating a Report From SQL Query (Portal) with some arguments passed at runtime. I am able to view the output, if the query returns few rows ( arount 1000 rows). But for some inputs it needs to generate >15000 records, at this point the page is getting time out (i think!) and showing error page. I am able to execute query from the SQL Plus console ot using TOAD editor. Here the query is not taking more that 2 mins time to show the result.
    If i am executing from Portal i observed that, once i give the appropriate input and hit submit button a new oracle process is getting created for the query on UNIX (I am usign "TOP" command to check processes). The browser page will be shown error page after 5 minutes (i am assuming session time out!) , but on the backend the process will be executed for more than 30 mins.
    I tried also increase the page time out in httpd.conf, but no use.
    The data returned as a result of the query is sized more than 10 MB. Is caching this much data is possible by the browser page? is the returned data is creating any problem here.
    Please help me to find appropriate reasone for the failure?

    user602513 wrote:
    Hi All,
    I am facing a problem with a report. I need your help.
    I am creating a Report From SQL Query (Portal) with some arguments passed at runtime. I am able to view the output, if the query returns few rows ( arount 1000 rows). But for some inputs it needs to generate >15000 records, at this point the page is getting time out (i think!) and showing error page. I am able to execute query from the SQL Plus console ot using TOAD editor. Here the query is not taking more that 2 mins time to show the result.
    If i am executing from Portal i observed that, once i give the appropriate input and hit submit button a new oracle process is getting created for the query on UNIX (I am usign "TOP" command to check processes). The browser page will be shown error page after 5 minutes (i am assuming session time out!) , but on the backend the process will be executed for more than 30 mins.
    I tried also increase the page time out in httpd.conf, but no use.
    The data returned as a result of the query is sized more than 10 MB. Is caching this much data is possible by the browser page? is the returned data is creating any problem here.
    Please help me to find appropriate reasone for the failure?Do you get any errors or warnings or it is just the slow speed which is the issue?
    There could be a variety of reasons for the delayed processing of this report. That includes parameter settings for that page, cache settings, network configurations, etc.
    - explore best optimization for your query;
    - evaluate portal for best performance configuration; you may follow this note (Doc ID: *438794.1* ) for ideas;
    - third: for that particular page carrying that report, you can use caching wisely. browser cache is neither decent for large files, nor practical. instead, explore the page cache settings that portal provides.
    - also look for various log files (application.log and apache logs) if you are getting any warnings reflecting on some kind of processing halt.
    - and last but not the least: if you happen to bring up a portal report with more than 10000 rows for display then think about the usage of the report. Evaluate whether that report is good/useful for anything?
    HTH
    AMN

  • Need help in setting up Group Policy for same user in local system and Terminal server

    Hi All,
    Currently our remote users are using our network using VPN client over internet.
    They are generally at their home computer and doing VPN as they have to work only in one RDP server for application.
    We actually have a OU created for these RDP users and assign then some strict policy like they can not use any other .exe,they can not user any explorer ,they can not even use windows explorer when they are on RDP they just use one exe of their application.
    Now what my management want is they want their home computers in Domain and want them to login via their same credentials they are using for RDP but they don't want them to restrict in their home computers with any strict policy.
    Now my confusion is how can I configure different policies for same users or same OU.
    Can any one guide me please...

    you can achieve this fairly easily with group policy.
    create an OU and put your remote desktop servers in that OU.
    configure both user and computer policies in a group policy and link it to that ou.
    you need to enable loopback mode - you may want it in merge or replace depending on your other policies you have. Probably replace though I would guess. this is set in the computer configuration > admin templates > system / group policy section.
    now remove the policy you have currently setup for your users on the users OU containing the rdp users. If you want you can move these users back to your main users OU.
    when your users login to the RDP server the settings in the user section of the GPO linked to the RDP Servers OU will apply.
    when the user logs in to their own computer the policies from the user OU and computer OU will apply - but not the more restrictive RDP OU.
    hope that makes sense.
    Regards,
    Denis Cooper
    MCITP EA - MCT
    Help keep the forums tidy, if this has helped please mark it as an answer
    My Blog
    LinkedIn:

  • Need Help in tuning of the query

    Hi all,
    Can any body help me how we can rewrite this query in
    optimized way.
    SELECT A.C1 AS COLUMN_1, B.C2 AS COLUMN_2
    FROM A,B
    WHERE A.C1 IN (
    SELECT COLUMN_1 FROM(
    (SELECT A.C1 AS COLUMN_1,
    COUNT(C1) AS COUNT,
    RANK() OVER (ORDER BY COUNT(C1) DESC) AS RANK
    FROM A, B, C
    WHERE A.C1 = B.C3
    AND B.C2 = C.C1
    AND <other conditions>
    GROUP BY A.C1)
    WHERE RANK <= 10)
    AND A.C1 = B.C3
    AND <other conditions>
    ORDER BY A.C1
    I am using <other conditions> are same in outer query and inner query also.
    Thanks in Advance,

    Hi,
    Yes exactly I am looking TOP-10 results the query is like this
    SELECT A.C1 AS COLUMN_1, B.C2 AS COLUMN_2
    FROM A,B
    WHERE B.C2 IN (
    SELECT COLUMN_1 FROM(
    (SELECT B.C2 AS COLUMN_1,
    COUNT(A.C1) AS COUNT,
    RANK() OVER (ORDER BY COUNT(C1) DESC) AS RANK
    FROM A, B, C
    WHERE A.C1 = B.C3
    AND B.C2 = C.C1
    AND <other conditions>
    GROUP BY B.C2)
    WHERE RANK <= 10)
    AND A.C1 = B.C3
    AND <other conditions>
    ORDER BY B.C2
    Thanks

  • Need help in framing an SQL query

    Hi ,
    Requirement is that
    Let’s say I have a table say X
    I am passing two input params from UI and in DAO i am querying these input prams against the table X(has c1,c2 as columns ) (as it has two columns mapping the input params A,B from UI).
    if either one or Both of the input params matches ,only then i should fetch the records accordingly. It's understood that there won't be a scenario that both input params are null from UI.
    I have three conditions here,
    1.     A match against X, B doesnt Match
    2.     B match against X, A doesnt Match
    3.     Both A & B match against X
    if i use let's say,
    SELECT *FROM X WHERE (c1= A OR c2= B) .
    •     if A match against X B doesnt Match It is fetching all the records matching A - requirement fullfilled
    •     B match against X A doesnt Match It is fetching all the records matching B- requirement fullfilled.
    •     Both A & B match against X It is fetching all the records from the table matching the first condition (which here is A) . requirement not fullfilled.
    I am thinking of using the following query but I need to frame it in a way that based on ACHK & BCHK we need to add the conditions.
    SELECT CASE WHEN C1 = A THEN 0 ELSE 9 END AS ACHK, CASE WHEN C2 = B THEN 0 ELSE 9 END AS BCHK FROM X
    Based on ACHK & BCHK append the conditions. i.e.
    IF ACHK = 0 AND BCHK = 0 THEN
    AND C1 = A AND C2 = B
    ELSE
    AND (C1 = A OR C2 = B)
    Please help.

    Hi,
    963022 wrote:
    Would be glad if you can shed some light on role of DENSE_RANK here (ofcourse i did read the forums but i am confused on what basis a row is ranked).Complicated queries and expressions are usually built of smaller, simpler parts. To understand how the big, complicated thing works, look first at the smaller, simpler components of it, and make sure you understand how they work.
    In this case, the query is composed of a sub-query and a main query. Start by looking at the sub-query only. Display all rows and all columns of the sub-query.
    Break apart the complicated components of that sub-query. Rnk depends on an ORDER BY clause, but the expression used in that ORDER BY clause isn't displayed anywhere. Copy and display just that expression. (I called this case_1_2 in the query below.) Even that may be too complicated to understand, so break it apart. Case_1_2 is formed by adding 2 smaller CASE expressions; in the query below, I displayed each of the in separate columns (case_1 and case_2).
    So here's a query you might use to understand and debug the query I posted:
    WITH     targets          AS
         SELECT     'ABC' AS c1, 10 AS c2  FROM dual     UNION ALL
         SELECT     'ABC',          20            FROM dual     UNION ALL
         SELECT     'FOO',          10            FROM dual     UNION ALL
         SELECT     'FOO',          20            FROM dual     UNION ALL
         SELECT     'FOO',          99            FROM dual
    ,     got_rnk          AS
         SELECT     x.c1, x.c2
         ,     t.c1          AS target_c1
         ,     t.c2          AS target_c2
         ,     DENSE_RANK () OVER ( PARTITION BY  t.c1, t.c2
                                   ORDER BY          CASE
                                                 WHEN  x.c1  = t.c1
                                         THEN  1
                                         ELSE  0
                                             END
                                   + CASE
                                                 WHEN  x.c2  = t.c2
                                         THEN  2
                                         ELSE  0
                                             END
                             DESC
                           )          AS rnk
    --     *****  DEBUGGING SECTION  *****     The following columns are included only
    --                                       to see how the function above works.
         ,                               CASE
                                                 WHEN  x.c1  = t.c1
                                         THEN  1
                                         ELSE  0
                                             END
                                   + CASE
                                                 WHEN  x.c2  = t.c2
                                         THEN  2
                                         ELSE  0
                                             END           AS case_1_2
         ,                               CASE
                                                 WHEN  x.c1  = t.c1
                                         THEN  1
                                         ELSE  0
                                             END           AS case_1
         ,                            CASE
                                                 WHEN  x.c2  = t.c2
                                         THEN  2
                                         ELSE  0
                                             END           AS case_2
    --     *****  END OF DEBUGGING SECTION  *****
         FROM     targets  t
         JOIN           x  ON   x.c1     = t.c1
                       OR   x.c2     = t.c2
    --     The following main query is only for debugging
    SELECT       *
    FROM       got_rnk
    ORDER BY  target_c1, target_c2
    ,            rnk
    ;Output:
                  TARGET TARGET          CASE
    C1         C2 _C1       _C2    RNK   _1_2 CASE_1 CASE_2
    ABC        10 ABC        10      1      3      1      2
    ZZZ        10 ABC        10      2      2      0      2
    ABC         5 ABC        10      3      1      1      0
    ABC         6 ABC        10      3      1      1      0
    ABC         7 ABC        10      3      1      1      0
    ABC         1 ABC        10      3      1      1      0
    ABC         3 ABC        10      3      1      1      0
    ABC         2 ABC        10      3      1      1      0
    ABC         8 ABC        10      3      1      1      0
    ABC         9 ABC        10      3      1      1      0
    ABC         4 ABC        10      3      1      1      0
    ZZZ        20 ABC        20      1      2      0      2
    ABC        10 ABC        20      2      1      1      0
    ABC         2 ABC        20      2      1      1      0
    ABC         1 ABC        20      2      1      1      0
    ABC         9 ABC        20      2      1      1      0
    ABC         8 ABC        20      2      1      1      0
    ABC         7 ABC        20      2      1      1      0
    ABC         6 ABC        20      2      1      1      0
    ABC         5 ABC        20      2      1      1      0
    ABC         4 ABC        20      2      1      1      0
    ABC         3 ABC        20      2      1      1      0
    ABC        10 FOO        10      1      2      0      2
    ZZZ        10 FOO        10      1      2      0      2
    ZZZ        20 FOO        20      1      2      0      2Study this output to see how the different components work.
    For example, the first 12 rows of output show what we found when we were looking for ('ABC', 10). There were 12 rows in table x that had either ca='ABC' or c2=10 (or both). We used the rnk column to find the best match: lower numbers mean better matches. How did we do that? By using the DENSE_RANK function with a DESCending order by clause, that is, we used <tt> DENSE_RANK () OVER (... ORDER BY exp DESC) </tt>, which means that higher values of exp produce lower values from DENSE_RANK. What is exp? It's the column I called case_1_2. As you can see, when there was a perfect match ('ABC', 10), then case_1_2 had the value 3. Less perfect matches got lower values of case_1_2; for example ('ZZZ', 10) only had 2 in the case_1_2 column, and ('ABC', 5) only had 1. Why did case_1_2 have values of 3, 2 or 1 on those rows? Well, it's the sum of case_1 and case_2, so look at those individual columns, and see how they are computed.

  • Need help to write an interesting query

    I need some help in framing the query for the following scenario.
    I have three tables (in general)
    Departments
    DNO (PK)
    DNAME
    Employees
    DNO (FK to DNO in Departments)
    ENO (PK)
    CODE
    History
    seqid (PK)
    ENO (FK to ENO in Employees)
    The summary of the data in Employees table looks like below:
    DNo           No of employees
    10              10
    20               5
    30               8so there will be total of 23 records in employees table. I want to check if all the 10 employees from dept 10 are existing in history table and if exists I want to display the dno and dname from the employees and departments tables respectively. Even if the history table has 9 employees out of 10 from employees table I don't want the query to retrieve that dept details.
    Can any one help me with this?
    Meanwhile I will also try my level best and let you people know if I come up with anything.
    Thanks for your time

    Here the example that will help you.
    emp_test is the history table for you. You can change ct>9SQL> SELECT * FROM
      2  ( SELECT empno ,
      3          ename ,
      4       e.deptno,dname,
      5       COUNT(*) OVER(PARTITION BY e.deptno ORDER BY e.deptno) ct
      6     FROM EMP e ,DEPT d
      7     WHERE e.deptno=d.deptno
      8     AND EXISTS (SELECT 'x' FROM EMP_TEST T
      9                 WHERE T.empno=e.empno))
    10  WHERE ct>3;
         EMPNO ENAME          DEPTNO DNAME                  CT
          7499 ALLEN              30 SALES                   4
          7698 BLAKE              30 SALES                   4
          7654 MARTIN             30 SALES                   4
          7521 WARD               30 SALES                   4
    SQL> set linesize 300
    SQL> select * from emp_test;
         EMPNO ENAME                JOB              MGR HIREDATE         SAL       COMM     DEPTNO
          7369 SMITH                CLERK           7902 17-DEC-80      800.2                    20
          7499 ALLEN                SALESMAN        7698 20-FEB-81       1600        300         30
          7521 WARD                 SALESMAN        7698 22-FEB-81       1250        500         30
          7566 JONES                MANAGER         7839 02-APR-81       2975                    20
          7654 MARTIN               SALESMAN        7698 28-SEP-81       1250       1400         30
          7698 BLAKE                MANAGER         7839 01-MAY-81       2850                    30
          7782 CLARK                MANAGER         7839 09-JUN-81       2450                    10
    7 rows selected.
    SQL> select * from emp;
         EMPNO ENAME      JOB              MGR HIREDATE         SAL       COMM     DEPTNO
          7369 SMITH      CLERK           7902 17-DEC-80      800.2                    20
          7499 ALLEN      SALESMAN        7698 20-FEB-81       1600        300         30
          7521 WARD       SALESMAN        7698 22-FEB-81       1250        500         30
          7566 JONES      MANAGER         7839 02-APR-81       2975                    20
          7654 MARTIN     SALESMAN        7698 28-SEP-81       1250       1400         30
          7698 BLAKE      MANAGER         7839 01-MAY-81       2850                    30
          7782 CLARK      MANAGER         7839 09-JUN-81       2450                    10
          7788 SCOTT      ANALYST         7566 19-APR-87       3000                    20
          7839 KING       PRESIDENT            17-NOV-81       5000                    10
          7844 TURNER     SALESMAN        7698 08-SEP-81       1500          0         30
          7876 ADAMS      CLERK           7788 23-MAY-87       1100                    20
          7900 JAMES      CLERK           7698 03-DEC-81        950                    30
          7902 FORD       ANALYST         7566 03-DEC-81       3000                    20
          7934 MILLER     CLERK           7782 23-JAN-82       1300                    10formatted
    Message was edited by:
    devmiral

  • Need help how to change LOV query

    Hi All,
    Can some one help me how to use the LOV Query based on responsibility (I am using form personalization)
    When the user logs in with XX_Payables Super user with say (Responsibility id =500) then the LOV should be
    Select BA.bank_account_name,
    BA.bank_account_num,
    BA.bank_Account_id,
    BA.currency_code bank_currency_code,
    from CE_BANK_ACCOUNTS ba
    but if the user logs in with any other responsibilits then the lov should be
    Select BA.bank_account_name,
    BA.bank_account_num,
    BA.bank_Account_id,
    BA.currency_code bank_currency_code,
    from CE_BANK_ACCOUNTS ba
    where BA.multi_currency_allowed_flag = 'Y'
    step 1
    I have created a built in builtin type : Create Record group from query
    Arugument : Select statement
    Group name : XX_Group
    step 2
    Property
    Object type : LOV
    target object : PAY_ACTIVE_BANK_ACCOUNTS
    property name : Group name
    value XX_GROUP
    Using this method i am able to select only one query
    How can i control this based on responsibility.
    Appreciate if some one can help me to resolve this issue.
    Regards,
    Rajini

    Thanks for your reply, I tried to use this query but i am getting error as FRM-41076 Error populating group and FRM-41072 Cannot create group
    but if i use any one of the query or either of the query it works fine. but i dont see any issues when i run only any one of the query in argument in form personalization. Union all is returing rows in database.
    SELECT BA.bank_account_name,
    BA.bank_account_num,
    BA.bank_Account_id,
    BA.currency_code bank_currency_code,
    CBAU.bank_acct_use_id ,
    BA.multi_currency_allowed_flag bank_multi_currency_flag,
    BA.zero_amount_allowed bank_zero_amounts_allowed,
    BA.account_owner_org_id legal_entity_id,
    CBB.bank_name,
    CBB.bank_branch_name
    FROM
    CE_BANK_ACCOUNTS BA,
    CE_BANK_BRANCHES_V CBB,
    CE_BANK_ACCT_USES_OU_V CBAU
    WHERE ((BA.multi_currency_allowed_flag = 'Y' AND
    (BA.currency_code = :pay_sum_folder.functional_currency_code or
    BA.currency_code = :parameter.pay_in_full_currency_code )) or
    BA.currency_code = nvl( :parameter.pay_in_full_currency_code, BA.currency_code))
    AND CBAU.BANK_ACCOUNT_ID = BA.BANK_ACCOUNT_ID
    AND sysdate between TRUNC(CBB.start_date) and nvl(TRUNC(CBB.end_date), sysdate + 1)
    AND CBB.branch_party_id = BA.bank_branch_id
    AND SYSDATE < NVL(BA.END_DATE,SYSDATE+1)
    AND BA.ACCOUNT_CLASSIFICATION = 'INTERNAL'
    AND CBAU.ap_use_enable_flag = 'Y'
    AND CBAU.org_id = :pay_sum_folder.org_id
    AND NVL(BA.netting_acct_flag, 'N') <> 'Y'
    AND fnd_global.resp_name = 'XX PAYABLES SUPER USER'
    AND CBB.bank_name_alt = 'Head office bank'
    UNION ALL
    SELECT BA.bank_account_name,
    BA.bank_account_num,
    BA.bank_Account_id,
    BA.currency_code bank_currency_code,
    CBAU.bank_acct_use_id ,
    BA.multi_currency_allowed_flag bank_multi_currency_flag,
    BA.zero_amount_allowed bank_zero_amounts_allowed,
    BA.account_owner_org_id legal_entity_id,
    CBB.bank_name,
    CBB.bank_branch_name
    FROM
    CE_BANK_ACCOUNTS BA,
    CE_BANK_BRANCHES_V CBB,
    CE_BANK_ACCT_USES_OU_V CBAU
    WHERE ((BA.multi_currency_allowed_flag = 'Y' AND
    (BA.currency_code = :pay_sum_folder.functional_currency_code or
    BA.currency_code = :parameter.pay_in_full_currency_code )) or
    BA.currency_code = nvl( :parameter.pay_in_full_currency_code, BA.currency_code))
    AND CBAU.BANK_ACCOUNT_ID = BA.BANK_ACCOUNT_ID
    AND sysdate between TRUNC(CBB.start_date) and nvl(TRUNC(CBB.end_date), sysdate + 1)
    AND CBB.branch_party_id = BA.bank_branch_id
    AND SYSDATE < NVL(BA.END_DATE,SYSDATE+1)
    AND BA.ACCOUNT_CLASSIFICATION = 'INTERNAL'
    AND CBAU.ap_use_enable_flag = 'Y'
    AND CBAU.org_id = :pay_sum_folder.org_id
    AND NVL(BA.netting_acct_flag, 'N') <> 'Y'
    AND fnd_global.resp_name != 'XX PAYABLES SUPER USER'

Maybe you are looking for

  • Problem in BAPI_HU_CREATE

    Dear All, Im using BAPI_HU_CREATE for creating the handling unit, but when i run the program, i m getting a message HU cannot be created and the HU is not getting created,pls find the below coding im using in my program and tell me what could be wron

  • Can I use this printer with my macintosh SE?

    I have a macintosh SE form 1986, i need a printer and i have found this one on a hardware shop near by at a very fair price: Apple Color StyleWriter 2500. Can I use it with my mac? Will be a problem the software with the 800K diskettes? In case this

  • My itunes gift card isnt giving me the full amount

    I bought a 25 dollar itunes card and when I redeemed it, it gave me 13 dollars. I had no outstanding balance.  What's going on?

  • Download install files for use on two computers

    I want to install Creative Cloud on both my iMac and Macbook (as per the Licensing Agreement).  As I have a slow internat connection, can I downlaod the files, copy to the second computer and install on that one?  If so, where do the files reside?

  • Error in receipt transaction

    Hi, I have the following error in receipt transaction: "Cannot read value for profile option PO_RVCTP_ENABLE_TRACE in routine &ROUTINE." I can see the error in "Transaction Statuses" form (INV_SUPERUSER: Transactions: Receiving: Transactions Status S