Case with other tables using

Hi all

I have a query like the following:
SELECT mydate Date_REC, SUM(d_num) intake, to_char(to_date(mydate, 'fmDD/MM/YYYY'), 'fmD') Daynum, to_char(to_date(mydate, 'fmDD/MM/YYYY'), 'DY') Day from (
SELECT
(case when to_char(to_date(date_rec, 'fmDD/MM/YYYY'), 'fmD') = '7' then to_date(date_rec, 'fmDD/MM/YYYY')+2 when to_char(to_date(date_rec, 'fmDD/MM/YYYY'), 'fmD') = '1' then to_date(date_rec, 'fmDD/MM/YYYY')+1 else to_date(date_rec, 'fmDD/MM/YYYY') end) as mydate,
...
...
FROM
tableA a LEFT JOIN tableB b
On.. etc
Essentially, when results are taken, dates are verified for each line, and if it's Saturday (day = 7) while the date is replaced by a Monday (2 days). If it is a Sunday (day = 1) + 1 day is added to make a Monday. This seems to work ok and is exactly what I want to see in the grouped results.

Now, in addition, I want to draw in another table, called 'holiday '. It is a list of holidays, with the structure (Date, Description).

My requirements for each line are:

Check if the date is a Saturday, a Sunday or a day in the holidays table. If one of these is true, I want the date to become the next business day as long as it is not also in the calendar of public holidays.

Can someone help me to modify my query for this? It's getting a bit complicated for me now... :)

It is for use in an Application Express 4.0, Oracle 11 g.

Thank you very much!

pearlyred wrote:
It's a lot of maintenance if

Really? The statement below prefills table calendar up to the year 2100 with indicator of day of week/weekend in two tenth of a second:

create table calendar
  as
    select  date '2012-12-31' + level cal_date,
            case date '2012-12-31' + level - trunc(date '2012-12-31' + level,'iw')
              when 6 then 'W'
              when 5 then 'W'
              else 'D'
           end indicator
      from  dual
      connect by date '2012-12-31' + level < date '2100-01-01'
/

Table created.

Elapsed: 00:00:00.20
SQL>

All you need now is to update with the holidays which is the same service as your party table.

SY.

Tags: Database

Similar Questions

  • Functions Pipeline Table with other tables using

    I'm on DB 11.2.0.2 and used sparingly in pipeline table functions, but plans to arrays for a project that has a pretty big (many lines). In my tests, selecting from the table in pipeline perform well enough (if it's directly from the table pipleined or the view from above, I have created). Where I start to see some degregation when I try to join the tabe in pipeline discovered at other tables and add where conditions.

    Download

    SELECT A.empno, A.empname, A.job, B.sal

    OF EMP_VIEW A, B OF THE EMP

    WHERE A.empno = B.empno AND

    B.Mgr = '7839'

    I've seen articles and blogs that mention this as a matter of cardinality and offer some undocumented methods to try to fight.

    Can someone please give me some tips or tricks on this. Thank you!

    I created a simple example using the emp table below to help illustrate what I'm doing.

    DROP TYPE EMP_TYPE;

    DROP TYPE EMP_SEQ;

    CREATE OR REPLACE TYPE EMP_SEQ AS OBJECT

    (EMPNO NUMBER (10),)

    ENAME VARCHAR2 (100),

    VARCHAR2 (100)) WORK;

    /

    CREATE OR REPLACE TYPE EMP_TYPE AS TABLE EMP_SEQ;

    /

    FUNCTION to CREATE or REPLACE get_emp back EMP_TYPE PIPELINED AS

    BEGIN

    TO heart (SELECT IN

    EmpNo,

    Ename,

    job

    WCP

    )

    LOOP

    PIPE ROW (EMP_SEQ (cur.empno,

    cur. Ename,

    cur.job));

    END LOOP;

    RETURN;

    END get_emp;

    /

    create or REPLACE view EMP_VIEW select * from table (get_emp ());

    /

    SELECT A.empno, A.empname, A.job, B.sal

    OF EMP_VIEW A, B OF THE EMP

    WHERE A.empno = B.empno AND

    B.Mgr = '7839'

    bobmagan wrote:

    The ability to join would give me the most flexibility.

    Pipelines can be attached. But here is the PL/SQL code - no tables. And without index.

    Consider a view:

    create or replace view sales_personel in select * from emp where job_type = 'SALES '.

    And you use the view to determine the sellers in department 123:

    Select * from sales_personel where dept_id = 123

    Oracle considers that logically the next SQL statement like her can be pushed in the view:

    select * from emp where job_type = 'SALES' and dept_id = 123


    If the two columns in the filter are indexed for example, he may well decide to use a fusion of index to determine what EMP lines are dirty and department 123.

    Now consider the same exact scenario with a pipeline. The internal process of pipelines are opaque to the SQL engine. He can't say the internal code pipeline "Hey, don't give me employees service 123".

    He needs to run the pipeline. It must evaluate each channeled line and apply the "dept_id = 123" predicate. In essence, you must treat the complete pipeline as a table scan. And a slow that it take more than a simple disc lines when you perform the transformation of data too.

    So yes - you can use the predicates on the pipelines, can join them, use analytical SQL and so immediately - but expect it to behave like a table in terms of optimization of SQL/CBO, is not realistic. And pointing to a somewhat flawed understanding of what a pipeline is and how it should be designed and used.

  • FDQM write back to the EBS with other tables as GL

    Hello

    Please, I need a confirmation on FDQM: if it is possible to rewrite data from Hyperion Planning (Essbase) in EBS with other tables that GL using standard features FDQM (tables of EBS EBS sourcing purchases tables etc.).
    FDQM ERPI-write is limited to the EBS GL.

    Or write in EBS, I use ODI.

    I thank you and appreciate your input!
    Robert

    Hello

    Certainly, you can write additional scripts to do the job you are looking for. Unfortunately the only "out of the box solution" is mentioned above.

    Thank you

  • Since the last update the Facebook and Twitter embarks on a site that I use often went empty. This is not the case with other browsers.

    "Living foods" to Twitter and Facebook on a site that I use frequently have only a title but no content 'feed '. I think that this problem started 3 days ago, when Firefox has been updated. The problem is not present in using another browser and not on the phones or tablets.

    One of the changes in Firefox 42 title adds a blocker follow-up in private browsing windows. That type of filtering may affect integrated features of the social site.

    If you use private windows, you can disable the functionality of anti-tracking on the Options page as a test. This article contains more information on where to find this setting: the Tracking in private browsing Protection.

    If the problem occurs in windows common, hmm... I think you have already tested in Firefox Safe Mode, but if not:

    In Safe Mode, Firefox disables extensions, hardware acceleration, and a few other advanced features to help you determine if they are at the origin of the problem.

    Does not work if Firefox: Hold down the SHIFT key when you start Firefox.

    If Firefox is running: You can restart Firefox in Mode safe mode using either:

    • button "3-bar" menu > "?" button > restart with disabled modules
    • Help menu > restart with disabled modules

    and OK reboot.

    Two scenarios: A small dialog box should appear. Click on 'Start mode safe' (not update).

    Any improvement?

  • SQL with the Table using nested

    Hello

    Please help how to do that thing

    I have a nested table of object type

    create or replace type a1 as an object

    (

    a number,

    b varchar2 (30),

    VARCHAR2 (30) region

    );

    create table a1 type a1_array s;

    declare

    v_a1 a1;

    v_a1_array a1_array:=a1_array();

    Start

    v_a1 = a1 (1, '1', 'AUS');

    v_a1_array. EXTEND;

    v_a1_array (1): = v_a1;

    v_a1 = a1 (2, '2', 'AUS');

    v_a1_array. EXTEND;

    v_a1_array (2): = v_a1;

    v_a1 = a1 (3, '3', 'NAM');

    v_a1_array. EXTEND;

    v_a1_array (3): = v_a1;

    end;

    Now, I v_a1_array have 3 row 2 with region AUS and the other with NAM region.

    SQL help can I get lines only "AUS" and look in the TABLE OF TYPE v_a1_array (using Where clause and functions (Table))

    Any help will be much appreciated. Please help. I have Oracle 11g

    Thank you

    I hope that you are looking for this.

    pretend like your excel temp (with clause)

    v_a2 - is a type of a1_array

    SQL > select * from v version $;

    BANNER
    --------------------------------------------------------------------------------
    Oracle Database 11 g Enterprise Edition Release 11.2.0.2.0 - 64 bit Production
    PL/SQL Release 11.2.0.2.0 - Production
    CORE Production 11.2.0.2.0
    AMT for Linux: Version 11.2.0.2.0 - Production
    NLSRTL Version 11.2.0.2.0 - Production

    SQL > DROP TYPE a1_array;

    Type fell.

    SQL > DROP TYPE a1;

    Type fell.

    SQL > CREATE or REPLACE TYPE a1 AS OBJECT
    2 (a NUMBER, b VARCHAR2 (30), region VARCHAR2 (30));
    3.

    Type of creation.

    SQL > CREATE TYPE a1_array IS TABLE of a1;
    2.

    Type of creation.

    SQL > DECLARE
    v_a1 2 a1_array;
    3 v_a2 a1_array;
    4 BEGIN
    5 WITH temp
    6 AS (SELECT 1 a, 1 b, "AUS" AS region FROM DUAL
    7 UNION ALL
    8. SELECT 2 AS a, 2 b, "AUS" AS region FROM DUAL
    9 UNION ALL
    10. SELECT 3 a, b '3', 'NAM' AS region OF DOUBLE)
    11. SELECT a1 (x.a, x.b, x.region)
    In BULK 12 COLLECT IN v_a1
    Temp 13 x;
    14
    15 SELECT a1 (x.a, x.b, x.region)
    In BULK 16 COLLECT IN v_a2
    TABLE (v_a1) 17 x
    18 WHERE x.region = 'NAM ';
    19
    20
    21 FOR I IN 1... v_a2. COUNTY
    22 LOOP
    (23) DBMS_OUTPUT.put_line
    24 v_a2 (i) .a | '-' || v_a2 (i) .b | '-' || v_a2 (i) .region);
    25 END OF LOOP;
    26 END;
    27.
    3-3-NAM

    PL/SQL procedure successfully completed.

    SQL > spool off;

  • How do the mulitple itemset column union with other tables

    Hello

    I have the following table, called set as below,

    A
    --------------------------
    1; 10; 2; 3; 4; 5; 7; 8
    10; 2; 3; 4; 5; 8; 9
    10; 2; 3; 4; 8; 9

    and another table called temp as below,

    B
    -------------------
    1
    2
    6

    and need to find the union of these 2 tables as below,

    A---------------------| B | A Union B
    -------------------------------------------------------------------
    1; 10; 2; 3; 4; 5; 7; 8. 1 | ; 1; 10; 2; 3; 4; 5; 7; 8
    1; 10; 2; 3; 4; 5; 7; 8. 2 | ; 1; 10; 2; 3; 4; 5; 7; 8
    1; 10; 2; 3; 4; 5; 7; 8. 6 | ; 1; 10; 2; 3; 4; 5; 7; 8; 6

    10; 2; 3; 4; 5; 8; 9. 1 | ; 10; 2; 3; 4; 5; 8; 9; 1
    10; 2; 3; 4; 5; 8; 9. 2 | ; 10; 2; 3; 4; 5; 8; 9
    10; 2; 3; 4; 5; 8; 9. 6 | ; 10; 2; 3; 4; 5; 8; 9; 6

    10; 2; 3; 4; 8; 9. 1 | ; 10; 2; 3; 4; 8; 9; 1
    10; 2; 3; 4; 8; 9. 2 | ; 10; 2; 3; 4; 8; 9
    10; 2; 3; 4; 8; 9. 6 | ; 10; 2; 3; 4; 8; 9; 6



    any help please,.

    Published by: user11309581 on June 26, 2011 22:43

    Published by: user11309581 on June 26, 2011 22:47
    with a as (
               select ';1;10;2;3;4;5;7;8' str from dual union all
               select ';10;2;3;4;5;8;9' from dual union all
               select ';10;2;3;4;8;9' from dual
              ),
         b as (
               select '1' str from dual union all
               select '2' from dual union all
               select '6' from dual
              )
    -- end of on-the-fly data sample
    select  a.str,
            b.str,
            case
              when a.str || ';' like '%;' || b.str || ';%' then a.str
              else a.str || ';' || b.str
            end combined_str
      from  a,
            b
    /
    
    STR               S COMBINED_STR
    ----------------- - -------------------
    ;1;10;2;3;4;5;7;8 1 ;1;10;2;3;4;5;7;8
    ;1;10;2;3;4;5;7;8 2 ;1;10;2;3;4;5;7;8
    ;1;10;2;3;4;5;7;8 6 ;1;10;2;3;4;5;7;8;6
    ;10;2;3;4;5;8;9   1 ;10;2;3;4;5;8;9;1
    ;10;2;3;4;5;8;9   2 ;10;2;3;4;5;8;9
    ;10;2;3;4;5;8;9   6 ;10;2;3;4;5;8;9;6
    ;10;2;3;4;8;9     1 ;10;2;3;4;8;9;1
    ;10;2;3;4;8;9     2 ;10;2;3;4;8;9
    ;10;2;3;4;8;9     6 ;10;2;3;4;8;9;6
    
    9 rows selected.
    
    SQL>  
    

    SY.

  • ADF interview panel with tree Table - add fields

    I created ADF query Panel with tree Table using JDeveloper 11 G. Under the terms of the research advance, add fields only drop-down list the fields in the primary table. My questions are,

    (1) can I search fields in the secondary table? If so, how can I do it?

    (2) how can I customize this drop-down list? Currently it shows just the whole view of the main table with unnecessary data type id.

    Thanks in advance.

    Published by: type on November 9, 2009 09:21

    Hi, I've just uploaded a few screenshots here: http://blog.jangvijay.org/2009/11/step-1-expose-accessor-to-child-vo-in.html
    Sorry if you found my previous answer not clear... :)

  • Cannot compare a line with other lines in a table... (comparison of many to many)

    Hi all..
    I am very new to PL/SQL...
    I need through through a table to compare its lines with the table with the other lines. For that I'm trying to use Pl/sql below.
    -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    create or replace compare()
    Declare
    VAR_HIT CHAR (1);
    SEARCH_RECORD_DATA UDB.table1%ROWTYPE;
    CANDIDATE_RECORD_DATA UDB.table1%ROWTYPE;
    CURSOR SEARCH_RECORDS_CURSOR IS SELECT * FROM UDB.table1 by registration_id;
    CURSOR CANDIDATE_RECORDS_CURSOR IS SELECT * FROM UDB.table1 by registration_id;
    BEGIN
    FOR SEARCH_RECORD_DATA IN SEARCH_RECORDS_CURSOR LOOP
    FOR CANDIDATE_RECORD_DATA IN CANDIDATE_RECORDS_CURSOR LOOP
    IF (CANDIDATE_RECORD_DATA. THE DECISION = 'P') THEN
    VAR_HIT: = 'y ';
    IF (CANDIDATE_RECORD_DATA. First_name! = 'unknown') AND (CANDIDATE_RECORD_DATA. FIRST_NAME! = SEARCH_RECORD_DATA. FIRST_NAME) THEN
    VAR_HIT: = 'n';
    ELSIF (CANDIDATE_RECORD_DATA. Last_name! = 'unknown') AND (CANDIDATE_RECORD_DATA. LAST_NAME! = SEARCH_RECORD_DATA. LAST_NAME) THEN
    VAR_HIT: = 'n';
    ELSIF (CANDIDATE_RECORD_DATA. BIRTH_DATE! = 'unknown') AND (CANDIDATE_RECORD_DATA. BIRTH_DATE! = SEARCH_RECORD_DATA. BIRTH_DATE) THEN
    VAR_HIT: = 'n';
    ELSIF (CANDIDATE_RECORD_DATA. GENDER EQUALITY! = 'U') AND (CANDIDATE_RECORD_DATA. SEX! = SEARCH_RECORD_DATA. SEX) THEN
    VAR_HIT: = 'n';
    ELSIF (CANDIDATE_RECORD_DATA. FATHER_NAME! = 'unknown') AND (CANDIDATE_RECORD_DATA. FATHER_NAME! = SEARCH_RECORD_DATA. FATHER_NAME) THEN
    VAR_HIT: = 'n';
    ELSIF (CANDIDATE_RECORD_DATA. MOTHER_NAME! = 'unknown') AND (CANDIDATE_RECORD_DATA. MOTHER_NAME! = SEARCH_RECORD_DATA. MOTHER_NAME) THEN
    VAR_HIT: = 'n';
    END IF;
    IF(VAR_HIT='y') THEN
    INSERT IN THE UDB. VALUES OF (REGISTRATION_ID, SEARCH_ID, HIT_CANDIDATE_ID, SEARCH_DETAILS, CANDIDATE_DETAILS) BIO_DI_HIT_RESULT (SEARCH_RECORD_DATA. REGISTRATION_ID, SEARCH_RECORD_DATA. EGM_NO, CANDIDATE_RECORD_DATA. EGM_NO, VAR_SEARCH_DETAILS, VAR_CANDIDATE_DETAILS);
    UPDATE UDB. SET BIO_RECORDS_DEMOGRAPHICS = A DECISION ';
    END IF;
    END IF;
    END LOOP;
    commit;
    END LOOP;
    END;

    --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    Outer loop works well (it is raversing throughout the table) is (say by 8000 saves 8,000 times)
    But Enner loop does not work fine e.i. it runs just for 8000 times for 8000 records. While it must run more time then 8000...
    Can someone help me...
    Is the way to use two cursor on a table to compare each line of the report is correct? :(

    >

    But even once come with a problem more in the part of sql, I shared. It does not cover part of my State... :(
    --> If the secondary search field are 'unknown' this field (please AVI single field not as search folder) will not be considered as search criteria.
    But in my current sql, all the side of any field research as "unknown" is not even taken to search for any candidate for other fields match.

    Try to change all the terms in this way (I show here only how to change a condition):

    Instead of:

    AND (SEARCH.BIRTH_DATE!='unknown' AND CANDIDATE.BIRTH_DATE IN (SEARCH.BIRTH_DATE,'unknown'))
    

    Use this one:

    AND (SEARCH.BIRTH_DATE = 'unknown' OR CANDIDATE.BIRTH_DATE IN (SEARCH.BIRTH_DATE,'unknown'))
    

    In the case of the search.birthdate condition will be 'unknown', it will be ignored, otherwise this condition will be used.

  • Slow index by using the query. Fast with full table Scan.

    Salvation;

    (Thanks for the links)

    Here's my question correctly formatted.

    The query:
    SELECT count(1)
    from ehgeoconstru  ec 
    where ec.TYPE='BAR'  
    AND ( ec.birthDate <= TO_DATE('2009-10-06 11:52:12', 'YYYY-MM-DD HH24:MI:SS') )   
    and deathdate is null 
    and substr(ec.strgfd, 1, length('[CIMText')) <> '[CIMText'
    Works on 32 seconds!


    Same query, but with an extra where clause:
    SELECT count(1)
    from ehgeoconstru  ec 
    where ec.TYPE='BAR'  
    and  ( (ec.contextVersion = 'REALWORLD')     --- ADDED HERE
    AND ( ec.birthDate <= TO_DATE('2009-10-06 11:52:12', 'YYYY-MM-DD HH24:MI:SS') ) )  
    and deathdate is null 
    and substr(ec.strgfd, 1, length('[CIMText')) <> '[CIMText'
    This is 400 seconds.

    It should return data from a table, given the conditions.

    The database version is Oracle9i Release 9.2.0.7.0

    These are the parameters relevant for the optimizer:
    SQL> show parameter optimizer
    
    NAME                                 TYPE        VALUE
    ------------------------------------ ----------- ------------------------------
    optimizer_dynamic_sampling           integer     1
    optimizer_features_enable            string      9.2.0
    optimizer_index_caching              integer     99
    optimizer_index_cost_adj             integer     10
    optimizer_max_permutations           integer     2000
    optimizer_mode                       string      CHOOSE
    
    SQL> 
    Here is the output of the PLAN to EXPLAIN for the first quick query:
    PLAN_TABLE_OUTPUT
    --------------------------------------------------------------------------------
    
    --------------------------------------------------------------------------------
    | Id  | Operation                     |  Name               | Rows  | Bytes | Cost  |
    --------------------------------------------------------------------------------
    |   0 | SELECT STATEMENT     |                         |           |       |       |
    |   1 |  SORT AGGREGATE       |                         |           |       |       |
    |*  2 |   TABLE ACCESS FULL   | EHCONS            |       |       |       |
    --------------------------------------------------------------------------------
    
    Predicate Information (identified by operation id):
    ---------------------------------------------------
    
    PLAN_TABLE_OUTPUT
    --------------------------------------------------------------------------------
    
       2 - filter(SUBSTR("EC"."strgfd",1,8)<>'[CIMText' AND "EC"."DEATHDATE"
                  IS NULL AND "EC"."BIRTHDATE"<=TO_DATE('2009-10-06 11:52:12', 'yyyy
    -mm-dd
    
                  hh24:mi:ss') AND "EC"."TYPE"='BAR')
    
    Note: rule based optimization
    Here is the output of the EXPLAIN of PLAN for slow queries:
    PLAN_TABLE_OUTPUT
    --------------------------------------------------------------------------------
       |       |
    
    |   1 |  SORT AGGREGATE              |                             |       |
       |       |
    
    |*  2 |   TABLE ACCESS BY INDEX ROWID| ehgeoconstru      |       |
       |       |
    
    |*  3 |    INDEX RANGE SCAN          | ehgeoconstru_VSN  |       |
       |       |
    
    
    PLAN_TABLE_OUTPUT
    --------------------------------------------------------------------------------
    Predicate Information (identified by operation id):
    ---------------------------------------------------
    2 - filter(SUBSTR("EC"."strgfd",1,8)<>'[CIMText' AND "EC"."DEATHDATE" IS
     NULL AND "EC"."TYPE"='BAR')
    
    PLAN_TABLE_OUTPUT
    --------------------------------------------------------------------------------
       3 - access("EC"."CONTEXTVERSION"='REALWORLD' AND "EC"."BIRTHDATE"<=TO_DATE('2
    009-10-06
    
                  11:52:12', 'yyyy-mm-dd hh24:mi:ss'))
           filter("EC"."BIRTHDATE"<=TO_DATE('2009-10-06 11:52:12', 'yyyy-mm-dd hh24:
    mi:ss'))
    
    
    Note: rule based optimization
    The TKPROF output for this slow statement is:
    TKPROF: Release 9.2.0.7.0 - Production on Tue Nov 17 14:46:32 2009
    
    Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.
    
    Trace file: gen_ora_3120.trc
    Sort options: prsela  exeela  fchela  
    ********************************************************************************
    count    = number of times OCI procedure was executed
    cpu      = cpu time in seconds executing 
    elapsed  = elapsed time in seconds executing
    disk     = number of physical reads of buffers from disk
    query    = number of buffers gotten for consistent read
    current  = number of buffers gotten in current mode (usually for update)
    rows     = number of rows processed by the fetch or execute call
    ********************************************************************************
    
    SELECT count(1)
    from ehgeoconstru  ec
    where ec.TYPE='BAR'
    and  ( (ec.contextVersion = 'REALWORLD')
    AND ( ec.birthDate <= TO_DATE('2009-10-06 11:52:12', 'YYYY-MM-DD HH24:MI:SS') ) )
    and deathdate is null
    and substr(ec.strgfd, 1, length('[CIMText')) <> '[CIMText'
    
    call     count       cpu    elapsed       disk      query    current        rows
    ------- ------  -------- ---------- ---------- ---------- ----------  ----------
    Parse        1      0.00       0.00          0          0          0           0
    Execute      1      0.00       0.00          0          0          0           0
    Fetch        2      0.00     538.12     162221    1355323          0           1
    ------- ------  -------- ---------- ---------- ---------- ----------  ----------
    total        4      0.00     538.12     162221    1355323          0           1
    
    Misses in library cache during parse: 0
    Optimizer goal: CHOOSE
    Parsing user id: 153  
    
    Rows     Row Source Operation
    -------  ---------------------------------------------------
          1  SORT AGGREGATE 
      27747   TABLE ACCESS BY INDEX ROWID OBJ#(73959) 
    2134955    INDEX RANGE SCAN OBJ#(73962) (object id 73962)
    
    ********************************************************************************
    
    alter session set sql_trace=true
    
    
    call     count       cpu    elapsed       disk      query    current        rows
    ------- ------  -------- ---------- ---------- ---------- ----------  ----------
    Parse        0      0.00       0.00          0          0          0           0
    Execute      1      0.00       0.02          0          0          0           0
    Fetch        0      0.00       0.00          0          0          0           0
    ------- ------  -------- ---------- ---------- ---------- ----------  ----------
    total        1      0.00       0.02          0          0          0           0
    
    Misses in library cache during parse: 0
    Misses in library cache during execute: 1
    Optimizer goal: CHOOSE
    Parsing user id: 153  
    
    
    
    ********************************************************************************
    
    OVERALL TOTALS FOR ALL NON-RECURSIVE STATEMENTS
    
    call     count       cpu    elapsed       disk      query    current        rows
    ------- ------  -------- ---------- ---------- ---------- ----------  ----------
    Parse        1      0.00       0.00          0          0          0           0
    Execute      2      0.00       0.02          0          0          0           0
    Fetch        2      0.00     538.12     162221    1355323          0           1
    ------- ------  -------- ---------- ---------- ---------- ----------  ----------
    total        5      0.00     538.15     162221    1355323          0           1
    
    Misses in library cache during parse: 0
    Misses in library cache during execute: 1
    
    
    OVERALL TOTALS FOR ALL RECURSIVE STATEMENTS
    
    call     count       cpu    elapsed       disk      query    current        rows
    ------- ------  -------- ---------- ---------- ---------- ----------  ----------
    Parse        0      0.00       0.00          0          0          0           0
    Execute      0      0.00       0.00          0          0          0           0
    Fetch        0      0.00       0.00          0          0          0           0
    ------- ------  -------- ---------- ---------- ---------- ----------  ----------
    total        0      0.00       0.00          0          0          0           0
    
    Misses in library cache during parse: 0
    
        2  user  SQL statements in session.
        0  internal SQL statements in session.
        2  SQL statements in session.
    ********************************************************************************
    Trace file: gen_ora_3120.trc
    Trace file compatibility: 9.02.00
    Sort options: prsela  exeela  fchela  
           2  sessions in tracefile.
           2  user  SQL statements in trace file.
           0  internal SQL statements in trace file.
           2  SQL statements in trace file.
           2  unique SQL statements in trace file.
          94  lines in trace file.
    Published by: PauloSMO on November 17, 2009 04:21

    Published by: PauloSMO on November 17, 2009 07:07

    Published by: PauloSMO on November 17, 2009 07:38 - title changed to be more correct.

    Although your optimizer_mode is choosing, it seems that there are no statistics collected on ehgeoconstru. The absence of estimated costs and estimated row counts of each of the stages of the plan and the "Note: optimization based on rules" at the end of these two plans would tend to confirm this.

    Optimizer_mode choose means that if statistics are collected then it will use the CBO, but if no statistic is present in any of the tables in the query, the optimizer to rule will be used. The RBO tends to be happy in the best of the index case. I guess the index ehgeoconstru_VSN contextversion as the main column and also includes the date of birth.

    You can either gather statistics on the table (if all other tables have statistics) using dbms_stats.gather_table_stats, or suggest the query to use a full scan instead of index. Another solution would be to apply a function or an operation against the contextversion to prevent the use of the index. something like this:

    SELECT COUNT(*)
    FROM ehgeoconstru  ec
    WHERE ec.type='BAR' and
          ec.contextVersion||'' = 'REALWORLD'
          ec.birthDate <= TO_DATE('2009-10-06 11:52:12', 'YYYY-MM-DD HH24:MI:SS') and
          deathdate is null and
          SUBSTR(ec.strgfd, 1, LENGTH('[CIMText')) <> '[CIMText'
    

    or maybe UPPER (ec.contextVersion) so that would not change the rows returned.

    John

  • Using an IP191 monitor, have random horizontal stripes on the screen - have no problems with other browsers. also no problem with FF on the other PCs on the family

    Using an IP191 monitor, have random horizontal stripes on the screen - have no problems with other browsers. also no problem with FF on the other PCs on the family.

    These "streaks" seem to be the domain of the high frequency analysis; they can be eliminated by scrolling upwards or downwards.

    Hello, maybe it's a problem with hardware acceleration - try updating your graphic driver, or in case this does not solve the problem, or there is no new version available at the time, disable hardware acceleration in the firefox menu

    > options > advanced > General.

  • Hi, I have wireless internet in my house and I gave my password system so that others in my home with laptops can use my provider internet-how can I change my password now?

    original title: Hi, I have wireless internet in my house and I gave my password system so that others in my home with laptops can use my internet provider. I want to change my password now. How can I do this or do I need to contact my provider to do this? __

    Hi, I have wireless internet in my house and I gave my password system so that others in my home with laptops can use my internet provider.  I want to change my password now.  How can I do that or do I need to contact my provider?

    Normally, you must have set a wireless router with a password to the wireless network using the wireless network that you have set up in your home.

    If above is the case, read the information that came with your router, or search for it on their website on how to change the settings in it.

    See you soon.

    Mick Murphy - Microsoft partner

  • Trying to create the table using Clause any Union with Select multiple stmts

    The motion seeks to get the substring of the value to for example.
    If the value is * ASA 2 * then so do ASA
    where as if the value is * 1.5 TST * it sholud come as TST as wise for others too.
    I am trying to execute stmt SQL written but in error as below:

    * ' ORA-00998 must appoint this expression with the alias column 00998.00000 - must appoint this expression with the column alias. "

    CREATE TABLE TEST_CARE AS
    (
    SELECT row_id, old_care_lvl, SUBSTR(old_care_lvl,3), len test_care_lvl FROM
    WHERE LENGTH (old_care_lvl) = 5
    UNION ALL
    SELECT row_id, old_care_lvl, SUBSTR(old_care_lvl,3), len test_care_lvl FROM
    WHERE LENGTH (old_care_lvl) = 7
    UNION ALL
    SELECT row_id, old_care_lvl, SUBSTR(old_care_lvl,3), len test_care_lvl FROM
    WHERE LENGTH (old_care_lvl) = 14
    UNION ALL
    Row_id SELECT, old_care_lvl, SUBSTR (old_care_lvl, 3), LEN test_care_lvl
    WHERE LENGTH = 7 AND old_care_lvl (old_care_lvl) = "Regular."
    );

    I want to create the table using the above given the multiple selection by using the Union ALL clause, but trying to create run query error like "ORA-00998 must appoint this expression with the alias column 00998.00000 - must appoint this expression with the column alias.

    Please guide me how to approach to solve this problem.
    Thanks in advance.

    Try this->

    CREATE TABLE TEST_CARE
    AS
      select *
      from (
              SELECT row_id, old_care_lvl,SUBSTR(old_care_lvl,3), len FROM test_care_lvl
              WHERE LENGTH(old_care_lvl) =5
              UNION ALL
              SELECT row_id, old_care_lvl,SUBSTR(old_care_lvl,3), len FROM test_care_lvl
              WHERE LENGTH(old_care_lvl) =7
              UNION ALL
              SELECT row_id, old_care_lvl,SUBSTR(old_care_lvl,3), len FROM test_care_lvl
              WHERE LENGTH(old_care_lvl) =14
              UNION ALL
              SELECT row_id, old_care_lvl,SUBSTR(old_care_lvl,3),LEN FROM test_care_lvl
              WHERE LENGTH(old_care_lvl) =7 AND old_care_lvl ='Regular'
          );
    

    N.B.: Not tested...

    Kind regards.

    LOULOU.

  • I have an iPhone 6 and get this message. Continue coarse iCloud on this iPhone approve him to one of your other devices using iCloud or enter your iCloud security code.  I don't know my security code and only have my book of power with me.

    I get this message on my iPhone 6.  To continue using Icloud on this iPhone, do agree with your other devices using iCloud or either your iCloud security code.  I don't know my security code.  I have my book of power with me how check my iPhone 6.

    Mike.

    Hello

    For checking your apple iphone should send you a massage to your other device

    With a code.

    See you soon

    Brian

  • Open with options: I want to add a new application to the list right click on file-&gt; open with and rearrange the list so my search app is first. I know that I can use open with-&gt; other and select any application, but it takes too much time since I u

    I want to add a new application to the list right click on file-> open with

    and also reorder the list so my search app is first / top of the list.

    I know that I can use open with-> other and select any application, but it takes too long I should use my intended application in this way several times a day.

    Basically, I'm looking for a configurable way configure open with, something more to send to Windows.

    Thank you very much for all the advice offered.

    The operating system, not you, not control that open with the menu command.

  • I have a question why U removed the session of keyboard spelling checker is a very useful sit Apple give it in products. It helps a lot in communicting with others from different countries, even in our studies and the communication

    I have a question why U removed the session of keyboard spelling checker is a very useful sit Apple give it in products. It helps a lot in communicting with others from different countries, even in our studies and communication with our teachers.plz it back... .hope you will do

    Nothing has been deleted. Perhaps if you explain better what it is you are looking for, a person might be able to help. You mean maybe predictive text? All these settings are in settings > general > keyboard.

Maybe you are looking for

  • video decoder

    When I try to access my Windows Media Center Live TV, I get an error message indicating "video decoder is not installed or with malfunction." Is this a problem hardware or software, and in both cases, how to fix? I alsow get a message that says: Mess

  • Help with my e280! urgent

    Hello!! IM haviing problems with my sansa e280. 2 days ago it worked perfectly, as always... but all of a sudden yesterday I was going to turn it on... it's turns on but the screen of welcome, it still says "San Disk" and it keeps it all the time...

  • Software with Cyrillic interface is coded.

    When I use the Russian software, the Cyrillic letters are decoded (impossible to read) with the symbols. How to solve this, while it is possible to use it?

  • Network printer with XP and Vista

    I initially installed my printer (Canon i850) on the XP computer, then I disconnected the USB cable and plugged into the Vista computer.  Vista has found a driver and it worked.  Then I put in network computers via ethernet and a router.  Now, I try

  • Adobe virus

    I have a virus that prevent the use of anything but to explore it and windows mail.  any other program that I try a box appears asking what to open with, the adobe reader 8.1 software or internet explore.  I tried to download tools and it is blocking