How to find the backend  SQL query of the JSP page in OIC

Does anybody how the best way to find the backend SQL QUERY of OIV JSP page?

How To Generate Trace Files in in HTML/JSP (using Profile Option)
•     • Note: This requires proper responsibility to set SQL Initialization statement using Profile option.      
     Step 1.     Login to the desired Form application.     
     Step 2.     Select +Profile >> System ('Find System Profile Values' screen will pop up)     
     Step 3.     Check 'User' and Type in the Username (in which the account for that user will be trace)     
     Step 4.     Type 'Initialization%' in the Profile box and Hit 'Find' (Click here for preview.)     
     Step 5.     In the User box, type the following statement and Hit 'Save' (Click here for preview)
     BEGIN FND_CTL.FND_SESS_CTL('','','TRUE','TRUE','','ALTER SESSION SET TRACEFILE_IDENTIFIER = TESTING MAX_DUMP_FILE_SIZE = 5000000 EVENTS ='||''''||' 10046 TRACE NAME CONTEXT FOREVER, LEVEL 12'||'''');END;     
     Note:     specify any name you like to identify your trace, in this case, testing is the end name on the trace. You can also specify the amount of data allowable to be in the trace, in this case, 5000000 is the amount set. Make sure you hit 'Save' afterwards.[Quotes in the statement are all 'Single' quotes.]
          specifying TRACEFILE_IDENTIFIER value is mandatory when setting up the trace using the above profile option value
     Step 6.     Login to HTML / JSP page with username/password and start your flow. (Everything you do once login to HTML / JSP will get trace.)     
     Step 7.     Logout of HTML / JSP application once you completed with your flow.      
     Step 8.     Go back to the Profile option in the Form application and delete the Initialization SQL statement, and Hit 'Save'.     
     Step 9.     Log in to the database server or login server and retrieve your trace file.
     Identify and retrieve the trace file using the tracefile_identifier specified in Step 5.
     In this case the tracefile_identifier is “TESTING”. (Click here for Trace file locations) *     
     Note:     If you need to regenerate your trace or tracing a new flow, then repeat Step 1 to Step 8. To avoid self-confusion, choose a different name for your trace identifier everytime you set to trace.     
     Step 10.     See TKPROF section on how to format trace file into readable text.
     Trace Options Definition
     No Trace          Tracing is not activated
     Activities will not get traced.
     Regular Trace
     (Level 1)          Contains SQL, execution statistics, and execution plan.
     Provides execution path, row counts as well as produces smallest flat file.
     Trace with Binds
     (Level 4)          Regular Trace plus value supplied to SQL statement via local variables.
     Trace with Waits
     (Level 8)          Regular Trace plus database operation timings that the SQL waited to have done in order to complete, i.e. disk access.
     Trace with Binds and Waits
     (Level 12)          Regular trace with both waits and binds information.
     Contains the most complete information and will produce the largest trace file.
****Send me an email to [email protected],I will share the document with you.

Similar Messages

  • Extracting the Logical sql query for the specified report  in OBIEE 11g

    Hi ,
    I want to extract the logical SQL Query for the Particular report in OBIEE 11.1.1.5.
    Any pointers related to this will be very helpful.
    Thanks,
    Sonali

    for a try please add Logical sql view to ur report it will dispaly the Logical sql for that Report..
    Hope it will helps you.

  • How to find out if your query uses the indexes?

    How can one tell if the query being issued is using your indexes or doing full table scans?
    Thank you.

    Thank you.
    Ok, let me see if I understand it. So, having an
    index may not speed things up.True
    Full table scans are not bad at all -- as I have it
    in my head. The query I ran before was: select *
    from table1;In that case an index would only slow things down; you are asking it to get all the information from the table - it has to read all of the table ( a full scan).
    >
    So full table scans and index have to do with the db
    block size and the size of the row correct?
    Block size and row size don't have a huge amount to do with it, but they do play a role.
    Let me ask: How does one know the size of a row and
    then the best option for the db blocks? Block size is a global setting (at the tablespace level I think). You would not likely change the block size based on the average row length in any one table. It would be about the last thing you might look at in terms of tuning (though you might consider it up-front if you had a huge amount of very predictable data).
    >
    And if, I create indexes and queries have the where
    clause and the database uses full table scans then
    does it means that either:
    The database believes that the best execution plan is
    to either do FULL SCANS OR USE INDEXES -- ALL UPTO
    THE DATABASE?
    No. There is another piece of information that the database needs to make good decisions. If for example you have a WHERE clause "WHERE not_paid = 1" and you have an index on not_paid. To make a good decision the database needs to know about how many of the rows are likely to be not_paid =1. If it's 90% then a full table scan will be cheaper than looking up the addresses of 90% of the rows and then getting the data. If it's 10% using the index will be cheaper. You need to use Analyze Tables to get the database to store this information. Looks like you need to use a bit of time with the manuals.
    Jon
    -J

  • Physical SQL Query of the BI Publisher Report

    Hi,
    Where can we see the Physical SQL Query of the BI Publisher Report with OBIEE as a Data Source? As you people might be knowing, when we chose OBIEE - a logical SQL will/need to be placed.
    Thanks,
    Vency

    I don't see it in NQQuery log:(
    Ideally, it should be because it will hit BI Server. Moreover, I can see it (report's logical SQL) in BI Server Cache.
    Any other thoughts?

  • How to find last accessed/updated tables and the query text?

    I am using :
    Oracle8i Enterprise Edition Release 8.1.7.4.0 - Production
    With the Partitioning option
    JServer Release 8.1.7.4.0 - Production
    How to find last accessed/updated tables and the query text?
    Regards
    LEE1212

    Check DBA_TBALES view there you find one date column that indicate last update
    One option is as follows:
    (1) Turn the auditing on: AUDIT_TRAIL = true in init.ora
    (2) Restart the instance if its running.
    (3) Audit the table:
         AUDIT INSERT,SELECT,DELETE,UPDATE on TableName
         by ACCESS WHENEVER SUCCESSFUL
    (4) Get the desired information using :
         SELECT OBJ_NAME,ACTION_NAME ,to_char(timestamp,'dd/mm/yyyy , HH:MM:SS')
         from sys.dba_audit_object.
    Cheer,
    Virag Sharma
    http://virag.sharma.googlepages.com/
    http://viragsharma.blogspot.com/
    Message was edited by:
    virag_sh

  • How Can I Change the  Where Condition In the First SQL Query?

    SELECT IND_SSN, BEG_SVC_DT, END_SVC_DT,
    TRUNC(MONTHS_BETWEEN((TO_DATE('19'||END_SVC_DT,'YYYYMMDD')),BEG_SVC_DT)/12),
    mod(trunc(months_between((to_date('19'||end_svc_dt,'YYYYMMDD')),BEG_SVC_DT)),12),
    DECODE((SUBSTR(END_SVC_DT,5,2) - SUBSTR(BEG_SVC_DT,1,2)+1),-1,((SUBSTR(END_SVC_DT,5,2)+ 31) - SUBSTR(BEG_SVC_DT,1,2)),
    -2,((SUBSTR(END_SVC_DT,5,2)+ 31) - SUBSTR(BEG_SVC_DT,1,2)),
    -3,((SUBSTR(END_SVC_DT,5,2)+ 31) - SUBSTR(BEG_SVC_DT,1,2)),
    -4,((SUBSTR(END_SVC_DT,5,2)+ 31) - SUBSTR(BEG_SVC_DT,1,2)),
    -5,((SUBSTR(END_SVC_DT,5,2)+ 31) - SUBSTR(BEG_SVC_DT,1,2)),
    -6,((SUBSTR(END_SVC_DT,5,2)+ 31) - SUBSTR(BEG_SVC_DT,1,2)),
    -7,((SUBSTR(END_SVC_DT,5,2)+ 31) - SUBSTR(BEG_SVC_DT,1,2)),
    -8,((SUBSTR(END_SVC_DT,5,2)+ 31) - SUBSTR(BEG_SVC_DT,1,2)),
    -9,((SUBSTR(END_SVC_DT,5,2)+ 31) - SUBSTR(BEG_SVC_DT,1,2)),
    -10,((SUBSTR(END_SVC_DT,5,2)+ 31) - SUBSTR(BEG_SVC_DT,1,2)),
    -11,((SUBSTR(END_SVC_DT,5,2)+ 31) - SUBSTR(BEG_SVC_DT,1,2)),
    -12,((SUBSTR(END_SVC_DT,5,2)+ 31) - SUBSTR(BEG_SVC_DT,1,2)),
    -13,((SUBSTR(END_SVC_DT,5,2)+ 31) - SUBSTR(BEG_SVC_DT,1,2)),
    -14,((SUBSTR(END_SVC_DT,5,2)+ 31) - SUBSTR(BEG_SVC_DT,1,2)),
    -15,((SUBSTR(END_SVC_DT,5,2)+ 31) - SUBSTR(BEG_SVC_DT,1,2)),
    -16,((SUBSTR(END_SVC_DT,5,2)+ 31) - SUBSTR(BEG_SVC_DT,1,2)),
    -17,((SUBSTR(END_SVC_DT,5,2)+ 31) - SUBSTR(BEG_SVC_DT,1,2)),
    -18,((SUBSTR(END_SVC_DT,5,2)+ 31) - SUBSTR(BEG_SVC_DT,1,2)),
    -19,((SUBSTR(END_SVC_DT,5,2)+ 31) - SUBSTR(BEG_SVC_DT,1,2)),
    -20,((SUBSTR(END_SVC_DT,5,2)+ 31) - SUBSTR(BEG_SVC_DT,1,2)),
    -21,((SUBSTR(END_SVC_DT,5,2)+ 31) - SUBSTR(BEG_SVC_DT,1,2)),
    -22,((SUBSTR(END_SVC_DT,5,2)+ 31) - SUBSTR(BEG_SVC_DT,1,2)),
    -23,((SUBSTR(END_SVC_DT,5,2)+ 31) - SUBSTR(BEG_SVC_DT,1,2)),
    -24,((SUBSTR(END_SVC_DT,5,2)+ 31) - SUBSTR(BEG_SVC_DT,1,2)),
    -25,((SUBSTR(END_SVC_DT,5,2)+ 31) - SUBSTR(BEG_SVC_DT,1,2)),
    -26,((SUBSTR(END_SVC_DT,5,2)+ 31) - SUBSTR(BEG_SVC_DT,1,2)),
    -27,((SUBSTR(END_SVC_DT,5,2)+ 31) - SUBSTR(BEG_SVC_DT,1,2)),
    -28,((SUBSTR(END_SVC_DT,5,2)+ 31) - SUBSTR(BEG_SVC_DT,1,2)),
    -29,((SUBSTR(END_SVC_DT,5,2)+ 31) - SUBSTR(BEG_SVC_DT,1,2)),
    -30,((SUBSTR(END_SVC_DT,5,2)+ 31) - SUBSTR(BEG_SVC_DT,1,2)),
    -31,((SUBSTR(END_SVC_DT,5,2)+ 31) - SUBSTR(BEG_SVC_DT,1,2)),
    30,0,
    (SUBSTR(END_SVC_DT,5,2) - SUBSTR(BEG_SVC_DT,1,2)+1))
    FROM SVC_OCCURRENCES
    WHERE end_svc_dt not in ('PRESENT')
    AND SUBSTR(END_SVC_DT,1,1) IN '9'
    AND SUBSTR(END_SVC_DT,5,2) NOT IN ('31')
    and (SUBSTR(END_SVC_DT,5,2) - SUBSTR(BEG_SVC_DT,1,2)+1) not in ('30')
    UNION
    SELECT IND_SSN, BEG_SVC_DT, END_SVC_DT, NULL, NULL, NULL
    FROM SVC_OCCURRENCES
    WHERE SUBSTR(END_SVC_DT,1,1) IN 'P'
    The above code works fine and I get the correct numeric values from the SQL
    query when the varchar2 end_svc_dt field is numeric however if I have encoded
    the word 'PRESENT' in the varchar2 end_svc dt field the SQL query aborts at
    the last statement in the WHERE condition. The beg_svc_dt field is a Date field.
    and (SUBSTR(END_SVC_DT,5,2) - SUBSTR(BEG_SVC_DT,1,2)+1) not in ('30')
    I get the following error message
    ERROR ORA-0722 INVALID NUMBER
    I encode the word 'PRESENT' in a varchar2 end_svc_dt field on an Oracle form. This is the only word that can be encoded.
    Is there some way that I can bypass the last statement in the where condition and
    compute the values from the SQL query without having the SQL query abort?
    Eventually I want to do this in a report. I know that this sounds strange but can it be done?

    The above code works fine and I get the correct
    numeric values from the SQL
    query when the varchar2 end_svc_dt field is numeric
    however if I have encoded
    the word 'PRESENT' in the varchar2 end_svc dt field
    the SQL query aborts at
    the last statement in the WHERE condition.Ouch!
    Storting dates in VARCHAR2 columns is bad practice, poor design and makes for horrible code.
    The beg_svc_dt field is a Date field.
    and (SUBSTR(END_SVC_DT,5,2) -
    SUBSTR(BEG_SVC_DT,1,2)+1) not in ('30')If it's a date field then why on earth are you trying to SUBSTR it. SUBSTR = sub-string i.e. take a sub section of a string not sub-date.
    I get the following error message
    ERROR ORA-0722 INVALID NUMBERAnd you're surprised by this?
    Is there some way that I can bypass the last
    statement in the where condition and
    compute the values from the SQL query without having
    the SQL query abort?Store your dates properly, use additional flag columns for non-date information and code your SQL properly.
    Eventually I want to do this in a report. I know
    that this sounds strange but can it be done?Yes, most things are possible.

  • How to obtain the transformed SQL query using SEM_MATCH

    Dear all,
    Is it possible to get the transformed relational SQL query when using the SEM_MATCH prefix, by querying directly on the database. We are able to obtain the relational SQL query using Joseki/Jena, however this is not the way to go for us. We would like (if possible) to get it straight from the oracle database by logging or something.
    Kind regards.
    Max

    Hi Max,
    Just to clarify. What SEM_MATCH prefix are you talking about?
    A SEM_MATCH based query is indeed a SQL query as SEM_MATCH is a SQL table function. So if you don't want to go through Java APIs or web service endpoint, then running SEM_MATCH directly should give you what you need. Or maybe you just want to see the underlying generated (from SEM_MATCH) SQL query. If that is true, can you please tell us why?
    Thanks,
    Zhe Wu

  • How can i track the all sql/query executed from application

    How we can track all sql/query that has executed or being executing on oracle database server 10g r2.
    regards
    Prabhaker

    select s.sid,
           s.status,
           s.process,
           s.osuser,
           a.sql_text,
           p.program
    from v$session s,
         v$sqlarea a,
         v$process p
    where s.sql_hash_value = a.hash_value
      and s.sql_address    = a.address
      and s.paddr          = p.addr
      and s.schemaname     = '&1'
      and s.status         = 'ACTIVE'

  • How to compare result from sql query with data writen in html input tag?

    how to compare result
    from sql query with data
    writen in html input tag?
    I need to compare
    user and password in html form
    with all user and password in database
    how to do this?
    or put the resulr from sql query
    in array
    please help me?

    Hi dejani
    first get the user name and password enter by the user
    using
    String sUsername=request.getParameter("name of the textfield");
    String sPassword=request.getParameter("name of the textfield");
    after executeQuery() statement
    int exist=0;
    while(rs.next())
    String sUserId= rs.getString("username");
    String sPass_wd= rs.getString("password");
    if(sUserId.equals(sUsername) && sPass_wd.equals(sPassword))
    exist=1;
    if(exist==1)
    out.println("user exist");
    else
    out.println("not exist");

  • How to find out which sub query returns more than one row

    Hi all,
    Can any one give me clue ,how to find out which sub query returns more than one row in the following query .
    /* Formatted on 2011/05/17 19:22 (Formatter Plus v4.8.8) */
    SELECT a.*, ROWNUM AS rnm
      FROM (SELECT DISTINCT '1' AS "Page View", ou.org_unit_name AS "Org",
                            prxm.mbr_idntfr AS "Beneficiary ID",
                               md.last_name
                            || ', '
                            || md.first_name AS "Beneficiary Name",
                            pci.idntfr AS "Tracking No.",
                            TO_CHAR (TRUNC (req.pa_rqst_date),
                                     'MM/dd/yyyy'
                                    ) AS "Request Date",
                            sts.status_name AS "Status",
                            req.pa_rqst_sid AS "Request #",
                            prxm.mbr_sid AS "Mbr_sid",
                            TO_CHAR
                                  (TRUNC (req.pa_revision_date),
                                   'MM/dd/yyyy'
                                  ) AS "Last Updated",
                            TO_CHAR (psd.TO_DATE, 'MM/dd/yyyy') AS "TO_DATE",
                            prxpl.prvdr_lctn_iid AS "PRVDR_LCTN_IID",
                            pd.prvdr_sid AS "PRVDR_SID", 'Y' AS "State View",
                            DECODE
                               ((SELECT DISTINCT pd.national_prvdr_idntfr
                                            FROM pa_request_x_provider_location prxplo
                                           WHERE prxplo.pa_rqst_sid =
                                                                   req.pa_rqst_sid
                                             AND prxplo.oprtnl_flag = 'A'
                                             AND prxplo.pa_prvdr_type_lkpcd = 'RR'),
                                0, (SELECT prxplo.prvdr_lctn_idntfr
                                      FROM pa_request_x_provider_location prxplo
                                     WHERE prxplo.pa_rqst_sid = req.pa_rqst_sid
                                       AND prxplo.oprtnl_flag = 'A'
                                       AND prxplo.pa_prvdr_type_lkpcd = 'RR'),
                                NULL, (SELECT prxplo.prvdr_lctn_idntfr
                                         FROM pa_request_x_provider_location prxplo
                                        WHERE prxplo.pa_rqst_sid = req.pa_rqst_sid
                                          AND prxplo.oprtnl_flag = 'A'
                                          AND prxplo.pa_prvdr_type_lkpcd = 'RR'),
                                (SELECT DISTINCT pd.national_prvdr_idntfr
                                            FROM pa_request_x_provider_location prxplo
                                           WHERE prxplo.pa_rqst_sid =
                                                                   req.pa_rqst_sid
                                             AND prxplo.oprtnl_flag = 'A'
                                             AND prxplo.pa_prvdr_type_lkpcd = 'RR')
                               ) AS "NPI/ID",
                            DECODE
                               ((SELECT pd.org_bsns_name
                                   FROM pa_request_x_provider_location prxplo
                                  WHERE prxplo.pa_rqst_sid = req.pa_rqst_sid
                                    AND prxplo.oprtnl_flag = 'A'
                                    AND prxplo.pa_prvdr_type_lkpcd = 'RR'),
                                NULL, (SELECT    pd.last_name
                                              || ', '
                                              || pd.first_name
                                              || ' '
                                              || pd.middle_name
                                         FROM pa_request_x_provider_location prxplo
                                        WHERE prxplo.pa_rqst_sid = req.pa_rqst_sid
                                          AND prxplo.oprtnl_flag = 'A'
                                          AND prxplo.pa_prvdr_type_lkpcd = 'RR'),
                                (SELECT pd.org_bsns_name
                                   FROM pa_request_x_provider_location prxplo
                                  WHERE prxplo.pa_rqst_sid = req.pa_rqst_sid
                                    AND prxplo.oprtnl_flag = 'A'
                                    AND prxplo.pa_prvdr_type_lkpcd = 'RR')
                               ) AS "Prvdr Name",
                            TO_CHAR (psd.from_date,
                                     'MM/dd/yyyy'
                                    ) AS "Srvc From Date",
                            TO_CHAR (req.validity_start_date,
                                     'MM/DD/YYYY'
                                    ) AS "Due Date",
                            (fn_get_busniess_days (TRUNC (req.validity_start_date))
                            ) AS "Days<br>Left",
                            req.pa_mode_type_lkpcd AS "Source",
                            TO_CHAR (TRUNC (wmdtl.rtng_date),
                                     'MM/dd/yyyy'
                                    ) AS "Assigned On",
                            NVL (wmdtl.assigned_to_user_name,
                                 'Not Assigned'
                                ) AS "Assigned To",
                            req.org_unit_sid AS "OrgUnitSid",
                            TO_CHAR
                                 (wmdtl.modified_date,
                                  'MM/dd/yyyy hh24:mi:ss'
                                 ) AS "WTRD_MODIFIED_DATE",
                            TO_CHAR (wmdtl.rtng_date,
                                     'MM/dd/yyyy'
                                    ) AS "WTRD_RTNG_DATE",
                            req.status_cid AS "PA_STATUS_CID",
                            TO_CHAR (req.modified_date,
                                     'MM/dd/yyyy'
                                    ) AS "PA_REQ_MODIFIED_DATE",
                            prs.state_pa_srvc_type_code
                                                     AS "STATE_PA_SRVC_TYPE_CODE",
                            wmdtl.wm_pa_task_rtng_dtl_sid
                                                        AS "WM_TASK_RTNG_DTL_SID",
                            wmdtl.assigned_to_user_acct_sid
                                              AS "WTRD_Assigned_to_user_acct_sid",
                            (fn_get_busniess_days (TRUNC (req.validity_start_date))
                            ) AS "Days<br>LeftSort",
                            wmdtl.assigned_to_org_unit_sid
                                                  AS "WTRD_Assigned_to_OrgUntSid",
                            DECODE
                               ((SELECT COUNT (*)
                                   FROM pa_request_status prs
                                  WHERE prs.pa_rqst_sid = req.pa_rqst_sid
                                    AND prs.status_cid = 5
                                    AND prs.oprtnl_flag = 'I'),
                                0, 'N',
                                'Y'
                               ) AS "SHOW_UTILIZATION"
                       FROM   pa_request req,
                             pa_certification_identifier pci,
                             status sts,
                             pa_request_x_member prxm,
                             wm_pa_task_routing_detail wmdtl,
                             pa_service_date psd,
                             org_unit ou,
                             pa_request_service prs,
                             pa_request_x_provider_location prxpl,
                             provider_location pl,
                             provider_detail pd,
                             provider p,
                             mbr_dmgrphc md
                      WHERE req.oprtnl_flag = 'A'
                        AND req.status_cid NOT IN
                                     (20, 30, 70, 25, 80, 96, 85, 5, 97, 98, 101)
                        AND req.org_unit_sid IN
                               (3057, 3142, 3058, 3143, 3059, 3144, 3060, 3145,
                                3061, 3146, 3062, 3147, 3063, 3148, 3064, 3149,
                                3065, 3150, 3066, 3151, 3067, 3152, 3068, 3153,
                                3069, 3154, 3070, 3155, 3071, 3156, 3072, 3157,
                                3073, 3158, 3074, 3159, 3075, 3160, 3076, 3161,
                                3077, 3162, 3078, 3163, 3079, 3164, 3080, 3165,
                                3081, 3166, 3082, 3167, 3083, 3168, 3084, 3169,
                                3085, 3170, 3086, 3171, 3087, 3172, 3088, 3173,
                                3089, 3174, 3090, 3175, 3091, 3176, 3092, 3177,
                                3093, 3178, 3094, 3179, 3095, 3180, 3096, 3181,
                                3097, 3182, 3098, 3183, 3099, 3184, 3100, 3185,
                                3101, 3186, 3102, 3187, 3103, 3003, 75000104,
                                75000108, 2006, 75000103, 75000102, 75000113,
                                75000111, 75000109, 2001, 2009, 75000105,
                                75000107, 2004, 2010, 2013, 2014, 2005, 2011,
                                75000112, 2002, 1001, 2012, 75000106, 2007,
                                75000101, 2003, 75000110, 2008, 3001, 3002, 3019,
                                3104, 3020, 3105, 3021, 3106, 3022, 3107, 3023,
                                3108, 3024, 3109, 3025, 3110, 3026, 3111, 3027,
                                3112, 3028, 3113, 3029, 3114, 3030, 3115, 3031,
                                3116, 3032, 3117, 3033, 3118, 3034, 3119, 3035,
                                3120, 3036, 3121, 3037, 3122, 3038, 3123, 3039,
                                3124, 3040, 3125, 3041, 3126, 3042, 3127, 3043,
                                3128, 3044, 3129, 3045, 3130, 3046, 3131, 3047,
                                3132, 3048, 3133, 3049, 3134, 3050, 3135, 3051,
                                3136, 3052, 3137, 3053, 3138, 3054, 3139, 3055,
                                3140, 3056, 3141)
                        AND req.pa_rqst_sid = prs.pa_rqst_sid
                        AND prs.oprtnl_flag = 'A'
                        AND prs.pa_rqst_srvc_sid = psd.pa_rqst_srvc_sid
                        AND psd.oprtnl_flag = 'A'
                        AND req.pa_rqst_sid = pci.pa_rqst_sid
                        AND pci.oprtnl_flag = 'A'
                        AND req.pa_rqst_sid = prxm.pa_rqst_sid
                        AND prxm.oprtnl_flag = 'A'
                        AND md.oprtnl_flag = 'A'
                        AND md.status_cid = 2
                        AND TRUNC (SYSDATE) BETWEEN md.from_date AND md.TO_DATE
                        AND prxm.mbr_sid = md.mbr_sid
                        AND ou.org_unit_sid = req.org_unit_sid
                        AND ou.oprtnl_flag = 'A'
                        AND req.pa_rqst_sid = prxpl.pa_rqst_sid
                        AND prxm.pa_rqst_sid = prxpl.pa_rqst_sid
                        AND pci.pa_rqst_sid = prxm.pa_rqst_sid
                        AND pci.pa_rqst_sid = wmdtl.subsystem_task_sid
                        AND pci.pa_rqst_sid = prxpl.pa_rqst_sid
                        AND prxpl.pa_prvdr_type_lkpcd = 'RR'
                        AND prxpl.oprtnl_flag = 'A'
                        AND req.status_cid = sts.status_cid
                        AND sts.status_type_cid = 3
                        AND sts.oprtnl_flag = 'A'
                        AND prxpl.prvdr_lctn_iid = pl.prvdr_lctn_iid
                        AND p.prvdr_sid = pd.prvdr_sid
                        AND p.prvdr_sid = pl.prvdr_sid
                        AND pd.oprtnl_flag = 'A'
                        AND pd.status_cid = 2
                        AND TRUNC (SYSDATE) BETWEEN pd.from_date AND pd.TO_DATE
                        AND wmdtl.subsystem_task_sid = req.pa_rqst_sid
                        AND wmdtl.subsystem_lkpcd = 'PA'
                        AND wmdtl.oprtnl_flag = 'A'
                        AND req.pa_rqst_date > (SYSDATE - 365)
                                       ORDER BY TO_DATE ("Request Date", 'MM/dd/yyyy hh24:mi:ss') DESC,
                            "Beneficiary Name" ASC) a
    WHERE ROWNUM < 102;regards,
    P Prakash
    Edited by: BluShadow on 17-May-2011 15:01
    added {noformat}{noformat} tags around the code                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    833560 wrote:
    Can any one give me clue ,how to find out which sub query returns more than one row in the following query .This is why smaller, simpler queries are easier to work with than huge ones - when something like this goes wrong smaller queries are much eaiser to debug. Unfortunately using smaller, easier-to-work with queries is not always an option
    Ganesh is right - you will have to dissect the big query bit by bit until you find the offending subquery. If there is another way I would like to find out about it too.
    The easiest way to do this is probably to use block comments to isolate parts of the query bit by bit until you find the offending part. If you carefully examine the subqueries you might be able to figure out which one is returning multiple rows without commenting everything
    Good luck!

  • Re: How to converting from PL/SQL query to T-SQL query

    How to converting from PL/SQL query to T-SQL query... Its Urgent

    Download the
    SQL Server Migration Assistant for Oracle.  It will convert whole Oracle databases, or single queries or PL/SQL stored procedures.
    With caution that If your database is using Collation which is case sensitive SSMA will not work.SSMA doesnt guarantees 100% for conversion of Queries/stored proc /database if it fails to do so for some queries you will have to do it manually.
    But you can try
    Please mark this reply as the answer or vote as helpful, as appropriate, to make it useful for other readers

  • Get SQL Query from the Region Source

    Hi,
    The below query gives me the region source code,
    SELECT region_source into p_sql_stmt
    FROM apex_application_page_regions
    WHERE region_id = 01129836282 AND
    page_id = 54 AND
    application_id = 215;
    Initially I use to have only the SQL region source code as mentioned below , So using the above query i use to pass the sql code to p_sql_stmt
    SELECT PROJECT_ID,EMPLOYEE_ID,EFFECTIVE_DATE FROM AR_V_ADDRESS_HISTORY WHERE PROJECT_ID = :P51_PROJECT_ID
    Now the changes what i did in the page region source is i am using a PLSQL return query which is mentioned below
    declare
    qry varchar2(32000);
    begin
    qry := ' SELECT PROJECT_ID,EMPLOYEE_ID,EFFECTIVE_DATE';
    for c1 in ( SELECT * FROM AR_ADDRESS_TYPE)
    loop
    qry := qry ||
    ' , GET_ADDRESS_LINE_1(PROJECT_ID,EMPLOYEE_ID,' || c1.address_type_id || ' ,TO_DATE(EFFECTIVE_DATE)) "' || c1.name ||'_ADDRESS_TYPE_1"';
    qry := qry ||
    ' , GET_ADDRESS_LINE_1(PROJECT_ID,EMPLOYEE_ID,' || c1.address_type_id || ' ,TO_DATE(EFFECTIVE_DATE)) "' || c1.name ||'_ADDRESS_TYPE_2"';
    end loop;
    qry := qry || ' FROM AR_V_ADDRESS_HISTORY
    WHERE
    PROJECT_ID = :P51_PROJECT_ID ';
    return(qry);
    end;
    If i execute the above code in the with dbms_output.put_line in the SQL developer or TOAD it prints the sql query which i wanted, Since i am using this in a apex page i need to get the SQL code from the apex page.
    Can any one please suggest me how to get this sql code using the above plsql code.
    Please suggest me in this issue
    Thanks
    Sudhir

    One way to get the sql statement is
    Create a global variable in the package spec where your function returns sql statement and assign the final sql statement to the package spec variable before the return.
    Write a wrapper function to return the stored sql statement value.
    Example code below:
    create or replace package xx_test_pkg as
    g_sql_stmt CLOB;
    function get_sql() return clob;
    function get_stored_val() return clob;
    end;
    create or replace body package xx_test_pkg as
    function get_sql return clob ..
    v_sqlstmt clob;
    begin
    v_sqlstmt := 'select * from emp';
    -- assign to global variable before returning the value
    g_sql_stmt := v_sqlstmt;
    return v_sqlstmt;
    end;
    function get_stored_val() ....
    begin
    return g_sql_stmnt;
    end;
    end;

  • SCCM - How to Find a machine belonging in all the collections.

    Hi All,
    is there any query or any method by which we can find that "to what all collections does a machine belong to" in SCCM 2007.
    Regards,

    The following SQL query will enable you just to do that 
    select v_FullCollectionMembership.CollectionID, v_Collection.Name, v_R_System.Name0 from v_FullCollectionMembership 
    JOIN v_R_System on v_FullCollectionMembership.ResourceID = v_R_System.ResourceID 
    JOIN v_Collection on v_FullCollectionMembership.CollectionID = v_Collection.CollectionID 
    Where v_R_System.Name0='Servername'
    ** Replace Servername with the servername you are checking against.
    Blog: http://theinfraguys.com
    Follow me at Facebook
    The Infra Guys Facebook Page
    Please remember to click Mark as Answer on the answer if it helps you in anyway

  • Combine multiple web services with the same SQL query into one

    Hello,
    I would like to ask a question regarding combine multiple similar web services into one. Can you please tell me if it is possible to combine 4-5 web services into one since they built on the same SQL query with 5 different criterias or condition so that the user can enter any of the 5 criterias to populate the data on the form instead of having 5 different web services?
    e.g Query: Select appName, permit#, address, phone, description, type, section, from table where appName = can be 'appName, permit#, address, phone, or description' to populate the rest of the data to the form.
    Does any one have ever done some thing like this in Workbench ES? If so please assist. I know it can be easier to build it in Visual Basic, C#, or dot.net but the requirement is to build it in workbench ES.
    Thanks in advance,
    Han Dao

    If you are querying for Name, PhoneNumber, and SSN, and you queried for all people with a phone number that started with 867, you would have a potentially long list of people.  So to keep track of all of the people, we store each record in XML complex elements.  The root node is just any name you want, and the repeating element is the complex element name. 
    So using the example from above, I'm going to specify the following:
         Root Node: Result
         Repeating Element: Person
    So now when I do a query, my resultXML will look like:
    <Result>
          <Person>
                 <Name>Alex</Name>
                 <PhoneNumber>867-5309</PhoneNumber>
                 <SSN>111-11-1111</SSN>
          </Person>
    </Result>
    If your query returned multiple results (like ours would probably), it would look like:
    <Result>
          <Person>
                 <Name>Alex</Name>
                 <PhoneNumber>867-5309</PhoneNumber>
                 <SSN>111-11-1111</SSN>
          </Person>
          <Person>
                 <Name>Han</Name>
                 <PhoneNumber>867-2169</PhoneNumber>
                 <SSN>222-22-2222</SSN>
          </Person>
    </Result>
    So Result and Person is just to give a little bit of structure to the xml result (containers really).  So you can name them whatever is helpful for you.
    The column name mappings map the query columns (Name, PhoneNumber, SSN) to some node in the XML (Name, PhoneNumber, SSN).  So you don't need to specify which field maps to what in the form.  Just copy the column names to the element name so you have a 1-to-1 naming.  If you want to manipulate the XML a bit though, you could do:
    Column Name               Element
    Name                            YourName
    PhoneNumber                Phone
    SSN                              Secret
    which would then make your xml look like:
    <Result>
          <Person>
                 <YourName>Alex</YourName>
                 <Phone>867-5309</Phone>
                 <Secret>111-11-1111</Secret>
          </Person>
    </Result>
    It lets you change the XML element names to whatever you want. Otherwise by default they take on their column names.
    In your form, you could bind to the WSDL through the Data Connections pane and point it to your web service.  This will then create form elements that you can just drag and drop allowing you to have the information available when the service gets ran.  Once the service is called, you can modify the field's data to get whatever information you need in order to populate other form fields. 
    If that is too confusing, feel free to send me your form (e-mail is on profile page) and I'll add comments to it to show you how to set up the form for the web service call (and also give me the link to your webservice)

  • How to find out if SQL execution plan is changed proactively using job/grid

    Hello,
    Can you help me on How to find out if SQL execution plan is changed proactively using job/grid control?
    Thank you..
    -

    The answers so far are supposed to show ways how to see that a plan changed after the fact - that is not really proactive but that was the question.
    A way to see a plan change proactively would be to create a SQL Plan Baseline for the SQL statement with the 'good old' plan and then watch DBA_SQL_PLAN_BASELINES for new rows with that SQL_HANDLE which would indicate that a new execution plan was computed - although not yet used.
    Kind regards
    Uwe Hesse
    "Don't believe it, test it!"
    http://uhesse.com

Maybe you are looking for

  • Connecting Airports around the house

    I have an Airport Express in one room where my office is and I have my Stereo in another room. Is it possible to get another Airport or Airport Express and bounce the signal to the other room so that I can play Itunes on it. Plus, I want better recep

  • Eroor while launching businessr rule - (Essbase Error(1042017))

    Hi, I get this error message while try to launch my BR,which is due to the usage of too many functions in the ELSEIF part. Error: Detail:Cannot calculate. Essbase Error(1042017): Network error: The client or server timed out waiting to receive data u

  • Urgent!!! Need your help!!!

    Hi all. Problem description: Why the following code doesn't display the text/contents of the <LastName> node? I've been thinking about this problem for several hours and still can't figure it out. Please HELP!!!!!!!!!!!!!!!!!!! IT's urgent!!!!!! Many

  • Moving old music to iTunes 9

    Hey, I recently got a new iPod, a new model 160gb. It requires iTunes 9. To move the music from my old one, an 80gb mostly with music loaded from 7 and earlier, I copied it. When I loaded it into iTunes 9, all my volume levels were set back. I've spe

  • [solved] Amarok 2.2.1 and mysql 5.1.40 incompatible

    Hi, my packages are all up-to-date. I remark a strange behavior with amarok : I cannot delete a track anymore from my collection. When I right click on a track it has a menu item 'copy to collection' (?). This item is normally only shown for a CD tra