SQL query error

Any new request related to query below to display under the column data?

IDSITE, IDVISIT, COUPON_ID, TRIM (INITCAP (PAGE_PATH) SELECT), INITCAP (keywords), LOCATION_IP, REFERER_NAME, REFERER_URL, VISIT_ACTION_TIME OF WEB_STATS with TRIM (INITCAP (PAGE_PATH)) = "Boston Pizza" and to_date (visit_action_time, 'DD-MON-RRRR') between to_date (5 July 2011 ',' DD-MON-RRRR') and to_date (5 July 2011 ',' DD-MON-RRRR')
*
ERROR on line 1:
ORA-00979: not a GROUP BY expression

863765 wrote:
Any new request related to query below to display under the column data?

IDSITE, IDVISIT, COUPON_ID, TRIM (INITCAP (PAGE_PATH) SELECT), INITCAP (keywords), LOCATION_IP, REFERER_NAME, REFERER_URL, VISIT_ACTION_TIME OF WEB_STATS with TRIM (INITCAP (PAGE_PATH)) = "Boston Pizza" and to_date (visit_action_time, 'DD-MON-RRRR') between to_date (5 July 2011 ',' DD-MON-RRRR') and to_date (5 July 2011 ',' DD-MON-RRRR')
*
ERROR on line 1:
ORA-00979: not a GROUP BY expression

SELECT idsite,
       idvisit,
       coupon_id,
       Trim(Initcap(page_path)),
       Initcap(keywords),
       location_ip,
       referer_name,
       referer_url,
       visit_action_time
FROM   web_stats
WHERE Trim(Initcap(page_path)) = 'Boston Pizza'
       AND To_date(visit_action_time, 'DD-MON-RRRR') BETWEEN
           To_date('05-jul-2011', 'DD-MON-RRRR') AND
           To_date('05-jul-2011', 'DD-MON-RRRR')  

I doubt that all lines will be returned

Published by: sb92075 on July 9, 2011 11:52

Tags: Database

