Query run in Sql prompt correctly but give error in APEX report ORA-01843

Hi. all APEX user
Last week I upgrade APEX 3.2 to 4.0.2 . Now i have a problem. PL/SQL reports which are working in APEX 3.2 not working in 4.0.2. Help me.....
I am working on a mission critical application we have to upgrade there next month.
Query code is :-
select * from (
Select pp.PAYMENT_DATE,pp.PATIENT_ID,p.name as name,pa.Service_Subtype,pp.PAYMENT_RECEIPT_ID,pa.Ward_Type,(pp.TOTAL_CHARGE-pp.discount) as amount ,pa.Service_Booked_By,pp.PAYMENT_COLLECTOR,
case when pp.discount=0 then 1
when pp.TOTAL_CHARGE = pp.discount then 3
else 2
end payment_status
from patients p,PATIENT_Payment pp,PATIENT_account pa where p.patient_id = pp.patient_id and pp.patient_id=pa.patient_id and pa.SERVICE_SUBTYPE=pp.SERVICE_SUBTYPE AND pp.SERVICE_REGISTRATION_ID=pa.SERVICE_REGISTRATION_ID and
(pp.PAYMENT_DATE>=to_date(:P15_date_from,'dd-mon-rr')) AND
(pp.PAYMENT_DATE<=to_date(:P15_date_to,'dd-mon-rr'))AND
(pa.GROUP_NAME=:p15_Group or :p15_Group='ALL') AND
(pp.service_type=:p15_Service_Type or :p15_Service_Type='ALL') AND
(pp.SERVICE_SUBTYPE=:p15_SERVICE_SUBTYPE or :p15_SERVICE_SUBTYPE='ALL') AND
(pa.WARD_TYPE=:p15_Ward or :p15_Ward='ALL') AND
(pp.PAYMENT_COLLECTOR=:p15_Collector or :p15_Collector='ALL')
)order by pp.PAYMENT_DATE
) where payment_status=:p15_status
order by 1

In your query, you expect the date to have the format 'dd-mon-rr'. Have you checked if the format of the date-items is of this format?