Similar Questions

  • Execution of SQL query error

    Hello

    You can see why I get this error message for my SQL query?
    WITH SKU_DATA AS (
    SELECT /*+ MATERIALIZE */ DISTINCT FROM_LOC_ID,
               SKU_ID,
               DESCRIPTION,
               UPDATE_QTY,
            ORDER_ID,
            CONSIGNMENT,
               WEIGHT,
            PALLET_ID,
            CASE  
        WHEN Upd_Qty_Ratio < 1 
        THEN TO_CHAR(UPDATE_QTY) || 'U'
        WHEN TRUNC(Upd_Qty_Ratio) = Upd_Qty_Ratio
        THEN TO_CHAR(Upd_Qty_Ratio) || 'C'
        ELSE TO_CHAR(TRUNC(UPDATE_QTY)) || 'C' || ' ' || TO_CHAR(ROUND(MOD(Upd_Qty_Ratio, 1) *  USER_DEF_NUM_3, 6)) || 'U'
        END CU_Sum
        FROM (
      SELECT DISTINCT
             FROM_LOC_ID,
          S.SKU_ID,
             S.DESCRIPTION,
             ITL.UPDATE_QTY,
             S.USER_DEF_NUM_3,
          OH.ORDER_ID,
          ITL.CONSIGNMENT,
          ITL.PALLET_ID,
             NVL(ITL.UPDATE_QTY,0)*NVL(S.EACH_WEIGHT,0) Weight,
             ITL.UPDATE_QTY/(CASE S.USER_DEF_NUM_3 WHEN 0 THEN 1 ELSE S.USER_DEF_NUM_3 END) Upd_Qty_Ratio
        FROM INVENTORY_TRANSACTION ITL, SKU S, LOCATION L, ORDER_HEADER OH
        WHERE ITL.SKU_ID = S.SKU_ID
        AND ITL.CODE = 'Pick'
        AND ITL.CONSIGNMENT = $P{Consignment}
        AND OH.ORDER_DATE = TO_CHAR($P{Date}, 'DD-Mon-YYYY')
        AND OH.ORDER_ID = ITL.REFERENCE_ID
        AND ITL.TO_LOC_ID = 'CONTAINER'))
    SELECT DISTINCT ORDER_ID, CONSIGNMENT, WEIGHT, PALLET_ID, CU_Sum,
    (SELECT NVL(TO_CHAR(SUM(CASE WHEN NULLIF(SUBSTR(Cu_Sum, -1), 'U') IS NULL THEN NULL ELSE REPLACE(Cu_Sum,'C',NULL) END)),'0') ||'C' || ' ' || NVL(TO_CHAR(SUM(CASE WHEN NULLIF(SUBSTR(Cu_Sum, -1), 'C') IS NULL THEN NULL ELSE REPLACE(Cu_Sum,'U',NULL) END)),'0') ||'U' FROM SKU_DATA) AS Total_Cu_Sum
    FROM SKU_DATA
    Thanks in advance.

    SM.

    Hello Sam, what is the error, and what has changed since he was executed successfully?

  • Classic report shows wrong "could not parse the SQL query: ORA-00942" error after migrating app to the new environment

    After migrating my APEX 4.1 application to a new environment, one classic report displays a "cannot parse the SQL query: ORA-00942: table or view does not exist" error when the page is displayed. Change the region to report SQL source to somehow (e.g., remove spaces, changing the order of the variables in the WHERE clause) immediately solves the problem, but by returning to the source of the region causes the report error again (the source region valid code without error, however).

    Throw the error message:

    Select v.id,

    v.Col1

    of view_vw v

    where (: P1_FILTER is null or)

    v.col2 = :P1_FILTER)

    Do not throw error:

    Select v.id,

    v.Col1

    of view_vw v

    where (:P1_FILTER is null or)

    v.col2 = :P1_FILTER)

    Changing the order of column in the report has the same effect; i.e. He arranges, but return back to the original column order causes the error to display.

    It's as if a cached result for the correct select statement used by the report is displayed. However, the application does not use the caching of page/region. Any ideas of what could be the cause?

    He solved. Ultimately, all that was necessary was to clear the DB cache using:

    alter system flush shared_pool;

  • Table error ' can not analyze the SQL query!

    Hi all

    I created a view on my database called VIEW_MEMBER_PARTIC_PROJECTS

    If I run a query showing the results of the view:

    SELECT * FROM VIEW_MEMBER_PARTIC_PROJECTS

    I get the following data

    ProjectsParticipants
    131 S
    241
    319
    43
    53
    61
    72

    Now, I wanted to represent this diagram in the APEX so I created a graphic region and entered the Source query generator and the manufacturer produces the following code

    Select null, label projects, value1 Participant link

    of "SCHEMANAME." "" VIEW_MEMBER_PARTIC_PROJECTS ".

    With this code, I get an error:

    Cannot parse the SQL query!

    Select the link null, label projects, value1 "SCHEMANAME Participant." "" VIEW_MEMBER_PARTIC_PROJECTS ".

    Some queries can be run when you run your application, if your query is syntactically correct, you can save your query without validation (see options below the source of the query).

    The code looks OK, but I do not see to save options as the error code is mentioned.

    No one knows how to fix this?

    Thank you

    JaReg wrote:

    I finally found the problem.

    I looked at the code for the view and changed the start of:

    CREATE OR REPLACE FORCE EDITIONABLE VIEW "SCHEMANAME." "" VIEW_MEMBER_PARTIC_PROJECTS "("Participant","Projects")

    AS

    TO

    CREATE OR REPLACE VIEW "SCHEMANAME." "" VIEW_REPEAT_PARATIC ".

    AS

    And that seemed to fix it. I'm not entirely sure why though.

    The view was created using the quoted identifiers for column names. This makes them sensitive and means that they must always be referenced using double quotes. In the absence of quotation marks, Oracle is not case insensitive and automatically converts all uppercase identifiers. The application of graph:

    Select the link null, label projects, value1 "SCHEMANAME Participant." "" VIEW_MEMBER_PARTIC_PROJECTS ".

    has therefore been interpreted by Oracle:

    SELECT THE LINK NULL, LABEL, VALUE1 "SCHEMANAME PARTICIPANT PROJECTS." "" VIEW_MEMBER_PARTIC_PROJECTS ".

    and PROJECTS and PARTICIPANT columns were not recognized because the columns defined for the view have been 'Participant' and 'projects '. The graphic request should have been:

    Select the link null, the label of "Projects", "Participant" value1 "SCHEMANAME." "" VIEW_MEMBER_PARTIC_PROJECTS ".

    As you have now discovered, quoted identifiers are a source of nothing but obscure bugs and should never be used for database objects. He also pointed out the reason why you should always use a standardized, form tiny, coding style as it is faster to type, easy to read and less prone to errors.

  • More than 1 SQL query with checkbox and error invalid number report

    Hi all

    I have two SQL query reports that each has an apex_item.checkbox and two processes for each report.  A report/process works very well.  It gives me an error of invalid number.

    In addition, another query SQL (editable report) gives me the following error when using the Multi line process, delete.

    ORA-06502: PL/SQL: digital or value error: character number conversion
    error ORA-06502: PL/SQL: digital or value error: character number conversion
    error
    Ok

    When I got a report from SQL query (with box and a process) and the query SQL (editable report) everything worked.  It stopped working when I added another SQL query report (with box and a process).

    A SQL query has the following in my query: apex_item.checkbox(3,email_id,'UNCHECKED') ""

    The other SQL query has the following: apex_item.checkbox(2,b.file_id,'UNCHECKED') ""

    Any help will be greatly appreciated,

    Sylvia

    Hi Reema,

    I've recreated the region and now it works!

    Thank you for this, looking at

    Sylvia

  • Error in the SQL query


    Hi all

    This my sql query.

    WITH t AS (select to_clob ("<?")) XML version = "1.0" encoding ="UTF - 8"? >

    " < = xmlns:prd prd:symbolReferenceData ' http://API.Platts.com/referenceData "> "

    XICE001, XICE002 < prd:symbol > < / prd:symbol >

    < prd:attributeClass > density API, Latest < / prd:attributeClass >

    ((< / prd:symbolReferenceData > ') double str).

    T_SYMBOL as (SELECT TO_CHAR (regexp_substr (SYMBOL, "[^ \,] +', 1, LEVEL")) SYMBOL)

    T,.

    XMLTABLE ("symbolReferenceData' PASSAGE xmltype (REPLACE(t.str,'prd:')))

    COLUMNS CLOB PATH 'symbol' symbol)

    CONNECT BY LEVEL < = LENGTH (SYMBOL) - LENGTH (REPLACE (SYMBOL, ",")) + 1

    AND PRIOR dbms_random. VALUE IS NOT NULL)

    t_attributeClass as (SELECT TO_CHAR (regexp_substr (attributeClass, "[^ \,] +', 1, LEVEL")) attributeClass)

    T,.

    XMLTABLE ("symbolReferenceData' PASSAGE xmltype (REPLACE(t.str,'prd:')))

    AttributeClass PATH 'attributeClass' CLOB COLUMNS)

    CONNECTION OF LEVEL < = LENGTH (attributeClass) - LENGTH (REPLACE (attributeClass, ',')) + 1

    AND PRIOR dbms_random. VALUE IS NOT NULL)

    SELECT the name of symbol 'symbol',

    'Name', NULL

    NOTHING "value."

    status "ok".

    OF T_SYMBOL

    UNION

    SELECT the symbol, NULL, NULL,

    Status of 'invalid symbol.

    OF T_SYMBOL;

    If I run the above query, it throws error, below

    ORA-06502: PL/SQL: digital error or value

    ORA-06512: at "SYS." XMLTYPE", line 272

    ORA-06512: at line 1

    06502 00000 - "PL/SQL: digital error or the value of %s.

    * Cause: A digital arithmetic error, String, conversion or coercion

    has occurred. For example, this error occurs if an attempt is made to

    assign the NULL value to a variable declared NOT NULL, or if a

    attempt to assign an integer greater than 99 to a variable

    NUMBER (2) declared.

    * Action: Change the data, how it is handled, or how it is so declared

    that values do not violate the constraints.

    All of the suggestions.

    Kind regards

    Fame

    I have it

    To do two with would adopt.

    WITH t AS (select to_clob ('))

    http://API.Platts.com/referenceData">

    XICE001, XICE002

    Density API, last

    double str),

    T_SYMBOL as (SELECT TO_CHAR (regexp_substr (SYMBOL, "[^ \,] +', 1, LEVEL")) SYMBOL)

    T,.

    XMLTABLE ("symbolReferenceData' PASSAGE xmltype (REPLACE(t.str,'prd:')))

    COLUMNS CLOB PATH 'symbol' symbol)

    CONNECT BY LEVEL<= length(symbol)="" -="" length(replace(symbol,="" ','))="" +="">

    AND PRIOR dbms_random. VALUE IS NOT NULL)

    T_SYMBOL_1 as (SELECT TO_CHAR (regexp_substr (SYMBOL, "[^ \,] +', 1, LEVEL")) SYMBOL)

    T,.

    XMLTABLE ("symbolReferenceData' PASSAGE xmltype (REPLACE(t.str,'prd:')))

    COLUMNS CLOB PATH 'symbol' symbol)

    CONNECT BY LEVEL<= length(symbol)="" -="" length(replace(symbol,="" ','))="" +="">

    AND PRIOR dbms_random. VALUE IS NOT NULL)

    t_attributeClass as (SELECT TO_CHAR (regexp_substr (attributeClass, "[^ \,] +', 1, LEVEL")) attributeClass)

    T,.

    XMLTABLE ("symbolReferenceData' PASSAGE xmltype (REPLACE(t.str,'prd:')))

    AttributeClass PATH 'attributeClass' CLOB COLUMNS)

    CONNECT BY LEVEL<= length(attributeclass)="" -="" length(replace(attributeclass,="" ','))="" +="">

    AND PRIOR dbms_random. VALUE IS NOT NULL)

    SELECT the name of symbol 'symbol',

    'Name', NULL

    NOTHING "value."

    status "ok".

    OF T_SYMBOL

    UNION

    SELECT the symbol, NULL, NULL,

    Status of 'invalid symbol.

    OF T_SYMBOL_1;

  • Stop Error Message "Failed to parse the SQL query" appearing

    Hello

    I have a sql query that is built into a string and then compiled and executed at run time. This query lies in a region and is returned.

    The query uses a view that uses a database link. If the link of database falls down for some reason, the "Failed to Parse SQL Query" message and the details on the DB link not working. However, I want to be able to implement my own error message when this happens, but I can't find a way to capture the error. I have put an exception handler in the region but because the code is technically correct and only fails at runtime that is not catching it.

    Is anyway to catch this error and display my message?

    Thank you
    -Mark

    Hello

    Try to use condition to hide the region and instead of this report will show another area where is your custom error message?

    BR, Jari

  • Œuvres SQL query to MS SQL Server 2008, but not when you use the database kit

    I have this SQL query:

    DECLARE TABLE (@DataTypeTable)
    Name varchar (128).
    TypeID INT)

    -Add comma delimeted type data in the temporary table names
    INSERT INTO @DataTypeTable (name)
    SELECT * from WhatWeShouldDoRead.func_Split (@DataTypeTrimmed, ',')

    SELECT the name OF @DataTypeTable

    That takes a comma delimited by the string and returns the string as a table.  It works correctly in Microsoft SQL Server Management Studio.  When I run this as a stored procedure I return nothing.  There are no errors, SQL or otherwise.  I checked that I am connected to the correct database and the stored procedure is responsible without changing any error chain which is reported of this stored procedure (that code is not shown in the example above).  Has anyone seen this problem before, or have experience with SQL/Labview interfaces to tell me what I am doing wrong?

    Thanks in advance.


  • Support of SQL query: what tasks are Sunday from 07:00 - 12:00

    Hello tide Admins.

    I need to do a SQL query that can give me a list of jobs that are running on a given (Sunday) day from 07:00 - 12:00.  Our environment is not a maintenance window.  Therefore, whenever there is application of patches or upgrades, it causes more work and risk of failure of the tide tasks.    By moving jobs over the period from 07:00 - 12:00 Sunday, patch can be completed without disrupting the calendar.

    Im not the best at the SQL script and can not get my script to work. any help would be great. Here's what I have so far.  I get the error ' could not find identifier multi-player jobmst.jobmst_name.  IM using Tidal 6.0.3 with SQL for DB Admeral table.

    SELECT dbo.jobdtl.jobdtl_id, dbo.jobmst.jobmst_prntname, dbo.jobmst.jobmst_name

    FROM dbo.jobdtl INNER JOIN

    dbo.jobmst ON dbo.jobdtl.jobdtl_id = dbo.jobmst.jobdtl_id

    WHERE (dbo.jobdtl.jobdtl_fromdt > 14 September 2016 06:00 ') AND (dbo.jobdtl.jobdtl_fromdt< '09/11/2016="" 012:00:00="">

    GROUP OF dbo.jobdtl.jobdtl_id, dbo.jobmst.jobmst_prntname, dbo.jobmst.jobmst_name

    Hi Jeff

    The time window from the jobdtl returns only jobs that have an early start time and windows of time from beginning to the end, so there may be some tasks which are not time bound but have dependencies on other jobs, variables, etc.

    Here are the 2 SQL queries against the table jobrun and jobmst:

    -The list of jobs that took place last Sunday between 07:00 and 12:00

    SELECT jobmst.jobmst_prntname, jobmst.jobmst_name, jobrun.jobrun_time FROM jobrun
    JOIN jobmst on jobrun.jobmst_id = jobmst.jobmst_id
    WHERE jobrun.jobrun_time > = 9/11/2016 07:00 ' and jobrun.jobrun_time<= '9/11/2016="" 12:00="">
    ORDER BY jobrun.jobrun_time

    -For a list of jobs that are scheduled to run on Sunday to come between 07:00 and 12:00

    SELECT jobmst.jobmst_prntname, jobmst.jobmst_name, jobrun.jobrun_esttime FROM jobrun
    JOIN jobmst on jobrun.jobmst_id = jobmst.jobmst_id
    WHERE jobrun.jobrun_esttime > = 9/18/2016 07:00 ' and jobrun.jobrun_esttime<= '9/18/2016="" 12:00="">
    ORDER BY jobrun.jobrun_esttime

    ARO

    The Derrick

  • A map of OWB (service line) SQL query

    If I trace a session, run a map OWB (base line), the trace file contains the actual SQL query?

    The problem with me is that when I execute this rank - based OWB card, is throw me an error CursorFetchMapTerminationRTV20007, BUT (most time consuming) when I take on the intermediate SQL insert query, it works very well (and also in a very short time)

    The executing State = COMPLETE

    message = text ORA-06502: PL/SQL: digital or value error: character string buffer too small

    CursorFetchMapTerminationRTV20007 = message text

    N ° of task errors = 0

    N ° task warnings = 2

    N ° errors = 1

    Since this card OWB (truncate insert) is the line in function of where I can't back-end of the generated pl/sql package request OWB so I was wondering if I trace the session, check the trace file, maybe I'll able to see the exact SQL query generated. But I wanted to confirm the same.

    Yes, the real run SQL in session will be in the trace file.

  • See the wizard bug of mapping object 'custom SQL query' attribute to JDeveloper 12.1.3.0.0

    I encountered a bug in JDeveloper 12.1.3.0.0 when working with custom views of SQL query. The bug manifests itself so that the wizard does not all SQL attributes add to the list of attributes. This is the query that I managed to recreate my original query that shows the bug:

    with with_clause as)

    Select ao.owner as variable_attr from sys.all_objects ao

    )

    Select

    0 as constant_attr,

    WC.variable_attr

    of with_clause wc

    The wizard creates only an attribute to "constant_attr" and not "variable_attr". Hit the "Requester" button in the wizard gives me the following error:

    error.png

    I don't think I need to stress is how problematic - creation all attributes by hand for a query validates is enough of a reason to go get another IDE because ADF assistants are the most useful features of JDeveloper, otherwise the only ones that are "hooked". In addition, it works very well in JDeveloper 11 g and JDeveloper 10 g - what happened to 12 c?

    Oracle has made some changes in this area in 12.1.3. If you have a support contract, you must file an SR with support.oracle.com. If you haven't you might want this folder on https://java.net/jira/browse/ADFEMG that has no attached ALS but at least the problem is registered and if it is accepted as a bug an official bug is triggered.

    Timo

  • SQL QUERY: operator relational invalid

    Hi friends,

    I created classic report and create the checkbox for the market and create a filter on the box.

    Select I.SBU_CODE, I.MKT_CODE, $m.name, MKT_NAME, D.DIV_NAME,

    SUM (DECODE (I.INVOICE_TYPE, 'C', (-1 * NVL(I.GROSS_AMT,0)), NVL(I.GROSS_AMT,0))) CURYR_SALEAMT;

    PRVYR_SALEAMT 0,

    SUM (DECODE (I.INVOICE_TYPE, "C", 0, NVL(I.EFFECTIVE_PAX,0))) CURYR_PAX;

    0 PRVYR_PAX

    of ar_invoice_mas i, MARKET_MAS M, AC_DIVISION_MAS D

    where nvl(i.active_flg,'N') = 'Y '.

    AND NVL(I.CANCEL_FLAG,'N') = N

    AND M.SBU_CODE = I.SBU_CODE

    AND M.CODE = I.MKT_CODE

    AND D.SBU_CODE = M.SBU_CODE

    AND D.DIV_CODE = M.DIV_CODE

    AND I.SBU_CODE =: P23_SBU_CODE

    AND TRUNC (I.INVOICE_DATE) BETWEEN: P23_FROM_DATE AND: P23_TO_DATE

    AND (1 = (CASE

    WHEN (: P23_MARKET NOT NULL AND (: P23_MARKET = 'ALL'))

    THEN 1

    WHEN (: P23_MARKET NOT NULL AND (INSTR (': ' |: P23_MARKET |': ',' :'||))) I.MKT_CODE: ':', 1) > 0))

    THEN 1

    ON THE OTHER

    0

    (END))

    I.SBU_CODE, I.MKT_CODE, D.DIV_NAME, $M.NAME GROUP

    When I run above sql query I got an error "invalid relational operator.

    I tried to find it, but find it not. Any body could help us.

    Thank you

    Hi Maxence,

    CORINE wrote:

    When I run above sql query I got an error "invalid relational operator.

    I tried to find it, but find it not. Any body could help us.

    Missing you IS controls NOT NULL state in CASE block.

    Try this:

    select I.SBU_CODE
        , I.MKT_CODE
        , M.NAME MKT_NAME
        , D.DIV_NAME
        , SUM( DECODE(I.INVOICE_TYPE,'C', (-1* NVL(I.GROSS_AMT,0)), NVL(I.GROSS_AMT,0) )) CURYR_SALEAMT
        , 0 PRVYR_SALEAMT
        , SUM( DECODE(I.INVOICE_TYPE,'C', 0, NVL(I.EFFECTIVE_PAX,0) )) CURYR_PAX
        , 0 PRVYR_PAX
      from ar_invoice_mas i
        , MARKET_MAS M
        , AC_DIVISION_MAS D
    where nvl(i.active_flg,'N') = 'Y'
      AND NVL(I.CANCEL_FLAG,'N') = 'N'
      AND M.SBU_CODE = I.SBU_CODE
      AND M.CODE = I.MKT_CODE
      AND D.SBU_CODE = M.SBU_CODE
      AND D.DIV_CODE = M.DIV_CODE
      AND I.SBU_CODE = :P23_SBU_CODE
      AND TRUNC(I.INVOICE_DATE) BETWEEN :P23_FROM_DATE AND :P23_TO_DATE
      AND ( 1 = ( CASE
                    WHEN (:P23_MARKET IS NOT NULL AND (:P23_MARKET= 'ALL'))
                      THEN 1
                      WHEN (:P23_MARKET IS NOT NULL AND (INSTR(':'|| :P23_MARKET||':',':'||I.MKT_CODE||':',1) > 0 ))
                        THEN 1
                      ELSE
                        0
                      END ))
    GROUP BY I.SBU_CODE, I.MKT_CODE, D.DIV_NAME, M.NAME
    

    I hope this helps!

    Kind regards

    Kiran

  • pl/sql procedure error

    Hello

    I'm trying to insert the results of a query in a table. When I run it as a sql it works perfectly fine. I am writing this in a procedure that I need to run this often, but I get an error indicating that the table was not found. any suggestions on this.

    SQL query

    insert into db_usage

    SELECT hg. Nom_tablespace 'space ',.

    TOTALUSEDSPACE "use."

    (hg. TOTALSPACE - FG TOTALUSEDSPACE) "MB free.

    Hg.TotalSpace "Total."

    round (100 * ((hg.totalspace-fg.totalusedspace) / hg.totalspace))

    "using."

    SYSDATE

    Of

    (select nom_tablespace,

    Round (Sum (bytes) / 1048576) TotalSpace

    from dba_data_files

    Group by tablespace_name) hg.

    (select round (sum (bytes) /(1024*1024)) totalusedspace, nom_tablespace)

    from dba_segments

    GROUP BY nom_tablespace) fg

    where hg. Nom_tablespace = FG TABLESPACE_NAME

    ORDER BY hg. NOM_TABLESPACE;

    END;

    ***************

    PL/SQL

    CREATE OR REPLACE PROCEDURE TEST AS

    Begin

    DBMS_OUTPUT. ENABLE;

    insert into db_usage

    SELECT hg. Nom_tablespace 'space ',.

    TOTALUSEDSPACE "use."

    (hg. TOTALSPACE - FG TOTALUSEDSPACE) "MB free.

    Hg.TotalSpace "Total."

    round (100 * ((hg.totalspace-fg.totalusedspace) / hg.totalspace))

    "using."

    SYSDATE,

    TO_CHAR (sysdate, 'HH24')

    Of

    (select nom_tablespace,

    Round (Sum (bytes) / 1048576) TotalSpace

    from dba_data_files

    Group by tablespace_name) hg.

    (select round (sum (bytes) /(1024*1024)) totalusedspace, nom_tablespace)

    from dba_segments

    GROUP BY nom_tablespace) fg

    where hg. Nom_tablespace = FG TABLESPACE_NAME

    ORDER BY hg. NOM_TABLESPACE;

    END;

    Thank you

    balls

    Most likely, you must do the following:

    Connect / as sysdba

    Grant select on sys.dba_data_files to proc_owner;

    Grant select on sys.dba_segments to proc_owner;

    A few other comments...

    > DBMS_OUTPUT. ENABLE;

    It is not necessary in a stored procedure. This process has even not any DBMS_OUTPUT. PUT (_LINE) call so the above is unnecessary.

    > ORDER BY hg. NOM_TABLESPACE;

    Consider dropping it. Are you concerned that the data are inserted into the table in the order? What concerns you is that data comes from the table in the order sorted which cases you'd ORDER BY queries using this table.

    See you soon,.
    Brian

  • CFGFWK-60850: the Test failed! CFGFWK-60853: A connection to the database, but no lines have been returned to the examination of the SQL query.

    Hi all..

    It's SOA 11.1.1.7... I created the schema and storage via RCU but when I try to configure JDBS schema components... his throw this error:

    CFGFWK-60850: the Test failed!

    CFGFWK-60853: A connection to the database, but no lines have been returned to the examination of the SQL query.

    I created 3 users of UCR and who were all successful, because I have no error... of these three alone is managed in the configuration tree SOA...

    No idea why like that...

    Thank you

    Aerts

    This that I solved it by installing EMP 11.1.2.2 with UCR and SOA 11.1.1.6...

  • performance issue with the Oracle SQL query

    Dears

    Good evening

    I am new to begin to use Oracle SQL, I have a sql query which takes longer to run in production.

    Each table in the query contains 1.2 million records and DBA suggested using the "Oracle - tips. I don't have good knowledge on this subject and the difficulties to implement this advice for imrpovise performance. In the product the jobs Informatica are failed and stuck with this problem of query performance.

    I ask this forum for an emergency for me to solve this problem by using "advice". kindly help me.

     

    SELECT
    CASE.ID,
    CASE. DTYPE,
    CASE. Version
    CASE. EXTERNAL_REF,
    CASE. CREATION_TS,
    RQ. TYPE
    Of
    PAS_CASE CASE,
    AS_REQUEST RQ,
    CN PAS_CONTEXT
    where rq.case_id = case.id
    AND rq.id = cn.request_id
    and rq. DTYPE = "MAINREQUEST."
    and rq. TYPE in
    (
    'bgc.dar.vap.resolution.advice ',' bgc.dar.e2etest.execution ',' bgc.tbf.repair.vap', ' bgc.dar.e2etest ',.
    'bgc.dar.e2etest.intermediate.execution ',' bgc.cbm ',' bgc.dar.e2etest.preparation', ' bgc.chc.polling '.

    )
    and CN. STATUS ('FINISHED', 'CANCEL', 'TIMEOUT', 'ERROR')
    AND CAST (CN. CREATION_TS AS DATE) > = TO_DATE ('2014-05-06 00:00:00 ',' ' YYYY-MM-DD HH24:MI:SS)
    AND
    CAST (CN. CREATION_TS AS DATE) < TO_DATE ('2014-05-06 23:59:59 ',' ' YYYY-MM-DD HH24:MI:SS)

    -2nd request

    SELECT
    RA.ID,
    RHEUMATOID ARTHRITIS. Version
    RHEUMATOID ARTHRITIS. REQUEST_ID,
    RA.NAME,
    RHEUMATOID ARTHRITIS. VALUE,
    RHEUMATOID ARTHRITIS. LOB_ID,
    RHEUMATOID ARTHRITIS. DTYPE,
    RHEUMATOID ARTHRITIS. CREATION_TS,
    TASK. MAIN_REQ_TYPE
    PAS_REQUESTATTRIBUTE RA
    Join
    (
    Select tsk.ID, tsk. TYPE, main_req_type main_req.
    of tsk PAS_REQUEST
    Join
    (
    Select cn.id as context_id, rq. TYPE main_req_type
    of PAS_REQUEST rq
    Cn PAS_CONTEXT
    where rq.id = cn.request_id
    and rq. DTYPE = "MAINREQUEST."
    and rq. TYPE in
    (
    'bgc.dar.vap.resolution.advice ',' bgc.dar.e2etest.execution ',' bgc.tbf.repair.vap', ' bgc.dar.e2etest ',.
    'bgc.dar.e2etest.intermediate.execution ',' bgc.cbm ',' bgc.dar.e2etest.preparation', ' bgc.chc.polling '.
    )
    and cn. STATUS ('FINISHED', 'CANCEL', 'TIMEOUT', 'ERROR')
    and CAST (cn. END_TS AS DATE) > = TO_DATE ('2014-05-06 00:00:00 ',' ' YYYY-MM-DD HH24:MI:SS)
    and CAST (cn. END_TS AS DATE) < = TO_DATE ('2014-05-06 23:59:59 ',' ' YYYY-MM-DD HH24:MI:SS)
    and cn.ID between the 20141999999999999 AND 20141800000000000
    and rq.ID between the 20141999999999999 AND 20141800000000000

    ) main_req
    On tsk.parent_context_id = main_req.context_id
    and tsk. DTYPE in ('ANALYSIS_TASK', 'DECISION_TASK')
    and tsk.ID between $$ LOW_ID1 AND $$ HIGH_ID1
    ) task
    on the RA REQUEST_ID = task.ID
    and RA.ID between $$ LOW_ID1 AND $$ HIGH_ID1
    UNION

    SELECT
    RA.ID,
    RHEUMATOID ARTHRITIS. Version
    RHEUMATOID ARTHRITIS. REQUEST_ID,
    RA.NAME,
    RHEUMATOID ARTHRITIS. VALUE,
    RHEUMATOID ARTHRITIS. LOB_ID,
    RHEUMATOID ARTHRITIS. DTYPE,
    RHEUMATOID ARTHRITIS. CREATION_TS,
    MAIN_REQ. TYPE
    PAS_REQUESTATTRIBUTE RA
    Join
    (
    Select rq.id, rq.type
    of PAS_REQUEST rq
    Cn PAS_CONTEXT
    where rq.id = cn.request_id
    and rq. DTYPE = "MAINREQUEST."
    and rq. TYPE in
    (
    'bgc.dar.vap.resolution.advice ',' bgc.dar.e2etest.execution ',' bgc.tbf.repair.vap', ' bgc.dar.e2etest ',.
    'bgc.dar.e2etest.intermediate.execution ',' bgc.cbm ',' bgc.dar.e2etest.preparation', ' bgc.chc.polling '.
    )
    and cn. STATUS ('FINISHED', 'CANCEL', 'TIMEOUT', 'ERROR')
    and CAST (cn. END_TS AS DATE) > = TO_DATE ('2014-05-06 00:00:00 ',' ' YYYY-MM-DD HH24:MI:SS)
    and CAST (cn. END_TS AS DATE) < = TO_DATE ('2014-05-06 23:59:59 ',' ' YYYY-MM-DD HH24:MI:SS)
    and cn.ID between the 20141999999999999 AND 20141800000000000
    and rq.ID between the 20141999999999999 AND 20141800000000000
    ) main_req
    on the RA REQUEST_ID = main_req.ID

    -3rd request

    SELECT

    RB.ID,

    RB. DTYPE,

    RB. Version

    RB. TYPE,

    RB. CREATION_TS,

    RB. TASK_ID,

    RB. Color

    RB. GLOBAL_RESULT,

    TASK. MAIN_REQ_TYPE

    Of

    PAS_RESULTBLOCK RB

    Join

    (

    Select tsk.ID, tsk. TYPE, main_req_type main_req.

    of tsk PAS_REQUEST

    Join

    (

    Select cn.id as context_id, rq. TYPE main_req_type

    of PAS_REQUEST rq

    Cn PAS_CONTEXT

    where rq.id = cn.request_id

    and rq. DTYPE = "MAINREQUEST."

    and rq. TYPE in

    (

    'bgc.dar.vap.resolution.advice ',' bgc.dar.e2etest.execution ',' bgc.tbf.repair.vap', ' bgc.dar.e2etest ',.

    'bgc.dar.e2etest.intermediate.execution ',' bgc.cbm ',' bgc.dar.e2etest.preparation', ' bgc.chc.polling '.

    )

    and cn. STATUS ('FINISHED', 'CANCEL', 'TIMEOUT', 'ERROR')

    and CAST (cn. END_TS AS DATE) > = TO_DATE ('2014-05-06 00:00:00 ',' ' YYYY-MM-DD HH24:MI:SS)

    and CAST (cn. END_TS AS DATE) < = TO_DATE ('2014-05-06 23:59:59 ',' ' YYYY-MM-DD HH24:MI:SS)

    and cn.ID between the 20141999999999999 AND 20141800000000000

    and rq.ID between the 20141999999999999 AND 20141800000000000

    ) main_req

    On tsk.parent_context_id = main_req.context_id

    and tsk. DTYPE in ('ANALYSIS_TASK', 'DECISION_TASK')

    and tsk.ID between $$ LOW_ID1 AND $$ HIGH_ID1

    ) task

    We rb.task_id = task.ID

    and rb.ID between $$ LOW_ID1 AND $$ HIGH_ID1

    and RB. TYPE is not null

    and RB. TYPE IN

    (

    'bgc.dar.vap.resolution.advice ',' bgc.dar.e2etest.execution ',' bgc.tbf.repair.vap', ' bgc.dar.e2etest ',.

    'bgc.dar.e2etest.intermediate.execution ',' bgc.cbm ',' bgc.dar.e2etest.preparation', ' bgc.chc.polling '.

    )

    UNION

    SELECT

    RB.ID,

    RB. DTYPE,

    RB. Version

    RB. TYPE,

    RB. CREATION_TS,

    RB. TASK_ID,

    RB. Color

    RB. GLOBAL_RESULT,

    TASK. MAIN_REQ_TYPE

    Of

    PAS_RESULTBLOCK RB

    Join

    (

    Select tsk.ID, tsk. TYPE, main_req_type main_req.

    of tsk PAS_REQUEST

    Join

    (

    Select cn.id as context_id, rq. TYPE main_req_type

    of PAS_REQUEST rq

    Cn PAS_CONTEXT

    where rq.id = cn.request_id

    and rq. DTYPE = "MAINREQUEST."

    and rq. TYPE in

    (

    'bgc.dar.vap.resolution.advice ',' bgc.dar.e2etest.execution ',' bgc.tbf.repair.vap', ' bgc.dar.e2etest ',.

    'bgc.dar.e2etest.intermediate.execution ',' bgc.cbm ',' bgc.dar.e2etest.preparation', ' bgc.chc.polling '.

    )

    and cn. STATUS ('FINISHED', 'CANCEL', 'TIMEOUT', 'ERROR')

    and CAST (cn. END_TS AS DATE) > = TO_DATE ('2014-05-06 00:00:00 ',' ' YYYY-MM-DD HH24:MI:SS)

    and CAST (cn. END_TS AS DATE) < = TO_DATE ('2014-05-06 23:59:59 ',' ' YYYY-MM-DD HH24:MI:SS)

    and cn.ID between the 20141999999999999 AND 20141800000000000

    and rq.ID between the 20141999999999999 AND 20141800000000000

    ) main_req

    On tsk.parent_context_id = main_req.context_id

    and tsk. DTYPE in ('ANALYSIS_TASK', 'DECISION_TASK')

    and tsk.ID between $$ LOW_ID1 AND $$ HIGH_ID1

    ) task

    We rb.task_id = task.ID

    and rb.ID between $$ LOW_ID1 AND $$ HIGH_ID1

    and RB. TYPE is nullSELECT

    RB.ID,

    RB. DTYPE,

    RB. Version

    RB. TYPE,

    RB. CREATION_TS,

    RB. TASK_ID,

    RB. Color

    RB. GLOBAL_RESULT,

    TASK. MAIN_REQ_TYPE

    Of

    PAS_RESULTBLOCK RB

    Join

    (

    Select tsk.ID, tsk. TYPE, main_req_type main_req.

    of tsk PAS_REQUEST

    Join

    (

    Select cn.id as context_id, rq. TYPE main_req_type

    of PAS_REQUEST rq

    Cn PAS_CONTEXT

    where rq.id = cn.request_id

    and rq. DTYPE = "MAINREQUEST."

    and rq. TYPE in

    (

    'bgc.dar.vap.resolution.advice ',' bgc.dar.e2etest.execution ',' bgc.tbf.repair.vap', ' bgc.dar.e2etest ',.

    'bgc.dar.e2etest.intermediate.execution ',' bgc.cbm ',' bgc.dar.e2etest.preparation', ' bgc.chc.polling '.

    )

    and cn. STATUS ('FINISHED', 'CANCEL', 'TIMEOUT', 'ERROR')

    and CAST (cn. END_TS AS DATE) > = TO_DATE ('2014-05-06 00:00:00 ',' ' YYYY-MM-DD HH24:MI:SS)

    and CAST (cn. END_TS AS DATE) < = TO_DATE ('2014-05-06 23:59:59 ',' ' YYYY-MM-DD HH24:MI:SS)

    and cn.ID between the 20141999999999999 AND 20141800000000000

    and rq.ID between the 20141999999999999 AND 20141800000000000

    ) main_req

    On tsk.parent_context_id = main_req.context_id

    and tsk. DTYPE in ('ANALYSIS_TASK', 'DECISION_TASK')

    and tsk.ID between $$ LOW_ID1 AND $$ HIGH_ID1

    ) task

    We rb.task_id = task.ID

    and rb.ID between $$ LOW_ID1 AND $$ HIGH_ID1

    and RB. TYPE is not null

    and RB. TYPE IN

    (

    'bgc.dar.vap.resolution.advice ',' bgc.dar.e2etest.execution ',' bgc.tbf.repair.vap', ' bgc.dar.e2etest ',.

    'bgc.dar.e2etest.intermediate.execution ',' bgc.cbm ',' bgc.dar.e2etest.preparation', ' bgc.chc.polling '.

    )

    UNION

    SELECT

    RB.ID,

    RB. DTYPE,

    RB. Version

    RB. TYPE,

    RB. CREATION_TS,

    RB. TASK_ID,

    RB. Color

    RB. GLOBAL_RESULT,

    TASK. MAIN_REQ_TYPE

    Of

    PAS_RESULTBLOCK RB

    Join

    (

    Select tsk.ID, tsk. TYPE, main_req_type main_req.

    of tsk PAS_REQUEST

    Join

    (

    Select cn.id as context_id, rq. TYPE main_req_type

    of PAS_REQUEST rq

    Cn PAS_CONTEXT

    where rq.id = cn.request_id

    and rq. DTYPE = "MAINREQUEST."

    and rq. TYPE in

    (

    'bgc.dar.vap.resolution.advice ',' bgc.dar.e2etest.execution ',' bgc.tbf.repair.vap', ' bgc.dar.e2etest ',.

    'bgc.dar.e2etest.intermediate.execution ',' bgc.cbm ',' bgc.dar.e2etest.preparation', ' bgc.chc.polling '.

    )

    and cn. STATUS ('FINISHED', 'CANCEL', 'TIMEOUT', 'ERROR')

    and CAST (cn. END_TS AS DATE) > = TO_DATE ('2014-05-06 00:00:00 ',' ' YYYY-MM-DD HH24:MI:SS)

    and CAST (cn. END_TS AS DATE) < = TO_DATE ('2014-05-06 23:59:59 ',' ' YYYY-MM-DD HH24:MI:SS)

    and cn.ID between the 20141999999999999 AND 20141800000000000

    and rq.ID between the 20141999999999999 AND 20141800000000000

    ) main_req

    On tsk.parent_context_id = main_req.context_id

    and tsk. DTYPE in ('ANALYSIS_TASK', 'DECISION_TASK')

    and tsk.ID between $$ LOW_ID1 AND $$ HIGH_ID1

    ) task

    We rb.task_id = task.ID

    and rb.ID between $$ LOW_ID1 AND $$ HIGH_ID1

    and RB. TYPE is null

    -4th query

    SELECT
    RI.ID,
    UII DTYPE,
    UII Version
    UII RESULTBLOCK_ID,
    RI.NAME,
    UII VALUE,
    UII UNIT,
    UII Color
    UII LOB_ID,
    UII CREATION_TS,
    UII SEQUENCE,
    UII DETAILLEVEL,
    RES_BLK. MAIN_REQ_TYPE
    Of
    RI PAS_RESULTITEM
    Join
    (
    Select
    rb.ID, rb. TYPE rb_type, task. TYPE as the task_type, task. pas_resultblock rb main_req_type
    Join
    (
    Select tsk.ID, tsk. TYPE, main_req_type main_req.
    of tsk PAS_REQUEST
    Join
    (
    Select cn.id as context_id, rq. TYPE main_req_type
    of PAS_REQUEST rq
    Cn PAS_CONTEXT
    where rq.id = cn.request_id
    and rq. DTYPE = "MAINREQUEST."
    and rq. TYPE in
    (
    'bgc.dar.vap.resolution.advice ',' bgc.dar.e2etest.execution ',' bgc.tbf.repair.vap', ' bgc.dar.e2etest ',.
    'bgc.dar.e2etest.intermediate.execution ',' bgc.cbm ',' bgc.dar.e2etest.preparation', ' bgc.chc.polling '.
    )
    and cn. STATUS ('FINISHED', 'CANCEL', 'TIMEOUT', 'ERROR')
    and CAST (cn. END_TS AS DATE) > = TO_DATE ('2014-05-06 00:00:00 ',' ' YYYY-MM-DD HH24:MI:SS)
    and CAST (cn. END_TS AS DATE) < = TO_DATE ('2014-05-06 23:59:59 ',' ' YYYY-MM-DD HH24:MI:SS)
    and cn.ID between the 20141999999999999 AND 20141800000000000
    and rq.ID between the 20141999999999999 AND 20141800000000000
    ) main_req
    On tsk.parent_context_id = main_req.context_id
    and tsk. DTYPE in ('ANALYSIS_TASK', 'DECISION_TASK')
    and tsk.ID between the 20141999999999999 AND 20141800000000000
    ) task
    We rb.task_id = task.ID
    and rb.ID between the 20141999999999999 AND 20141800000000000
    and RB. TYPE IN
    (
    'bgc.dar.vap.resolution.advice ',' bgc.dar.e2etest.execution ',' bgc.tbf.repair.vap', ' bgc.dar.e2etest ',.
    'bgc.dar.e2etest.intermediate.execution ',' bgc.cbm ',' bgc.dar.e2etest.preparation', ' bgc.chc.polling '.
    )
    ) res_blk
    On ri.resultblock_id = res_blk.ID
    where IN RI.NAME
    (
    'bgc.dar.vap.resolution.advice ',' bgc.dar.e2etest.execution ',' bgc.tbf.repair.vap', ' bgc.dar.e2etest ',.
    'bgc.dar.e2etest.intermediate.execution ',' bgc.cbm ',' bgc.dar.e2etest.preparation', ' bgc.chc.polling '.
    )
    and RI.ID between the 20141999999999999 AND 20141800000000000
    and RI.NAME is not null
    UNION

    Select
    RI.ID,
    UII DTYPE,
    UII Version
    UII RESULTBLOCK_ID,
    RI.NAME,
    UII VALUE,
    UII UNIT,
    UII Color
    UII LOB_ID,
    UII CREATION_TS,
    UII SEQUENCE,
    UII DETAILLEVEL,
    RES_BLK. MAIN_REQ_TYPE
    of pas_resultitem ri
    Join
    (
    Select
    rb.ID, rb. TYPE rb_type, task. TYPE as the task_type, task. pas_resultblock rb main_req_type
    Join
    (
    Select tsk.ID, tsk. TYPE, main_req_type main_req.
    of tsk PAS_REQUEST
    Join
    (
    Select cn.id as context_id, rq. TYPE main_req_type
    of PAS_REQUEST rq
    Cn PAS_CONTEXT
    where rq.id = cn.request_id
    and rq. DTYPE = "MAINREQUEST."
    and rq. TYPE in
    (
    'bgc.dar.vap.resolution.advice ',' bgc.dar.e2etest.execution ',' bgc.tbf.repair.vap', ' bgc.dar.e2etest ',.
    'bgc.dar.e2etest.intermediate.execution ',' bgc.cbm ',' bgc.dar.e2etest.preparation', ' bgc.chc.polling '.
    )
    and cn. STATUS ('FINISHED', 'CANCEL', 'TIMEOUT', 'ERROR')
    and CAST (cn. END_TS AS DATE) > = TO_DATE ('2014-05-06 00:00:00 ',' ' YYYY-MM-DD HH24:MI:SS)
    and CAST (cn. END_TS AS DATE) < = TO_DATE ('2014-05-06 23:59:59 ',' ' YYYY-MM-DD HH24:MI:SS)
    and cn.ID between the 20141999999999999 AND 20141800000000000
    and rq.ID between the 20141999999999999 AND 20141800000000000
    ) main_req
    On tsk.parent_context_id = main_req.context_id
    and tsk. DTYPE in ('ANALYSIS_TASK', 'DECISION_TASK')
    and tsk.ID between the 20141999999999999 AND 20141800000000000
    ) task
    We rb.task_id = task.ID
    and rb.ID between the 20141999999999999 AND 20141800000000000
    ) res_blk
    On ri.resultblock_id = res_blk.ID
    where RI.ID between 20141800000000000 20141999999999999 AND
    and RI.NAME is null

    -REQUEST OF 5HT

    SELECT

    TSK.ID,

    TSK. Version

    TSK. DTYPE,

    TSK. CASE_ID,

    TSK. TYPE,

    TSK. CORRELATION_ID,

    TSK. INITIATOR,

    TSK. EXECUTOR,

    TSK. CATEGORY,

    TSK. PARENT_CONTEXT_ID,

    TSK. CREATION_TS,

    MAIN_REQ. MAIN_REQ_TYPE

    Of

    TSK PAS_REQUEST

    Join

    (

    Select cn.id as context_id, rq. TYPE main_req_type

    of PAS_REQUEST rq

    Cn PAS_CONTEXT

    where rq.id = cn.request_id

    and rq. DTYPE = "MAINREQUEST."

    and rq. TYPE in

    (

    'bgc.dar.vap.resolution.advice ',' bgc.dar.e2etest.execution ',' bgc.tbf.repair.vap', ' bgc.dar.e2etest ',.

    'bgc.dar.e2etest.intermediate.execution ',' bgc.cbm ',' bgc.dar.e2etest.preparation', ' bgc.chc.polling '.

    )

    and cn. STATUS ('FINISHED', 'CANCEL', 'TIMEOUT', 'ERROR')

    and CAST (cn. END_TS AS DATE) > = TO_DATE ('2014-05-06 00:00:00 ',' ' YYYY-MM-DD HH24:MI:SS)

    and CAST (cn. END_TS AS DATE) < = TO_DATE ('2014-05-06 23:59:59 ',' ' YYYY-MM-DD HH24:MI:SS)

    and cn.ID between the 20141999999999999 AND 20141800000000000

    and rq.ID between the 20141999999999999 AND 20141800000000000

    ) main_req

    On tsk.parent_context_id = main_req.context_id

    and tsk. DTYPE in ('ANALYSIS_TASK', 'DECISION_TASK')

    and tsk.ID between $$ LOW_ID1 AND $$ HIGH_ID1

    UNION

    Select

    MREQ.ID,

    MREQ. Version

    MREQ. DTYPE,

    MREQ. CASE_ID,

    MREQ. TYPE,

    MREQ. CORRELATION_ID,

    MREQ. INITIATOR,

    MREQ. EXECUTOR,

    MREQ. CATEGORY,

    MREQ. PARENT_CONTEXT_ID,

    MREQ. CREATION_TS,

    MREQ. TYPE

    of PAS_REQUEST mreq

    Cn PAS_CONTEXT

    where mreq.id = cn.request_id

    and mreq. DTYPE = "MAINREQUEST."

    and mreq. TYPE in

    (

    'bgc.dar.vap.resolution.advice ',' bgc.dar.e2etest.execution ',' bgc.tbf.repair.vap', ' bgc.dar.e2etest ',.

    'bgc.dar.e2etest.intermediate.execution ',' bgc.cbm ',' bgc.dar.e2etest.preparation', ' bgc.chc.polling '.

    )

    and cn. STATUS ('FINISHED', 'CANCEL', 'TIMEOUT', 'ERROR')

    and CAST (cn. END_TS AS DATE) > = TO_DATE ('2014-05-06 00:00:00 ',' ' YYYY-MM-DD HH24:MI:SS)

    and CAST (cn. END_TS AS DATE) < = TO_DATE ('2014-05-06 23:59:59 ',' ' YYYY-MM-DD HH24:MI:SS)

    and cn.ID between the 20141999999999999 AND 20141800000000000

    and mreq.ID between the 20141999999999999 AND 20141800000000000

    Tips will be may not be necessary (proportional to the cardinalities need)


    Select pc.id, pc.dtype, pc.version, pc.external_ref, pc.creation_ts, rq.type

    from pas_case

    as_request rq,

    CN pas_context

    where rq.case_id = pc.id

    and rq.id = cn.request_id

    and rq.dtype = 'MAINREQUEST. '

    and rq.type in ('bgc.dar.vap.resolution.advice ',' bgc.dar.e2etest.execution', ' bgc.tbf.repair.vap',

    'bgc.dar.e2etest ',' bgc.dar.e2etest.intermediate.execution', ' bgc.cbm ',.

    'bgc.dar.e2etest.preparation ','bgc.chc.polling '.

    )

    and cn.status in ('FINISHED', 'CANCEL', 'TIMEOUT', 'ERROR')

    and cn.creation_ts > = to_timestamp ('2014-05-06 00:00:00 ',' yyyy-mm-dd hh24:mi:ss')

    and cn.creation_ts<= to_timestamp('2014-05-06="" 23:59:59.999999','yyyy-mm-dd="">

    -2nd request

    with

    main_request as

    (select / * + materialize * /)

    CN.ID as context_id, rq.type as main_req_type

    of pas_request rq

    Join

    CN pas_context

    On rq.id = cn.request_id

    and rq.dtype = 'MAINREQUEST. '

    and rq.type in ('bgc.dar.vap.resolution.advice ',' bgc.dar.e2etest.execution', ' bgc.chc.polling',

    'bgc.tbf.repair.vap ',' bgc.dar.e2etest', ' bgc.dar.e2etest.intermediate.execution ',.

    'bgc.cbm ','bgc.dar.e2etest.preparation '.

    )

    and cn.status in ('FINISHED', 'CANCEL', 'TIMEOUT', 'ERROR')

    and cn.end_ts > = to_timestamp ('2014-05-06 00:00:00 ',' yyyy-mm-dd hh24:mi:ss')

    and cn.end_ts<= to_timestamp('2014-05-06="" 23:59:59.999999','yyyy-mm-dd="">

    and cn.id between 20141800000000000 and 20141999999999999

    and rq.id between 20141800000000000 and 20141999999999999

    )

    Select ra.id, ra.version, ra.request_id, ra.name, ra.value, ra.lob_id, ra.dtype, ra.creation_ts, task.main_req_type

    of pas_requestattribute ra

    Join

    (select tsk.id, tsk.type, main_req.main_req_type

    from pas_request tsk

    Join

    main_request main_req

    On tsk.parent_context_id = main_req.context_id

    and tsk.dtype in ('ANALYSIS_TASK', 'DECISION_TASK')

    and tsk.id between $$ low_id1 and $$ high_id1

    ) task

    We ra.request_id = task.id

    and ra.id between $$ low_id1 and $$ high_id1

    Union

    Select ra.id, ra.version, ra.request_id, ra.name, ra.value, ra.lob_id, ra.dtype, ra.creation_ts, main_req.type

    of pas_requestattribute ra

    Join

    main_request main_req

    On ra.request_id = main_req.context_id

    -3rd request

    Select rb.id, rb.dtype, rb.version, rb.type, rb.creation_ts, rb.task_id, rb.color, rb.global_result, task.main_req_type

    of pas_resultblock rb

    Join

    (select tsk.id, tsk.type, main_req.main_req_type

    from pas_request tsk

    Join

    (select cn.id as context_id, rq.type as main_req_type

    of pas_request rq

    Join

    CN pas_context

    On rq.id = cn.request_id

    and rq.dtype = 'MAINREQUEST. '

    and rq.type in ('bgc.dar.vap.resolution.advice ','bgc.dar.e2etest.execution ',

    'bgc.tbf.repair.vap ','bgc.dar.e2etest ',.

    'bgc.dar.e2etest.intermediate.execution ','bgc.cbm ',.

    'bgc.dar.e2etest.preparation ','bgc.chc.polling '.

    )

    and cn.status in ('FINISHED', 'CANCEL', 'TIMEOUT', 'ERROR')

    and cn.end_ts > = to_timestamp ('2014-05-06 00:00:00 ',' yyyy-mm-dd hh24:mi:ss')

    and cn.end_ts<= to_timestamp('2014-05-06="" 23:59:59.999999','yyyy-mm-dd="">

    and cn.id between 20141800000000000 and 20141999999999999

    and rq.id between 20141800000000000 and 20141999999999999

    ) main_req

    On tsk.parent_context_id = main_req.context_id

    and tsk.dtype in ('ANALYSIS_TASK', 'DECISION_TASK')

    and tsk.id between $$ low_id1 and $$ high_id1

    ) task

    We rb.task_id = task.id

    and rb.id between $$ low_id1 and $$ high_id1

    where the type is null

    or (type is not null

    type in ('bgc.dar.vap.resolution.advice ',' bgc.dar.e2etest.execution ', ' bgc.tbf.repair.vap',

    'bgc.dar.e2etest ',' bgc.dar.e2etest.intermediate.execution', ' bgc.cbm ',.

    'bgc.dar.e2etest.preparation ','bgc.chc.polling '.

    )

    )

    -4th query

    Select ri.id, ri.dtype, ri.version, ri.resultblock_id, ri.name, ri.value, ri.unit, ri.color, ri.lob_id.

    RI.creation_ts, RI. Sequence, RI. DetailLevel, res_blk.main_req_type

    of pas_resultitem ri

    Join

    (select rb.id, rb.type as rb_type, task.type as task_type, task.main_req_type)

    of pas_resultblock rb

    Join

    (select main_req_type, tsk.id, tsk.type, main_req.)

    from pas_request tsk

    Join

    (select cn.id as context_id, rq.type as main_req_type

    of pas_request rq

    Join

    CN pas_context

    On rq.id = cn.request_id

    and rq.dtype = 'MAINREQUEST. '

    and rq.type in ('bgc.dar.vap.resolution.advice ','bgc.dar.e2etest.execution ',

    'bgc.tbf.repair.vap ','bgc.dar.e2etest ',.

    'bgc.dar.e2etest.intermediate.execution ','bgc.cbm ',.

    'bgc.dar.e2etest.preparation ','bgc.chc.polling '.

    )

    and cn.status in ('FINISHED', 'CANCEL', 'TIMEOUT', 'ERROR')

    and cn.end_ts > = to_timestamp ('2014-05-06 00:00:00 ',' yyyy-mm-dd hh24:mi:ss')

    and cn.end_ts<= to_timestamp('2014-05-06="" 23:59:59.999999','yyyy-mm-dd="">

    and cn.id between 20141800000000000 and 20141999999999999

    and rq.id between 20141800000000000 and 20141999999999999

    ) main_req

    On tsk.parent_context_id = main_req.context_id

    and tsk.dtype in ('ANALYSIS_TASK', 'DECISION_TASK')

    and tsk.id between 20141800000000000 and 20141999999999999

    ) task

    We rb.task_id = task.id

    and rb.id between 20141800000000000 and 20141999999999999

    and rb.type in ('bgc.dar.vap.resolution.advice ',' bgc.dar.e2etest.execution', ' bgc.tbf.repair.vap',

    'bgc.dar.e2etest ',' bgc.dar.e2etest.intermediate.execution', ' bgc.cbm ',.

    'bgc.dar.e2etest.preparation ','bgc.chc.polling '.

    )

    ) res_blk

    On ri.resultblock_id = res_blk.id

    and ri.id between 20141800000000000 and 20141999999999999

    where ri.name is null

    or (ri.name is not null

    and ri.name in ('bgc.dar.vap.resolution.advice ',' bgc.dar.e2etest.execution', ' bgc.tbf.repair.vap',

    'bgc.dar.e2etest ',' bgc.dar.e2etest.intermediate.execution', ' bgc.cbm ',.

    'bgc.dar.e2etest.preparation ','bgc.chc.polling '.

    )

    )

    -5th application

    with

    main_request as

    (select / * + materialize * / )

    mreq.ID, mreq.version, mreq.dtype, mreq.case_id, mreq.type, mreq.correlation_id, mreq. Initiator, mreq. Executor,

    mreq. Category, mreq.parent_context_id, mreq.creation_ts, mreq.type

    of pas_request mreq

    Join

    CN pas_context

    On mreq.id = cn.request_id

    and mreq.dtype = 'MAINREQUEST. '

    and mreq.type in ('bgc.dar.vap.resolution.advice ',' bgc.dar.e2etest.execution', ' bgc.tbf.repair.vap',

    'bgc.dar.e2etest ',' bgc.dar.e2etest.intermediate.execution', ' bgc.cbm ',.

    'bgc.dar.e2etest.preparation ','bgc.chc.polling '.

    )

    and cn.status in ('FINISHED', 'CANCEL', 'TIMEOUT', 'ERROR')

    and cn.end_ts > = to_timestamp ('2014-05-06 00:00:00 ',' yyyy-mm-dd hh24:mi:ss')

    and cn.end_ts<= to_timestamp('2014-05-06="" 23:59:59.999999','yyyy-mm-dd="">

    and cn.id between 20141800000000000 and 20141999999999999

    and mreq.id between 20141800000000000 and 20141999999999999

    )

    Select tsk.id, tsk.version, tsk.dtype, tsk.case_id, tsk.type, tsk.correlation_id, tsk.initiator, tsk.executor,

    TSK. Category, tsk.parent_context_id, tsk.creation_ts, main_req.main_req_type

    from pas_request tsk

    Join

    main_request main_req

    On tsk.parent_context_id = main_req.id

    and tsk.dtype in ('ANALYSIS_TASK', 'DECISION_TASK')

    and tsk.id between $$ low_id1 and $$ high_id1

    Union

    SELECT id, version, dtype, case_id, type, correlation_id, initiator, executor,

    category, type parent_context_id, creation_ts

    of main_request

    Concerning

    Etbin

Maybe you are looking for

  • change the illustrations of artists

    Hello everyone. I write this post because the other post I wrote earlier was perhaps not in the right forum. So my question: I would like to change the pictures in the list of my artists on my iPod touch 5th generation (32gigs). However, when I try t

  • I get an error 51(f) on KB2598290 and KB2598306 updates

    I get an error 51(f) on KB2598290 and KB2598306 updates

  • Whenever I try to open Outlook Express, I get this message: Run Time Error! Program: C\Program

    original title: cannot open outlook express I am running windows XP Professional Whenever I try to open outlook express, I get this message Run Time Error!  Program: C\Program... This application has requested the execution in an unusual way. Please

  • image appears...

    Hi all Here is the code example in which I want to display the image for the 5seconds which does not appear. package com.samples; Import net.rim.device.api.ui.UiApplication; public class SplashProject extends UiApplication { public SplashProject() {

  • BBM how to contact

    Hi guys can someone he point how can I make someone a contact and then cat? Thank you very much! Because I'm a bit lost!