Similar Messages

  • Oracle ADF application run while debuging but gives error while running

    Hi,
    I created application in oracle ADF, which accesses database from SQL server 2008. I changed database names to different database having same tables. When I debug it by using breakpoint in EOIMPL class, it runs perfectly. But when run it by removing brakpoint it gives error (invalid object). Please Help.
    Thanks.

    can u paste the complete invalid objects error..
    I rember i have seen this case before which possibly got resolved by removing the system folder.. especially the systemfolder/o.j2ee/drs/ folder..
    may be some synching problem..

  • MDX query runs on SQL but does not populate 'Measures' in Powerpivot

    I ran MDX query on SQL 2012 for looking the products and their shipping status
    The code is given below:
    WITH 
    set Date1 AS 
         strtomember( "[Time].[2014].[Q4].[2014-Jun].[" +format(now()-2, "MM") + "/"+format(now()-2, "dd") + "/" +format(now()-2, "yyyy") + "]")
    set Item1 as
    { [Item].[ItemID].ALLMEMBERS}
    SELECT NON EMPTY { [Measures].[Shipped Qty], [Measures].[Shipped Amt], [Measures].[Ordered Qty], [Measures].[Ordered Amt] }
    ON COLUMNS, 
    Date1*[Item1] ON ROWS FROM [ABCD]
     WHERE ( 
                 [Channel].&[OL], 
                 [Geography].&[A.9])
    The query gives desired output when run in SQL. But when I run the same query in while pulling data in PowerPivot, Dimensions i.e. Date and Item are populated but measures were not populated. Can anyone please help me understand how to populated Measures
    in PowerPivot?
     

    Hi apoorv,
    It was hard to reproduce this issue on my test environment. I would suggest you try to use a simple MDX query to check if it will retrun the correct measures data. Please see the screenshot below:
    In addition, you can also create a SQL Server Analysis Services trace to capture some events for furhter investigation.
    Use SQL Server Profiler to Monitor Analysis Services:http://technet.microsoft.com/en-us/library/ms174946.aspx
    Hope this helps.
    Elvis Long
    TechNet Community Support

  • Defaulting DFF Segment Value using sql statement in SSHR gives error when using parameter

    Dear All,
    i am having an issue that i am making one segment in DFF (SEGMENT3) being defaulted by using sql statement
    Select MAX(SEGMENT7) FROM PER_ANALYSIS_CRITERIA cri, PER_PERSON_ANALYSES ana where cri.Analysis_Criteria_id = ana.ANALYSIS_CRITERIA_ID and ana.PERSON_ID = :ANALYSES.PERSON_ID
    The Above Select Statement is working fine on the PUI form and getting the Default value correctly but when opening the SSHR page that contain this DFF, it  gives me the below error.
    "No field listener is registered to resolve field ANALYSES.PERSON_ID referenced by the flexfield with application short name PER and name PEA. Please contact your system administrator. "
    Any Help Please???

    Please see the following docs.
    Cannot Add Salary:No Field Listener is Registered to Resolve Field Review.assignment_id (Doc ID 558295.1)
    No Field Listener Is Registered To Resolve Field Assgt.Effective_start_date (Doc ID 889794.1)
    List of Current Enhancement Requests (ER) for Oracle EBS Self Service Human Resource (SSHR) (Doc ID 1381936.1)
    No field listener is registered to resolve field xxx.xxx referenced by the flexfield with application short name ASO... (Doc ID 1359270.1)
    Customer Form, Address Error: No field listener is registered to resolve field GLOB.FLEX_COUNTRY_CODE referenced by the flexfield with application short name AR (Doc ID 1276934.1)
    DFF issue : No Field Listener Is Registered To Resolve Field XXX Referenced By The Flexfield (Doc ID 555589.1)
    Thanks,
    Hussein

  • Installed correctly but getting error messages

    I have followed the installation instructions and the program seems to be installed correctly but on some webpages I get error messages on popups.  At first I thought it might just be the website, but they pop up on other sites as well.  I grabbed a screen cap but I don't see that I can attach files herewith.
    The error messages all says:
    "SecurityError Error #2047: Security sandbox violation parent" (then an URL)
    Some messages go on and list "display" and "managers" errors.
    I have uninstalled and installed Flash Player at least a dozen times.  It's getting frustrating because I have no idea what is wrong or how to fix it.  I've tried to find answers on the Forum and in the Help/Support sections but most of that information is just going over my head - I am not a techie.
    I'm using IE9 and my OS is Windows 7
    Can someone advise me in layman's terms how I can fix this?  Or should I even fret about?  It's annoying but I can get the videos to work.
    Many thanks

    As per your instructions, I removed the install.txt file and the ocx file that
    I listed in my previous post.
    My problem now is that I am unable to view the video at this particular
    website:  http://www.wildearth.tv/safari  because it states that I do not
    have the most current Flash Player installed.
    I am so confused.  I was under the impression that the files installed
    under my sysWOW64 folder were indeed the most current Flash Player
    files.  But when I go to download and install whatever program that I
    might reach via the link on that "safari" website, I end up back where I
    was which prompted my original post a few days ago.
    I really would like to be able to view this website.  But I don't want to
    be going through all this hassle again.  Why is this particular website
    not recognizing that I indeed have the most current Flash Player installed?
    Please advise and thank you.

  • PL/PDF - Procedure test1 is executed but gives error

    Hello All,
    I have Oracle XE 10g with Oracle Apex and recently I installed PL/PDF in the same. I tried to execute the headerfooter procedure given in the installation guide. But it gives error ORA-20000: ERR-006 Procedure call error: xxfooter. How can I get the header and footer from this procedure headerfooter?
    - create header footer procedure
    CREATE OR REPLACE procedure headerfooter is
    /* 7. Example: Header, Footer, number of pages */
    l_blob blob;
    begin
    /* Initialize, without parameters means:
    - page orientation: portrait
    - unit: mm
    - default page format: A4 */
    plpdf.init;
    /* Defines the page number alias.
    Default: {nb} */
    plpdf.nopAlias;
    /*Sets the page header procedure name. The program name passed
    as a parameter executes when the page header is created. */
    plpdf.SetHeaderProcName(
    p_proc_name => 'xheader', -- Page header procedure name: xheader
    p_height => 10 -- Height of header section
    /* Sets the page footer procedure name. The program name passed
    as a parameter executes when the page footer is created. */
    plpdf.SetFooterProcName(
    p_proc_name => 'xfooter', --Page footer procedure name: xfooter
    p_height => 10 --Height of footer section
    /* Begin a new page, without parameters means:
    - page orientation: default (portrait) */
    plpdf.NewPage;
    /* Sets the font and its properties */
    plpdf.SetPrintFont(
    p_family => 'Arial', -- Font family: Arial
    p_style => null, -- Font style: regular (default)
    p_size => 12 -- Font size: 12 pt
    /* Draws a rectangle cell with text inside. */
    plpdf.PrintCell(
    p_w => 50, -- Rectangle width
    p_h => 10, -- Rectangle heigth
    p_txt => 'Page 1' -- Text in rectangle
    /* Begin a new page, without parameters means:
    - page orientation: default (portrait) */
    plpdf.NewPage;
    /* Draws a rectangle cell with text inside. */
    plpdf.PrintCell(
    p_w => 50, -- Rectangle width
    p_h => 10, -- Rectangle heigth
    p_txt => 'Page 2' -- Text in rectangle
    /* Returns the generated PDF document.
    The document is closed and then returned in the OUT parameter. */
    plpdf.SendDoc(
    p_blob => l_blob -- The generated document
    /* Print it:*/
         owa_util.mime_header('application/pdf',false);
    htp.p('Content-Length: ' || dbms_lob.getlength(l_blob));
    owa_util.http_header_close;      
    wpg_docload.download_file(l_blob);
    end;
    -Create footer procedure
    CREATE OR REPLACE procedure xfooter is
    begin
    /* Sets the font and its properties */
    plpdf.SetPrintFont(
    p_family => 'Arial', -- Font family: Arial
    p_style => 'I', -- Font style: Italic
    p_size => 8 -- Font size: 8 pt
    /* Print number of page */
    /* Draws a rectangle cell with text inside. */
    plpdf.PrintCell(
    p_w => 0, -- Rectangle width
    p_h => 10, -- Rectangle heigth
    p_txt => to_char(plpdf.CurrentPageNumber) || '/{nb}', -- Text in rectangle
    p_border => '0', -- Without frame
    p_ln => '0', -- Cursor position after the cell is printed: Beside
    p_align => 'C' -- Text alignment: Center
    end;
    Thanks.

    Thanks for your reply,
    Since the owner of header/footer procedures is different than plpdf, I should have given the grants to plpdf schema but unfortunately I missed. Thanks for the answer it worked. Instead of creating synonyms for the procedures in plpdf schema I am passing procedure name with qualifier, the name of its owner, to plpdf api (owner.procedure_name).

  • I tried run our site more times but still error [spam?]

    ''<link removed>'' is our site, thats properties essex ,when code be done thats run good on google chrome but not good on firefox i tried find error but didnt saw problem yet.
    Can you help me please

    Could you describe the problem in more detail, and the steps to re-create the problem?

  • ORA-01858 error from Apex Report on working/valid underlying query

    After two days of searching these forums and AskTom, I think I need to post the following problem.
    I have what seems to be a valid view of some data created as follows (with an apology for the formatting - doesn't seem to be a way of using a fixed font here):
    CREATE OR REPLACE FORCE VIEW "PRICING_CAPABILITY"."POW_EXEC_SUMM010" ("Item",
    "Jul-09", "Aug-09", "Sep-09", "Oct-09", "Nov-09", "Dec-09", "Jan-10",
    "Feb-10", "Mar-10", "Apr-10", "May-10", "Jun-10", "YTD")
    AS
    SELECT
    "Item",
    SUM(DECODE("ItemMonth",'Jul-09',"ItemValue",0)) "Jul-09",
    SUM(DECODE("ItemMonth",'Aug-09',"ItemValue",0)) "Aug-09",
    SUM(DECODE("ItemMonth",'Sep-09',"ItemValue",0)) "Sep-09",
    SUM(DECODE("ItemMonth",'Oct-09',"ItemValue",0)) "Oct-09",
    SUM(DECODE("ItemMonth",'Nov-09',"ItemValue",0)) "Nov-09",
    SUM(DECODE("ItemMonth",'Dec-09',"ItemValue",0)) "Dec-09",
    SUM(DECODE("ItemMonth",'Jan-10',"ItemValue",0)) "Jan-10",
    SUM(DECODE("ItemMonth",'Feb-10',"ItemValue",0)) "Feb-10",
    SUM(DECODE("ItemMonth",'Mar-10',"ItemValue",0)) "Mar-10",
    SUM(DECODE("ItemMonth",'Apr-10',"ItemValue",0)) "Apr-10",
    SUM(DECODE("ItemMonth",'May-10',"ItemValue",0)) "May-10",
    SUM(DECODE("ItemMonth",'Jun-10',"ItemValue",0)) "Jun-10",
    SUM("ItemValue") AS "YTD"
    FROM
    SELECT
    'New Proposals Received' AS "Item",
    TO_CHAR(t1.scope_received,'Mon-RR') AS "ItemMonth",
    COUNT(*) AS "ItemValue",
    10 AS "SortOrder"
    FROM
    PRICING_CAPABILITY.POW_DATA t1
    WHERE
    t1.scope_received IS NOT NULL
    AND extract(YEAR FROM t1.scope_received) IN (2009,2010)
    AND t1.scope_received >= '01-JUL-2009'
    GROUP BY
    'New Proposals Received',
    TO_CHAR(t1.scope_received,'Mon-RR'),
    10
    UNION
    SELECT
    'New Proposals Completed' AS "Item",
    TO_CHAR(t2.pricing_approval,'Mon-RR') AS "ItemMonth",
    COUNT(*) AS "ItemValue",
    20 AS "SortOrder"
    FROM
    PRICING_CAPABILITY.POW_DATA t1
    JOIN PRICING_CAPABILITY.POW_LAST_HISTORY t2
    ON
    t1.POW_DATA_ID = t2.POW_DATA_ID
    WHERE
    t2.pricing_approval IS NOT NULL
    AND extract(YEAR FROM t2.pricing_approval) IN (2009,2010)
    AND t2.pricing_approval >= '01-JUL-2009'
    GROUP BY
    'New Proposals Completed',
    TO_CHAR(t2.pricing_approval,'Mon-RR')
    GROUP BY
    "Item",
    "SortOrder"
    ORDER BY
    "SortOrder" ;
    This view works, ie produces the right results when run (ie select * from ...) in SQL Developer and in the SQL Workshop section of Apex.
    But when I attempt to produce an Apex report using it as the source of data, I get the following error:
    ORA-01858: a non-numeric character was found where a numeric was expected
    The error is displayed before any part of the report itself is displayed, ie the Region Header is displayed and then the error message.
    So far, anything I've been able to find on the forums or AskTom suggests that it is probably due to a date conversion problem. But the aim here is to summarise dated records by month, so I'm extracted the year and month elements of the date values, converting them to strings (using TO_CHAR), and then using the resulting 'Mon-YY' strings to group the results.
    If there is a better way, I'm interested.
    But I don't understand why Apex seems to be rejecting what appear to be valid results from a valid working query.
    Any ideas? Suggestions?
    Cheers,
    Peter

    Thanks again, Flavio. I'm learning and I appreciate your patience.
    The solution you provided is very similar to the one I came up with after your previous message, but I didn't have the NLS_DATE_LANGUAGE parameter. I'll go back and try it.
    I appreciate your explanation re Apex not needing to know and Oracle assuming that the client knows what it is doing, but it puzzles me more.
    The way that I originally had things, I think, was consistent with what you have explained, but it didn't work. To make it clear:
    1 I had an Oracle view that had no parameters and contained the date literal in the where clause and worked fine in both SQL Developer and in the Apex SQL Workshop.
    2 The view did not return any date values. Aside from the column headings and the first column (of character strings), the body of the table comprised integer values only.
    3 So, when Apex called the view, I would have expected the Oracle server to independently execute the view and return the (dateless) results to Apex, which would then present the unmodified results in a standard report. This is, I think, what SQL Developer and the Apex SQL Workshop appear to have successfully done.
    My expectation seems to be consistent with at least some of your explanation (ie [Oracle assumes] "+that the client knows what it is doing+" and "+apex doesn't need to know anything about the underlying query+"), but is not consistent with actual experience, where Apex seems to know that the underlying query contains a date literal and unsuccessfully (and unnecessarily) attempts to interpret it.
    I'm obviously missing something about how Apex and Oracle interact in this situation. While I don't need to know - as I have a working solution now - it is valuable to understand how things work. Makes life easier and more productive.
    Cheers,
    Peter

  • Ldap function gives errors in apex 4.1.1

    Hi all,
    I have a custom function for ldap authentication.
    create or replace
    FUNCTION bgt_ldap_authenticatie_func (
          p_username IN VARCHAR2
        , p_password IN VARCHAR2
    RETURN BOOLEAN
    AS
        l_ldap_host     VARCHAR2(100) := 'domain';
        l_ldap_port     VARCHAR2(4)   := '389';
        l_session       DBMS_LDAP.SESSION;
        l_retval        PLS_INTEGER;
        l_login_result  BOOLEAN := true;
        l_error VARCHAR2(4000);
    BEGIN
        IF p_password IS NULL THEN
            l_login_result := FALSE;
        ELSE
            -- I. LDAP-Login
            BEGIN
                -- LDAP Exceptions
                DBMS_LDAP.USE_EXCEPTION := TRUE;
                -- LDAP-Handle initialiseren ...
                l_session := DBMS_LDAP.INIT(
                      hostname  => l_ldap_host
                    , portnum   => l_ldap_port
                l_retval := DBMS_LDAP.SIMPLE_BIND_S(
                      ld        => l_session
                    , dn        => 'domain\' || LOWER(p_username)
                    , passwd    => p_password
                -- Afmelden van LDAP Server.
                l_retval := DBMS_LDAP.UNBIND_S(ld => l_session);
                -- Registratie was succesvol.
                l_login_result := TRUE;
            EXCEPTION WHEN OTHERS THEN
                l_login_result := FALSE;
            END;
        END IF;
        RETURN l_login_result;
    END;This is working fine on Apex 3.2 and Oracle 10g.
    I now have a development environment with apex 4.1.1 and Oracle 11g.
    I have run above function, with success (no compilation errors).
    I then go to authentication schemes to create my ldap authentication:
    host: domain
    port: 389
    Distinguished Name (DN) String: ou=domain,ou=New Security Groups,ou=Applications,cn=Budgeting_Dev
    Use Exact Distinguished Name (DN): Yes     
    LDAP Username Edit Function: return bgt_ldap_authenticatie_func;      
    When I click on the create button, I get
    1 error has occurred
        ORA-06550: line 5, column 8: PLS-00382: expression is of wrong type ORA-06550: line 5, column 1: PL/SQL: Statement ignoredWhy is it that I'm getting an error when trying to create the authentication when the function has been successfully compiled?
    Thanks,
    Diana

    Hi Diana,
    in addition to Christian comment, the "LDAP Username Edit Function" attribute expects a function which returns VARCHAR2 and not BOOLEAN as your function returns. It should also not be used to actually perform a LDAP lookup, instead it returns the LDAP Username you want to give APEX to perform the LDAP lookup.
    Regards
    Patrick
    My Blog: http://www.inside-oracle-apex.com
    APEX Plug-Ins: http://apex.oracle.com/plugins
    Twitter: http://www.twitter.com/patrickwolf

  • Query running on sql commands prompt not running on report region

    Hi All,
    Facing a weird issue now. I have written a report query which is running absolutely fine in sql command prompt but when i trying to run this as a report it is just processing and the report is not loading. What could be the reason behing this?
    Thanks in Advance
    Regards

    Hi,
    With no other information about the problem is hard to know what's happening. If you could at least provide us with the query then I think it would be easier for us to help you.
    Regards,
    Sergio

  • Execute query  run fine with numeric data not give result on string data

    Hi master
    Sir I use under blow code for execute query
    sir when I use numeric data then run fine but when I use character data then not give any result
    with numeric run fine
    DECLARE
         DD VARCHAR2(15);
    BEGIN
         DD:=10;
    set_block_property('emp', default_where, 'where DEPTNO='||DD);
    go_block('emp');
    execute_query;
    set_block_property('emp', default_where, '');
    END;
    With character not give any result
    DECLARE
         DD VARCHAR2(15);
    BEGIN
         DD:='SALESMAN';
    set_block_property('emp', default_where, 'where RTRIM(EMPNO)='||DD);
    go_block('emp');
    execute_query;
    set_block_property('emp', default_where, '');
    END;
    Please give me any idea

    bro it is not working on string format coz of the missing quotes. e.g. 'smith' or smith. so the quoted string will be compared. in set_block_property u have to include extra quotes on the variable. e.g.
    set_block_property('emp',default_where,'where ename='''||:emp.ename||'');
    or with conditional statement
    set_block_property('emp',default_where,'where ename='''||:emp.ename||''' and dname='''||dept.deptno||'');
    there i included two extra qoutes before joining ename and in the an extra quote to complete to string. if u would like to debug at runtime to show if the qouted string condition is proper then assign the where clause to a variable and message it up.
    like
    myvariable:='where ename='''||:emp.ename||'';
    message(myvariable);
    message(myvariable);
    set_block_property('emp',default_where,myvariable);
    after the string is quoted properly the execute query will work fine, also use the function upper or lower to compare strings.
    zaibi.

  • SECURITY query running slow with Prompts!!

    Hello All,
    Version: PeopleSoft HRMS 9 with PeopleTools 8.49.09
    DB Version: 10.2.0.3 (Oracle)
    My client is running a security query, given below, with and without prompts. Without prompts it is completing in 35 seconds but with prompts (even if the values in the prompts are blank!), the query is taking more than 4-5 hours but not completing!!
    SELECT /*+ OPT_PARAM('_optimizer_mjc_enabled', 'false')
    opt_param('_optimizer_cartesian_enabled', 'false') opt_param('optimizer_index_caching', 0) opt_param('optimizer_index_cost_adj', 0)*/ B.OPRID, A.EMPLID, A.PWCUK_LEGACY_ID, A.NAME, A.EMPL_STATUS, A.EMPL_CLASS,
    to_char(to_date( TO_CHAR(A.HIRE_DT, 'YYYY-MM-DD'), 'yyyy-mm-dd'), 'dd/mm/yyyy'),
    to_char(to_date(decode( TO_CHAR(A.REHIRE_DT, 'YYYY-MM-DD'), '',
    TO_CHAR(A.HIRE_DT, 'YYYY-MM-DD'), TO_CHAR(A.REHIRE_DT, 'YYYY-MM-DD')), 'yyyy-mm-dd'), 'dd/mm/yyyy'),
    to_char(to_date( TO_CHAR(A.TERMINATION_DT, 'YYYY-MM-DD'), 'yyyy-mm-dd'), 'dd/mm/yyyy'), A.DEPTID, A.DEPT_DESCR, A.PWCUK_BUSINESSUNIT, A.PWCUK_BU_DESCR, A.PWCUK_SUBREGION, A.PWCUK_SR_DESCR,
    A.PWCUK_REGION, A.PWCUK_R_DESCR, B.ROWSECCLASS, E.CLASSDEFNDESC, C.ROLENAME, D.DESCR,
    Case C.ROLENAME When 'UK_OTG_Query_Access' then 'Y' When 'UK_Self_Service_Query_Access' then 'Y' When 'UK_Prtner_Affairs_Query_Acces' then 'Y' When 'UK_SelfServ_Sens_Basic_Query' then 'Y' When 'UK_ESC_Extra_Query_Access' then 'Y' When 'UK_BCI_Query_Access' then 'Y' When 'UK_Self_Service_Non_Sens_Q Acc' then 'Y' Else 'N' END, TO_CHAR(A.EFFDT, 'YYYY-MM-DD'),
    TO_CHAR(A.EFFDT, 'YYYY-MM-DD'), D.ROLENAME FROM PS_PWCUK_EMP_C_VW A, PS_PERS_SRCH_QRY A1, PSOPRDEFN B, PS_ROLEU SER_VW C, PSROLEDEFN D, PSCLASSDEFN E WHERE A.EMPLID = A1.EMPLID
    AND A1.OPRID = 'kcooper001a' AND ( B.OPRID = A.PWCE_GUID AND B.OPRID = C.OPRID AND C.ROLENAME NOT IN ('Orbit User', 'PWCUK_LOS_ADMIN_PLANNER', 'Query Designer', 'Query User', 'PWCE_EMEA_AUDIT_RLE_NO_BSE_TBL', 'PWCE_REPORT_DIST', 'EOPP_USER', 'PAPP_USER', 'PWCUK_XMLP_REPORT_DEVELOPER', 'GBR_PEOPLE_MANAGER_CONFIG_UPD', 'PWCUK_EX_EMPLOYEE', 'ReportSuperUser', 'PWCE JOBCODE LOAD UTILITY',
    'PWCE EMPLOYEE RVW LOAD ACCESS', 'PwCE Bonus Upload Access', 'GBR_EP_SYSADMIN') AND ( C.ROLENAME NOT LIKE 'PWCUK_EP%' OR C.ROLENAME = 'PWCUK_EP_ADMIN') AND C.ROLENAME NOT LIKE 'PWCUK_SP%' AND C.ROLENAME NOT LIKE 'GBR_PMGR%' AND 0 < INSTR(:1, decode(trim(:2), null, ' ', B.OPRID)) AND 0 < INSTR(:3, decode(trim(:4), null, ' ', B.EMPLID)) AND 0 < INSTR(:5, decode(trim(:6), null, ' ', A.PWCUK_LEGACY_ID)) A
    ND 0 < INSTR(:7, decode(trim(:8), null, ' ', C.ROLENAME)) AND 0 < INSTR(:9, decode(trim(:10), null, ' ', E.CLASSID)) AND C.ROLENAME = D.ROLENAME AND E.CLASSID = B.ROWSECCLASS ) ORDER BY 4, 20Below are some more useful information I have gathered from DB level for this query:
    +--------------------------------------------------------------------------------------------------+
    |Plan HV     Min Snap  Max Snap  Execs       LIO            PIO            CPU         Elapsed     |
    +--------------------------------------------------------------------------------------------------+
    |770792495   39602     39747     5           1,181,648,326  6,823          7,433.93    7,481.60    |
    +--------------------------------------------------------------------------------------------------+
    ========== PHV = 770792495==========
    First seen from "10/19/12 10:00:44" (snap #39602)
    Last seen from  "10/25/12 11:00:28" (snap #39747)
    Execs          LIO            PIO            CPU            Elapsed
    =====          ===            ===            ===            =======
    5              1,181,648,326  6,823          7,433.93       7,481.60
    Plan hash value: 770792495
    | Id  | Operation                           | Name               | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT                    |                    |       |       |    35 (100)|          |
    |   1 |  SORT ORDER BY                      |                    |     1 |   645 |    35   (6)| 00:00:01 |
    |   2 |   NESTED LOOPS                      |                    |     1 |   645 |    34   (3)| 00:00:01 |
    |   3 |    NESTED LOOPS                     |                    |     6 |  1122 |    10  (10)| 00:00:01 |
    |   4 |     NESTED LOOPS                    |                    |     1 |   165 |     5   (0)| 00:00:01 |
    |   5 |      NESTED LOOPS                   |                    |     1 |   122 |     4   (0)| 00:00:01 |
    |   6 |       NESTED LOOPS                  |                    |     1 |    81 |     3   (0)| 00:00:01 |
    |   7 |        NESTED LOOPS                 |                    |   552 | 29256 |     2   (0)| 00:00:01 |
    |   8 |         INDEX FULL SCAN             | PSAPSROLEUSER      |   550 | 15950 |     1   (0)| 00:00:01 |
    |   9 |         TABLE ACCESS BY INDEX ROWID | PS_ROLEXLATOPR     |     1 |    24 |     1   (0)| 00:00:01 |
    |  10 |          INDEX UNIQUE SCAN          | PS_ROLEXLATOPR     |     1 |       |     1   (0)| 00:00:01 |
    |  11 |        TABLE ACCESS BY INDEX ROWID  | PSOPRDEFN          |     1 |    28 |     1   (0)| 00:00:01 |
    |  12 |         INDEX UNIQUE SCAN           | PS_PSOPRDEFN       |     1 |       |     1   (0)| 00:00:01 |
    |  13 |       TABLE ACCESS BY INDEX ROWID   | PSCLASSDEFN        |     1 |    41 |     1   (0)| 00:00:01 |
    |  14 |        INDEX UNIQUE SCAN            | PS_PSCLASSDEFN     |     1 |       |     1   (0)| 00:00:01 |
    |  15 |      TABLE ACCESS BY INDEX ROWID    | PSROLEDEFN         |     1 |    43 |     1   (0)| 00:00:01 |
    |  16 |       INDEX UNIQUE SCAN             | PS_PSROLEDEFN      |     1 |       |     1   (0)| 00:00:01 |
    |  17 |     VIEW                            | PS_PERS_SRCH_QRY   |   483 | 10626 |     5  (20)| 00:00:01 |
    |  18 |      SORT UNIQUE                    |                    |   483 | 62790 |     5  (20)| 00:00:01 |
    |  19 |       NESTED LOOPS                  |                    |   483 | 62790 |     4   (0)| 00:00:01 |
    |  20 |        NESTED LOOPS                 |                    |   483 | 49749 |     3   (0)| 00:00:01 |
    |  21 |         NESTED LOOPS                |                    |     1 |    67 |     2   (0)| 00:00:01 |
    |  22 |          TABLE ACCESS BY INDEX ROWID| PSOPRDEFN          |     1 |    40 |     1   (0)| 00:00:01 |
    |  23 |           INDEX UNIQUE SCAN         | PS_PSOPRDEFN       |     1 |       |     1   (0)| 00:00:01 |
    |  24 |          TABLE ACCESS BY INDEX ROWID| PS_SJT_OPR_CLS     |     1 |    27 |     1   (0)| 00:00:01 |
    |  25 |           INDEX RANGE SCAN          | PS_SJT_OPR_CLS     |     1 |       |     1   (0)| 00:00:01 |
    |  26 |         TABLE ACCESS BY INDEX ROWID | PS_SJT_CLASS_ALL   |   482 | 17352 |     1   (0)| 00:00:01 |
    |  27 |          INDEX RANGE SCAN           | PS_SJT_CLASS_ALL   |  1158 |       |     1   (0)| 00:00:01 |
    |  28 |        INDEX RANGE SCAN             | PS_SJT_PERSON      |     1 |    27 |     1   (0)| 00:00:01 |
    |  29 |    VIEW                             | PS_PWCUK_EMP_C_VW  |     1 |   458 |     4   (0)| 00:00:01 |
    |  30 |     UNION ALL PUSHED PREDICATE      |                    |       |       |            |          |
    |  31 |      TABLE ACCESS BY INDEX ROWID    | PS_PWCUK_EMPLOYEES |     1 |   169 |     1   (0)| 00:00:01 |
    |  32 |       INDEX RANGE SCAN              | PS_PWCUK_EMPLOYEES |     1 |       |     1   (0)| 00:00:01 |
    |  33 |      FILTER                         |                    |       |       |            |          |
    |  34 |       NESTED LOOPS OUTER            |                    |     1 |   220 |     3   (0)| 00:00:01 |
    |  35 |        NESTED LOOPS OUTER           |                    |     1 |   208 |     2   (0)| 00:00:01 |
    |  36 |         TABLE ACCESS BY INDEX ROWID | PS_PWCUK_EX_EMPLS  |     1 |   161 |     1   (0)| 00:00:01 |
    |  37 |          INDEX RANGE SCAN           | PS_PWCUK_EX_EMPLS  |     1 |       |     1   (0)| 00:00:01 |
    |  38 |         TABLE ACCESS BY INDEX ROWID | PS_PWCE_EP_ROLES   |     1 |    47 |     1   (0)| 00:00:01 |
    |  39 |          INDEX RANGE SCAN           | PS_PWCE_EP_ROLES   |     1 |       |     1   (0)| 00:00:01 |
    |  40 |        INDEX RANGE SCAN             | PS_PWCUK_EMPLOYEES |     1 |    12 |     1   (0)| 00:00:01 |
    |  41 |       SORT AGGREGATE                |                    |     1 |    23 |            |          |
    |  42 |        INDEX RANGE SCAN             | PS_PWCE_EP_ROLES   |     1 |    23 |     1   (0)| 00:00:01 |
                                                  Summary Execution Statistics Over Time
                                                                                  Avg                 Avg
    Snapshot                          Avg LIO             Avg PIO          CPU (secs)      Elapsed (secs)
    Time            Execs            Per Exec            Per Exec            Per Exec            Per Exec
    19-OCT 10:00        1      374,309,812.00            1,469.00            2,286.32            2,291.32
    25-OCT 10:00        3       86,033,085.00            1,567.67              543.68              546.11
    25-OCT 11:00        1      549,239,259.00              651.00            3,516.56            3,551.96
    avg                        336,527,385.33            1,229.22            2,115.52            2,129.80
    sum                 5
                                                  Per-Plan Execution Statistics Over Time
                                                                                             Avg                 Avg
          Plan Snapshot                          Avg LIO             Avg PIO          CPU (secs)      Elapsed (secs)
    Hash Value Time            Execs            Per Exec            Per Exec            Per Exec            Per Exec
    770792495 19-OCT 10:00        1      374,309,812.00            1,469.00            2,286.32            2,291.32
               25-OCT 10:00        3       86,033,085.00            1,567.67              543.68              546.11
               25-OCT 11:00        1      549,239,259.00              651.00            3,516.56            3,551.96
    avg                                   336,527,385.33            1,229.22            2,115.52            2,129.80
    sum                            5I'm not at all proficient in PeopleSoft.
    Please advice how we can get faster runs for this query.
    Note: We have already checked all other possibilities, like network, application, web services, etc, and they look normal.
    Thanks,
    Suddhasatwa

    If the hints are there only for the "cost", then I'm sorry to say, but they are useless. Did you say that was not efficient to the Oracle Support ?
    I asked earlier if that query already ran in a reasonnable time, is it the case, or always took that time ? Is it a change of behaviour after a db upgrade ?
    Have you tried to work with AWR snapshots with a short gap in between ? I mean between the AWR snapshots (every 15 minutes or so), not between the runs of the query.
    If there's no values for the bind variables, I assume this is what you mean when you said "no prompts", then Oracle can go much faster because of the few (or no?) data repartition to retrieve.
    However, when given values to some (all?) of the bind variables, then all the problem will be on the data repartition. That's why I was asking how you gathered statistics on the involved objects, in other words, the histograms may be wrong somehow.
    There's a lot of litterature on this, have a look to the Jonathan Lewis blog for more information.
    Anyway, I think there's not enough information here and does not look easy to work on it in that state from the other side of the network.
    Nicolas.

  • Toplink generate the SQL statement correctly but it does not return any row

    Hi
    I faced an strange problem when using Toplink as JPA provider. Following snippet shows how I create and execute a query using Toplink JPA:
    q = em.createQuery("SELECT B FROM Branch B WHERE B.street LIKE :street");
    q.setParameter("street", "'%a%'");
       List<Branch> l = q.getResultList();
      System.out.println("List Size: " + l.size());The SQL statement resulted by this query is as follow (according to the generated log file)
    SELECT ID, STREET FROM BRANCH WHERE (STREET LIKE CAST (? AS VARCHAR(32672) ))
      bind => [%a%]Problem is that List size is always 0, independent of what I provide as parameter. I tried and executed the generated SQL statement in the SQL manager and I got some tens of record as the result. The SQL statement i tested in the SQL manager is like:
    SELECT ID, STREET FROM BRANCH WHERE (STREET LIKE CAST ('%a%' AS VARCHAR(32672) ))Can someone please let me know what I am missing and how I can fix this problem?
    Thanks.

    Hi,
    Thank you for reply.
    All data are stored in lower case so, the case sensitivity is not a problem. I am wondering how the generated query works fine when I execute it in the sql manager but it return no result when it is executed by the JPA.
    Thanks for looking into my problem.

  • Query running fine in one environment but failing in other environment

    Hi,
    I have a query which i am trying to execute in two different environments.
    Test :- Oracle Database 11g Release 11.2.0.1.0 - 64bit Production
    Prod:- Oracle Database 11g Release 11.2.0.1.0 - 64bit Production
    Now query executes finely in one environment and fails in other environment.
    It gives following error.
    ORA-01861: literal does not match format string
    01861. 00000 - "literal does not match format string"
    The query is too long and contains CHAR-DATE and DATE-CHAR conversions.
    The same query works fine on TEST environment and and fails on PROD environment.
    Any help related to it would be appreciated.
    Thanks,
    Mahesh

    MaheshGx wrote:
    Hi,
    I have a query which i am trying to execute in two different environments.
    Test :- Oracle Database 11g Release 11.2.0.1.0 - 64bit Production
    Prod:- Oracle Database 11g Release 11.2.0.1.0 - 64bit Production
    Now query executes finely in one environment and fails in other environment.
    It gives following error.
    ORA-01861: literal does not match format string
    01861. 00000 - "literal does not match format string"
    The query is too long and contains CHAR-DATE and DATE-CHAR conversions.
    The same query works fine on TEST environment and and fails on PROD environment.
    Any help related to it would be appreciated.
    Thanks,
    MaheshThat's called a bug. One caused by the person who developed the code. They relied on implicit conversion between strings and dates when
    production quality code will always use to_char and to_date functions with a format mask.

  • Query run in Browser 3 sec but with webpage is 60 sec

    Hi,
    When I run a query in the browser from the query screen, it takes 3 seconds to run.  I created a webpage with only that query and blocks for conditions, exceptions.  We access the webpage through the portal and it takes anywhere from 30-90 seconds to get the result. 
    We are on 3.5 using an ITS.  Where should I start looking for the problem?
    Thanks
    Suzanne

    Hi
    I would start with the portal. Check the log of your request in the Portal to check how long it takes to get authentified in your BI system from the portal, and how it takes to get the data transferred from BW to the portail iview....
    The issue might come from the workload on the portal
    PY

Maybe you are looking for

  • How do i restore music files from backup without changing loosing the library structure?

    hello, i have 2 external hard drives. i had my itunes media files on one of them and a copy of them on the other one. (the itunes library files are on the internal hard drive) the external hard drive with the original media files crashed so now i wan

  • Display button options

    My VI has a state machine configuration. What I need to do is in a few states I have user dialogs present whihc tell the user what to do. Now what I want to do is to have a dialog where if the user hits the space bar the process execution moves to th

  • DisAppointed news  Sun Solaris  forum ????????? True or False

    hello Friends , I read some disappointed news on this forum that sun would not continue support for intel edition i donot know it is true of false Any tell me what is exact matter on following email :- [email protected] or reply this letter

  • Recomended configurations for creating video for the web

    I'm working on a project creating video segments for the web (no plans for broadcast of DVD) and I'm looking for opinions on the most efficient way to use FCP to do this. We are shooting with an HD camera with a green screen and composting a couple o

  • SQL Server 2005 and 2000

    Hello,   Is it possible to develop on SQL server 2000. And use the sbo company database in sql server 2005 Regards, Kit