ORA-01446 tabular with CONNECTION BY LEVEL < = 2

I created a tabular presentation where I want the 2 last lines be empty so that the user can enter new lines immediately (for example, the first time that no data is found).
Here's the sql code of the form of tables:
select 
"ID",
"REQ_ID",
"QUANTITY",
"FRAME_SIZE",
"FRAME_TYPE",
"PROTECTIVE_COVERING",
"MATT",
"MATT_COLOR"
from "#OWNER#"."CREATIVE_SVC_DESIGN_FRAMING"
union all
select
null id,
null req_id,
null quantity,
null frame_size,
null frame_type,
null protective_covering,
null matt,
null matt_color
from dual
connect by level <= 2 
I get the following error:
Failed to parse the SQL query:
ORA-01446: cannot select ROWID, or sample, a view with DISTINCT, GROUP BY, etc.

The query is not access ROWID view at all. And, as you can see, it does not use a DISTINCT, GROUP BY, etc...

My APEX is Application Express 4.0.2.00.07
My database is 10g (10.2.0.5.0)

Help, please!

Robert
http://apexjscss.blogspot.com

Robert,

I wish I had a better explanation for you, but I know something again with 4.1 broke this trick union for tabular forms. I had to do a dynamic action that runs when the page loads and calls the javascript function of the: AddRow(). I think it has something to do with the validation of the form in a table, but I'm not sure.

See you soon,.
Janet Tyson

Tags: Database

Similar Questions

  • Problem with connection by level

    Hello


    My desired goes something like this: I would like to generate the dates of hiredate to systdate with an interval of one month. The code that I have to return works well for single empno. I want to generate the dates of hiredate to sysdate with a gap
    one month for all employees (empno). Commenting on the code to find out where empno = 7369 does not work and the system a lot of the CPU usage.

    Hiredate were suppose to be to_date('01-jan-10') for empno = 7369

    examples of code goes something like this:
    select ADD_MONTHS(trunc(to_date('01-jan-10')),LEVEL-1)
    from dual
    connect by level <= trunc((sysdate-to_Date('01-jan-10'))/30 )
    code for the emp table
    select ADD_MONTHS(trunc(hiredate),LEVEL-1)
    from employee
    where empno = 7369
    connect by level <= trunc((sysdate-trunc(hiredate))/30 )
    Please advice

    You should stay with double to generate numbers. You can use the caluase WITH to create a table that contains only the relevant dates.

    The min max values for the datatab ann might be emp Subselects.

    example not tested

    with datatab as (select ADD_MONTHS(trunc(to_date('01-jan-10')),LEVEL-1) mon
                           from dual
                            connect by level <= trunc((sysdate-to_Date('01-jan-10'))/30 )
                           )
    select *
    from employee e
    join datatab d on e.hiredate <=d.mon
    where empno = 7369;
    

    Well, there are other ways to do it. Maybe you can provide some examples of data and also some of the desired output.

  • Generation SQL line with connection by level

    Hello

    I'm looking for generate lines based on a quantity of part numbers.  I have looked all around several techniques for the generation of the line, but have failed to address this problem.  The current method, it seems pulls a permutation of all possible combinations, and the result is rising quickly to millions / billions of documents... which is not the answer.  Someone out there who could help writing a query to do this?

    What I try to achieve if a quantity of part 5, I want to display 5 Qty 1 documents.  If the Qty 12, then 12 Qty 1 documents.  So on and so forth.

    Out Oracle 10.2.0.4 operation

    Sample data:

    drop table test;

    create table test (part varchar2 (20), number of quantity);

    Insert test values ('WIDGET', 12);

    Insert test values ('FOO', 5);

    Insert test values ('THING', 3);

    Insert test values ("WAD", 8);

    commit;

    -This query does not work... I think it's getting all the possible permutations

    -Select a part, 1

    -to test

    -connect by level < = Qty

    -what I want to see...

    Part Qty.

    ------      ----

    WIDGET 1

    WIDGET 1

    WIDGET 1

    WIDGET 1

    WIDGET 1

    WIDGET 1

    WIDGET 1

    WIDGET 1

    WIDGET 1

    WIDGET 1

    WIDGET 1

    WIDGET 1

    FOO 1

    FOO 1

    FOO 1

    FOO 1

    FOO 1

    THING 1

    THING 1

    THING 1

    BUNDLE 1

    BUNDLE 1

    BUNDLE 1

    BUNDLE 1

    BUNDLE 1

    BUNDLE 1

    BUNDLE 1

    BUNDLE 1

    Hello

    You want something like this:

    SELECT part

    Qty. 1

    OF the test

    CONNECT NOCYCLE LEVEL<=>

    AND an EARLIER part = part

    AND PRIOR SYS_GUID () IS NOT NULL

    ;

    You may have copied the request of something that just use the array of double.  When you have more than 1 row of the table, then you need by using the PRIOR operator in the CONNECT BY clause.

  • Performance issue with connection of a level query

    Hi I have a problem with connection by level in oracle.

    My table is:


    J_USER_CALENDAR
    --------------------------

    USER_NAME FROM_DATE TO TO_DATE COMMENTS
    -------------------------------------------------------------------------------------------------
    Comment1 5 November 09 uma Shankar 2 November 09
    Veera 11 November 09 13 November 09 Comment2
    Commnet3 17 December 09 uma Shankar 15 December 09
    Vinod 20 October 09 21 October 09 Comments4


    The table above is the calendar of user authorization.

    Now I need to view the users who are on leave between November 1, 2009 to November 30, 2009

    The output should look like:


    USER_NAME FROM_DATE COMMENTS
    ---------------------------------------------------------------------------------
    Comment1 2 November 09 uma Shankar
    Comment1 3 November 09 uma Shankar
    Comment1 4 November 09 uma Shankar
    Comment1 5 November 09 uma Shankar
    Comment2 Veera 11 November 09
    Comment2 Veera 12 November 09
    Comment2 Veera 13 November 09

    For this, I tried with the following query, but it takes too long to run.
    Select FROM_DATE, user_name, comments from (SELECT distinct FROM_DATE, user_name,
    Comments FROM (SELECT (LEVEL) + FROM_DATE-1 FROM_DATE, TO_DATE, FIRST_NAME |) » '|| LAST_NAME
    user_name, COMMENTS OF J_USER_CALENDAR
    where
    and J_USER_CALENDAR.IS_DELETED = 0
    CONNECT BY LEVEL < = TO_DATE - FROM_DATE + 1) has) where ("FROM_DATE = 1st November 2009 ' or FROM_DATE = November 30, 2009")
    or FROM_DATE between November 1, 2009 "-November 30, 2009") order of from_Date, lower (user_name)

    Please help me.

    Thanks in advance.

    Kind regards
    Phanikanth

    I have not tried to analyze the SQL statement.

    Here is a test set in place:

    CREATE TABLE T1(
      USERNAME VARCHAR2(30),
      FROM_DATE DATE,
      TO_DATE DATE,
      COMMENTS VARCHAR2(100));
    
    INSERT INTO T1 VALUES ('Uma Shankar', '02-Nov-09','05-Nov-09','Comment1');
    INSERT INTO T1 VALUES ('Veera','11-Nov-09','13-Nov-09','Comment2');
    INSERT INTO T1 VALUES ('Uma Shankar','15-Dec-09','17-Dec-09','Commnet3');
    INSERT INTO T1 VALUES ('Vinod','20-Oct-09','21-Oct-09','Comments4');
    INSERT INTO T1 VALUES ('Mo','20-Oct-09','05-NOV-09','Comments4');
    
    COMMIT;
    

    Note that I have included an additional line, when the person starts their vacation in the previous month and ends in November.

    You could approach the problem like this:
    Assume that you want to appear every day in a given month:

    SELECT
      TO_DATE('01-NOV-2009','DD-MON-YYYY')+(ROWNUM-1) MONTH_DAY
    FROM
      DUAL
    CONNECT BY
      LEVEL<=ADD_MONTHS(TO_DATE('01-NOV-2009','DD-MON-YYYY'),1)-TO_DATE('01-NOV-2009','DD-MON-YYYY');
    

    Note that the above attempts to calculate the number of days in the month of November - if we know that the month has a certain number of days, 30 for example, you can rewrite the CONNECT BY clause like this:

    CONNECT BY
      LEVEL<=30
    

    Now, he must pick up lines of interest to the table:

    SELECT
      *
    FROM
      T1 T
    WHERE
      (T.FROM_DATE BETWEEN TO_DATE('01-NOV-2009','DD-MON-YYYY') AND TO_DATE('30-NOV-2009','DD-MON-YYYY')
        OR T.TO_DATE BETWEEN TO_DATE('01-NOV-2009','DD-MON-YYYY') AND TO_DATE('30-NOV-2009','DD-MON-YYYY'));
    
    USERNAME        FROM_DATE TO_DATE   COMMENTS
    --------------- --------- --------- ----------
    Uma Shankar     02-NOV-09 05-NOV-09 Comment1
    Veera           11-NOV-09 13-NOV-09 Comment2
    Mo              20-OCT-09 05-NOV-09 Comments4
    

    If join us then both sets of results, we have the following query:

    SELECT
      *
    FROM
      T1 T,
      (SELECT
        TO_DATE('01-NOV-2009','DD-MON-YYYY')+(ROWNUM-1) MONTH_DAY
      FROM
        DUAL
      CONNECT BY
        LEVEL<=ADD_MONTHS(TO_DATE('01-NOV-2009','DD-MON-YYYY'),1)-TO_DATE('01-NOV-2009','DD-MON-YYYY')) V
    WHERE
      (T.FROM_DATE BETWEEN TO_DATE('01-NOV-2009','DD-MON-YYYY') AND TO_DATE('30-NOV-2009','DD-MON-YYYY')
        OR T.TO_DATE BETWEEN TO_DATE('01-NOV-2009','DD-MON-YYYY') AND TO_DATE('30-NOV-2009','DD-MON-YYYY'))
      AND V.MONTH_DAY BETWEEN T.FROM_DATE AND T.TO_DATE
    ORDER BY
      USERNAME,
      MONTH_DAY;
    
    USERNAME        FROM_DATE TO_DATE   COMMENTS   MONTH_DAY
    --------------- --------- --------- ---------- ---------
    Mo              20-OCT-09 05-NOV-09 Comments4  01-NOV-09
    Mo              20-OCT-09 05-NOV-09 Comments4  02-NOV-09
    Mo              20-OCT-09 05-NOV-09 Comments4  03-NOV-09
    Mo              20-OCT-09 05-NOV-09 Comments4  04-NOV-09
    Mo              20-OCT-09 05-NOV-09 Comments4  05-NOV-09
    Uma Shankar     02-NOV-09 05-NOV-09 Comment1   02-NOV-09
    Uma Shankar     02-NOV-09 05-NOV-09 Comment1   03-NOV-09
    Uma Shankar     02-NOV-09 05-NOV-09 Comment1   04-NOV-09
    Uma Shankar     02-NOV-09 05-NOV-09 Comment1   05-NOV-09
    Veera           11-NOV-09 13-NOV-09 Comment2   11-NOV-09
    Veera           11-NOV-09 13-NOV-09 Comment2   12-NOV-09
    Veera           11-NOV-09 13-NOV-09 Comment2   13-NOV-09
    

    Charles Hooper
    IT Manager/Oracle DBA
    K & M-making Machine, Inc.

  • Need help with a query of type "connect by level.

    Hello, I recently met 'connect by level' and I think he can solve my problem, but maybe not. I would like to create rows of data where the number of rows created varies according to the data from the original table.

    It works:

    with times like

    (select to_date (' 26/01/2014 01:00 ',' dd/mm/yyyy hh24:mi:ss') starttime,)

    TO_DATE (' 27/01/2014 00:00:00 ',' dd/mm/yyyy hh24:mi:ss') stoptime

    the double)

    Select starttime, stoptime, starttime + rownum / 24

    of the time

    connect by level < =.

    (Select trunc ((stoptime-starttime) * 24: 2) at the time)

    I would like to do something similar for several lines (following does not work)

    with times like

    (select to_date (' 26/01/2014 01:00 ',' dd/mm/yyyy hh24:mi:ss') starttime,)

    TO_DATE (' 27/01/2014 00:00:00 ',' dd/mm/yyyy hh24:mi:ss') stoptime

    of the double

    Union

    Select to_date (' 25/01/2014 18:00 ',' dd/mm/yyyy hh24:mi:ss') starttime.

    TO_DATE (' 27/01/2014 00:00:00 ',' dd/mm/yyyy hh24:mi:ss') stoptime

    the double)

    Select starttime, stoptime, starttime + rownum / 24

    of the time

    connect by level < =.

    (Select trunc ((stoptime-starttime) * 24: 2) at the time)

    I need to stay away from solutions of PL/SQL, this query will be wrapped in an application that can not handle the PL/SQL, going and coming from the database (I also suck in PL/SQL).

    Any help would be greatly appreciated, I have no knowledge here, I tried to read some of the documentation on hierarchical queries, but it is not yet clicking.

    Thank you!

    Or also:

    SQL > WITH times

    2 ALSO (SELECT TO_DATE (' 01:00 26/01/2014 ', "hh24:mi:ss dd/mm/yyyy") Starttime)

    3, TO_DATE (' 01/26/2014 03:00 ', 'hh24:mi:ss dd/mm/yyyy') Stoptime

    4 FROM TWO

    5 UNION

    6 SELECT TO_DATE (' 25/01/2014 18:00 ', "hh24:mi:ss mm/dd/yyyy") Starttime

    7, TO_DATE (' 25/01/2014 22:00 ', 'hh24:mi:ss dd/mm/yyyy') Stoptime

    8 DOUBLE)

    9. SELECT T.*, Starttime + Lvl / 24

    10. OF time T

    11, (SELECT LEVEL Lvl

    THE DOUBLE 12

    13 CONNECT BY LEVEL<>

    14 (SELECT MAX (TRUNC ((Stoptime-Starttime) * 24)))

    15 AT the time)):

    16. WHERE the lvl<= trunc="" (="" (stoptime="" -="" starttime)="" *="">

    17 ORDER 1, 3

    18.

    STARTTIME STOPTIME-STARTTIME + LVL/24

    ----------------------------- ----------------------------- -----------------------------

    January 25, 2014 18:00 January 25, 2014 22:00 January 25, 2014 19:00

    January 25, 2014 18:00 January 25, 2014 22:00 January 25, 2014 20:00

    January 25, 2014 18:00 January 25, 2014 22:00 January 25, 2014 21:00

    January 25, 2014 18:00 January 25, 2014 22:00 January 25, 2014 22:00

    26 January 2014 01:00 26 January 2014 03:00 January 26, 2014 02:00

    26 January 2014 01:00 26 January 2014 03:00 January 26, 2014 03:00

    6 selected lines.

  • Connect by level - with several lines of inpur

    Very simplified, I have this table - it has a 'table' as a variable-length structure.

    I need x line of output for each input line (do not use pipelining og PL/SQL function)
    Wih a single line as input of the "log in"-it works of course.
    drop table test3;
    create table test3 (id number, tekst varchar2(20));
    
    insert into test3 values (1, 'acbdef');
    insert into test3 values (2, '123');
    insert into test3 values (3, 'HUUGHFTT');
    insert into test3 values (4, 'A');
    insert into test3 values (5, 'AKAJKSHKJASHKAJSHJKJ');
    commit;
    
    with tal as
    (
    select * from
    (select a.*, rownum rn
    from test3 a)
    where rn < 2)
    ------
    select tekst, level , 
    substr(tekst,(level-1)*1+1, 1) content
    from tal
    connect by level < length(tekst) 
    ;
    How to achieve the same thing for several input lines?
    I know I can do it in PL/SQL using plan either pl or just a function in the pipeline, but I prefer a clean if possible SQL.
    I tried to do in a cross join test3 and (select different values of double the test3 table) and other versions, but all with syntax errors
    with tal as
    (
    select * from
    (select a.*, rownum rn
    from test3 a)
    where rn < 3)
    ------
    select * from test3 cross join table 
    (
    select tekst, level , 
    substr(tekst,(level-1)*1+1, 1) content
    from dual
    connect by level < length(tekst)
    )
    ;
    Oracle version will be 10.2 and 11 +.

    I think it's kind of what you're looking for:

    with tal as
    ( select 1 id, 'acbdef' tekst         from dual union
      select 2   , '123'                  from dual union
      select 3   , 'HUUGHFTT'             from dual union
      select 4   , 'A'                    from dual )
    ------
    select  id, tekst, level, substr(tekst,(level-1)*1+1, 1) content
      from  tal
    connect by (    level <= length(tekst)
               and  prior id = id
               and  prior dbms_random.value is not null
               )
    ;
    
            ID TEKST         LEVEL CONTENT
    ---------- -------- ---------- -------
             1 acbdef            1 a
             1 acbdef            2 c
             1 acbdef            3 b
             1 acbdef            4 d
             1 acbdef            5 e
             1 acbdef            6 f
             2 123               1 1
             2 123               2 2
             2 123               3 3
             3 HUUGHFTT          1 H
             3 HUUGHFTT          2 U
             3 HUUGHFTT          3 U
             3 HUUGHFTT          4 G
             3 HUUGHFTT          5 H
             3 HUUGHFTT          6 F
             3 HUUGHFTT          7 T
             3 HUUGHFTT          8 T
             4 A                 1 A       
    
  • Connect by level using the count of the records collection

    Hello:

    PROBLEM:
    ...
    ), (select rownum number months of double connect by level < = Cnt)

    Causes not valid ORA-00904 identifier. Why can I not use "Cnt" of my main as request by using a constant in the works?

    The value of count is determined for each date range in the section, I return the records that I need?

    Thank you, Sidney

    BACKGROUND:
    I have to be able to display a list of tax returns to my users and the status of these statements. There's no physical feedback so it is necessary to create data dynamically records using appropriate selection. It's not hard and I thought that would be enough to use a connection by level to give me the date, statements of information so that I can calculate and display the individual. However oracle gives me an ORA-00904 when I try to send the "Cnt" value to connect by level. Everything works fine when I provided a constant instead of "CNT". The "CNT" value is determined by a complex process that calculates start and end for several types of return dates, etc as well as the number of periods and frequency of production. The data must be generated dynamically using a master record, which then gives the history of coding in which my collection of basic records is selected. Here is the result of this process:

    TaxpayerNo, TaxClass TaxCode, FilingFequency, StartDate, StopDate, Cnt, frequency

    10 S 1 M 12-18 6/1/2007-11/30/2008
    10 S 2 M 12 10 30/11/2008-9/30/2009
    10 S, 2 Q 4 3 11/30/2010-8/18/2011
    L 10 8 6/1/2007 9/30/2009 3 1
    L 10 8 11/30/1 / 2010 8/18/2011 1

    According to the results, I have needs a record for each every month, quarter, etc. ie:

    10 S 1 M 6/1/2007 11/30/2008 18 12 6/1/2007
    10 S 1 M 6/1/2007 11/30/2008 18 12 7/1/2007
    10 S 1 M 6/1/2007 11/30/2008 18 12 8/1/2007
    10 S 1 M 6/1/2007 11/30/2008 18 12 9/1/2007
    ...
    10 S 2 M 30/11/2008-9/30/2009 10 12 11/30/2008
    10 S 2 M 30/11/2008-9/30/2009 10 12 12/30/2008
    ...
    etc.

    DOES NOT WORK
    Select y.*, MonthNo, Add_Months(StartDate,MonthNo*Frequency) in)
    Select x.*,
    (case when FilingFrequency = am' then Ceil (Months_Between (StopDate, StartDate)))
    When FilingFrequency = 'Q' then Ceil (Months_Between(StopDate,StartDate)/3)
    When FilingFrequency = 'A' Ceil (Months_Between(StopDate,StartDate)/12) then
    0 otherwise
    end) NTC,
    (case when FilingFrequency = am' then 1)
    When FilingFrequency = 'Q' then 3
    When FilingFrequency = 'A' then 12
    end) frequency
    de)
    ... a code complex to calculate values of start and stop dates required above...
    ) x
    ), (select rownum number months of double connect by level < = Cnt)
    ERROR MESSAGE
    The result is ORA-00904: "CNT": invalid identifier. I do not get an error if I use a constant:

    WORK WITH THE HELP OF A CONSTANT, BUT MUST HAVE THE VALUE OF THE ACTUAL CNT
    ... Same code for generating data...
    ), (select rownum number months of double connect by level < = 3)

    How can I get it works using the "CNT" value instead of a constant?

    A technique like this should solve your problem.

    TUBBY_TUBBZ?with data (col1, cnt) as
      2  (
      3    select 1, 3 from dual
      4      union all
      5    select 2, 2 from dual
      6  )
      7  select
      8    d.col1,
      9    t.column_value
     10  from
     11    data  d,
     12    table(cast(multiset(select level from dual connect by level <= d.cnt) as sys.OdciNumberList)) t;
    
                  COL1       COLUMN_VALUE
    ------------------ ------------------
                     1                  1
                     1                  2
                     1                  3
                     2                  1
                     2                  2
    
    5 rows selected.
    
    Elapsed: 00:00:00.00
    TUBBY_TUBBZ?
    

    Contrary to what you have now, which is basically this

    TUBBY_TUBBZ?with data (col1, cnt) as
      2  (
      3    select 1, 3 from dual
      4      union all
      5    select 2, 2 from dual
      6  )
      7  select
      8    d.col1,
      9    level
     10  from
     11    data  d
     12  connect by level <= d.cnt;
    
                  COL1              LEVEL
    ------------------ ------------------
                     1                  1
                     1                  2
                     1                  3
                     2                  2
                     1                  3
                     2                  1
                     1                  2
                     1                  3
                     2                  2
                     1                  3
    
    10 rows selected.
    
    Elapsed: 00:00:00.00
    TUBBY_TUBBZ?
    
  • Question on connect by level 2 records

    My query begins with the records of two pairs and continues with the rank and adds two records to pair again.

    However, the unwanted extra each level (mbc 11, 12 wtc...) in the result.

    would you help me.

    My request;

    SELECT CUT (SUBSTR ("abc 11 12 11 22 33 kbc vbc wtc mbc mbc 17 45', INSTR kbs (" abc 11 12 11 22 33 17 mbc kbc vbc wtc mbc kbs 45 ', ' ', 1, level) + 1, "))

    INSTR ("abc 11 12 11 22 33 17 mbc kbc vbc wtc mbc kbs 45 ', ' ', 2, level + 1)-INSTR (" abc 11 12 11 22 33 17 mbc kbc vbc wtc mbc kbs 45 ', ' ', 1, level)-1)) AS PAIR

    OF THE DOUBLE

    CONNECT BY level < = LENGTH(' abc 11 mbc 12 wtc 11 vbc 22 kbc 33 mbc 17 kbs 45 ') LENGTH (REPLACE ('abc 11 12 11 22 33 17 mbc kbc vbc wtc mbc kbs 45', ' ', "))-1

    Outcome;

    ABC 11
    MBC 12
    WTC 11
    Vbc 22
    KBC 33
    MBC 17
    KBS 45

    Problem result;

    ABC 11
    11 mbc
    MBC 12
    WTC 12
    WTC 11
    11 vbc
    Vbc 22
    22 kbc
    KBC 33
    MBC 33
    MBC 17
    17 kbs
    KBS 45

    Hello

    Jimmie_M wrote:

    I thank very you much for your time. Thank you!!!

    is it possible to keep my request to get the result without regexp_substr.

    If I run regexp_substr in the table, the slow performance.

    Thank you

    You were on the right track with your first message.  The problem with this request was that you were each pair of words:

    • Word 1 and 2,
    • Word 2 and 3,
    • Word 3 and 4,
    • Word 4 and 5,

    and so on.  You don't want that every other pair:

    • Word 1 and 2,
    • Word 3 and 4,

    and so on.

    Here's a way to do it:

    WITH the data AS

    (

    SELECT ' abc 11 12 11 22 33 kbc vbc wtc mbc mbc 17 45' AS str kbs

    OF the double

    )

    got_space_pos AS

    (

    SELECT 1 * LEVEL AS n

    , INSTR (str, ' ', 1, (2 * LEVEL)-1) + 1 AS start_pos

    , INSTR (str, ' ', 1, (2 * LEVEL) + 1) AS end_pos

    FROM the data

    CONNECT BY LEVEL<= (="" length="">

    -LENGTH (REPLACE (str, ' '))

    ) / 2

    )

    SUBSTR (str, start_pos, end_pos - start_pos) SELECT as a PAIR

    OF got_space_pos

    JOIN CROSS data

    ORDER BY start_pos

    ;

    Output:

    PAIR

    -------------

    ABC 11

    MBC 12

    WTC 11

    Vbc 22

    KBC 33

    MBC 17

    KBS 45

    Are you regular expressions of course are initially slow Paulzip query?  That's maybe something about your data you have not shown or explained.  As said by ground, you must always follow the Forum FAQ:

    Re: 2. How can I ask a question in the forums?

    so that people who want to help you can recreate the problem and test their ideas.

    In addition, the sample data (CREATE TABLE and INSERT statements), be sure to upgrade your version of Oracle.  A recursive (available in Oracle 11.2 and upwards) WITH clause might help in this problem. or maybe CROSS APPLY (Oracle 12.1) would be useful.

    Simplify the prblem as much as possible; for example, you generally need not show all columns in your actual tables, only those involved in the problem.  But make sure that you validate the example data illustrate the real problem.

  • Explanation connect by level

    Hi gurus. Can someone explain to me under requests, why connect by the work in this way. Differences between 2 requests is marked by red color.

    WITH TAB(KEY_ID,KEY_1) AS
    (SELECT 1,'Z/D/YYYY/MM' FROM DUAL
      UNION ALL
     SELECT 2,'YYYY/MM/Z/D' FROM DUAL)
          SELECT LISTAGG(CASE
                          WHEN KEY_1 = 'Z' THEN
                            'TEST_Z'
                          WHEN KEY_1 = 'D' THEN
                            TO_CHAR(EXTRACT(DAY FROM SYSDATE))
                          WHEN KEY_1 = 'YYYY' THEN
                            TO_CHAR(EXTRACT(YEAR FROM SYSDATE))
                          WHEN KEY_1 = 'MM' THEN
                            TO_CHAR(EXTRACT(MONTH FROM SYSDATE))
                          END, '/') WITHIN GROUP (ORDER BY LVL)CONVERT_KEY, MAX(KEY_ID) KEY_ID,
                          COUNT(DISTINCT KEY_ID) CNT
          FROM (SELECT REGEXP_SUBSTR(REGEXP_REPLACE(KEY_1, '[^[:graph:]]', ''), '[^/]+', 1, LEVEL)KEY_1,
                       LEVEL LVL, KEY_ID
                  FROM(SELECT * 
                         FROM TAB
                        WHERE KEY_ID = 1)
               CONNECT BY LEVEL <= LENGTH(REGEXP_REPLACE(KEY_1, '[^/]+')) + 1);
    

    Correct output:

    convert_key
    Key_ID cnt
    TEST_Z/20/2015/411

    WITH TAB(KEY_ID,KEY_1) AS
    (SELECT 1,'Z/D/YYYY/MM' FROM DUAL
      UNION ALL
     SELECT 2,'YYYY/MM/Z/D' FROM DUAL)
          SELECT LISTAGG(CASE
                          WHEN KEY_1 = 'Z' THEN
                            'TEST_Z'
                          WHEN KEY_1 = 'D' THEN
                            TO_CHAR(EXTRACT(DAY FROM SYSDATE))
                          WHEN KEY_1 = 'YYYY' THEN
                            TO_CHAR(EXTRACT(YEAR FROM SYSDATE))
                          WHEN KEY_1 = 'MM' THEN
                            TO_CHAR(EXTRACT(MONTH FROM SYSDATE))
                          END, '/') WITHIN GROUP (ORDER BY LVL)CONVERT_KEY, MAX(KEY_ID) KEY_ID,
                          COUNT(DISTINCT KEY_ID) CNT
          FROM (SELECT REGEXP_SUBSTR(REGEXP_REPLACE(KEY_1, '[^[:graph:]]', ''), '[^/]+', 1, LEVEL)KEY_1,
                       LEVEL LVL, KEY_ID
                  FROM TAB
                 WHERE KEY_ID = 1
               CONNECT BY LEVEL <= LENGTH(REGEXP_REPLACE(KEY_1, '[^/]+')) + 1);
    

    Poor performance:

    convert_key Key_ID CNT
    TEST_Z/20/20/2015/2015/2015/2015/4/4/4/4/4/4/4/411

    WHERE in hierarchical queries this clause is applied AFTER the construction of a hierarchy.

    SY.

  • Connect by PRIOR vrs Connect by LEVEL

    Hello

    I'm trying to understand the difference between CONNECT BY PRIOR and CONNECT BY LEVEL

    I know that CONNECT BY PRIOR is basically specifying a hierarchy and which column / field is the parent (using the PRIOR)

    for example

    SELECT employe_id, employee_name, level

    Employees

    CONNECT BY PRIOR employee_id = manager_id;


    Q1. What is CONNECT BY LEVEL (for example as shown below) practice? What type of relationship normally described? (below, it is just producucing a series of integers)

    SELECT the level

    OF the double

    CONNECT BY LEVEL < = 10;

    T2. Use LEVEL with CONNECT BY in this way, a subversive use of the CONNECT IN knowledge is really intended to be used this way?

    any advice appreciated,

    Jim

    Hi, Jim,.

    Jimbo wrote:

    Hello

    I'm trying to understand the difference between CONNECT BY PRIOR and CONNECT BY LEVEL

    I know that CONNECT BY PRIOR is basically specifying a hierarchy and which column / field is the parent (using the PRIOR)

    for example

    SELECT employe_id, employee_name, level

    Employees

    CONNECT BY PRIOR employee_id = manager_id;

    Sometimes, CONNECT BY using hierarchical data, such as a tree.  In these cases, it may be useful to use the terns as "parent" and "child."  The query above is one of these cases.

    In more general terms, CONNECT BY returns the union (UNION ALL, specifically) of lines found by the START WITH clause (LEVEL = 1) and lines found by the clause CONNECT BY (LEVEL > 1).  If there is no START WITH clause, every row in the table will appear on LEVEL = 1.

    If there is no line on LEVEL = N, then Oracle research lines that meet the CONNECT BY clause, to search for the lines that are connected to each line level = N, for put the LEVEL N + 1.  If the CONNECT BY clause is set to TRUE for a given row, while the rank will appear on level N + 1 =.  Often (but not always) the CONNECT BY clause uses the PRIOR operator.  After PRIOR consent refers to something = N level.

    Q1. What is CONNECT BY LEVEL (for example as shown below) practice? What type of relationship normally described? (below, it is just producucing a series of integers)

    SELECT the level

    OF the double

    CONNECT BY LEVEL<>

    Since there is no START WITH clause, each line of the double table will be LEVEL = 1.

    The CONNECT BY clause means that CONNECT BY always means: If there is a line at = N, then it will be connected to any line that fills the CONNECT BY conditions.

    So that the lines will be added to the level = 2?  All the lines where condition 2<= 10="" is="" true,="" so="" every="" row="" in="" the="" dual="" table="" will="" be="" on="" level="">

    What lines will be added to the level = 3?  All the lines where condition 3<= 10="" is="" true,="" so="" every="" row="" in="" the="" dual="" table="" will="" be="" on="" level="">

    ...

    What lines will be added to the level = 10?  All the lines where the condition of 10<= 10="" is="" true,="" so="" every="" row="" in="" the="" dual="" table="" will="" be="" on="" level="10." 10="" is="" true,="" so="" every="" row="" in="" the="" dual="" table="" will="" be="" on="" level="">

    What lines will be added to the level = 11?  All the lines where condition 11<= 10="" is="" true,="" so="" no="" row="" in="" the="" dual="" table="" will="" be="" on="" level="">

    Since no rows are added to the LEVEL = 11, CONNECT BY query stop right there.

    Q2. Use LEVEL with CONNECT BY in this way, a subversive use of the CONNECT IN knowledge is really intended to be used this way?

    You can think of it as being subversive.  It was certainly not how planners and the deveopers at Oracle for CONNECT BY work in versions 2 to 8; you got an error if you tried in these versions.  It is also an exception to the rule that no line can be his own ancestor.

  • CONNECTION BY level/prior/root

    Hi all

    I'm trying to CONNECT BY level/prior/root. But I can barely decipher what it actually does. I think it is a very useful method provided by oracle and can have several uses. can someone help me on this please.

    I googled on this topic but everywhere I could find only employee and manager problem that will be solved by query below.
     SELECT employee_id, last_name, manager_id
       FROM employees
       CONNECT BY PRIOR employee_id = manager_id;
    But if we just query as below, we can get the employee and his manage without CONNECT BY.
    SELECT employee_id, last_name, manager_id
       FROM employees;
    Other queries is obtained to connect by is below, but he could not also include:
     select SYSDATE-41 + level - 1 the_date
                                from dual
                              connect by level <= SYSDATE - SYSDATE-41 + 1
    Please help me.

    Published by: J2EE_Life on December 6, 2011 08:12

    J2EE_Life wrote:
    Hi all

    I'm trying to CONNECT BY level/prior/root. But I can barely decipher what it actually does. I think it is a very useful method provided by oracle and can have several uses. can someone help me on this please.

    I googled on this topic but everywhere I could find only employee and manager problem that will be solved by query below.

    SELECT employe_id, last_name, manager_id
    Employees
    CONNECT BY PRIOR employee_id = manager_id;

    But if we just query as below, we can get the employee and his manage without CONNECT BY.

    SELECT employe_id, last_name, manager_id
    Employees;

    In fact, those who are not the same.
    If you use the standard table of hr.employees, the CONNECT BY query above returns 315 lines, but the secoind query return lines only 107.

    CONNECTION is useful to show the recursive relationships. It can show you, for example, not only that reports directly to a data manager, but the whole hierarchy of persons under a given head. For example, the following shows the hierarchy starting with an employee named "Rooster":

    SELECT  employee_id, last_name, manager_id
    ,     LEVEL                         AS lvl
    ,     SYS_CONNECT_BY_PATH (last_name, '/')     AS path
    FROM    hr.employees
    START WITH      last_name          = 'De Haan'
    CONNECT BY       PRIOR employee_id      = manager_id;
    
    SELECT     SYSDATE - SYSDATE-41 + 1
    FROM DUAL;
    

    Output:

    EMPLOYEE_ID LAST_NAME  MANAGER_ID LVL PATH
    ----------- ---------- ---------- --- --------------------------
            102 De Haan           100   1 /De Haan
            103 Hunold            102   2 /De Haan/Hunold
            104 Ernst             103   3 /De Haan/Hunold/Ernst
            105 Austin            103   3 /De Haan/Hunold/Austin
            106 Pataballa         103   3 /De Haan/Hunold/Pataballa
            107 Lorentz           103   3 /De Haan/Hunold/Lorentz
    

    Very briefly, here's how it works.
    The result set of a query CONNECT BY is the UNION ALL of several queries, all sharing a common SELECT clause.
    Any line that meets the conditions of the START WITH clause is supposed to be at LEVEL 1. So you can think of the first branch of the UNION of ALL being (in this case):

    SELECT  employee_id, last_name, manager_id
    ,     LEVEL                         AS lvl
    ,     SYS_CONNECT_BY_PATH (last_name, '/')     AS path
    FROM    hr.employees
    WHERE   last_name     = 'De Haan'
    UNION ALL ...
    

    Other rows in the result set will be LEVEL = N if the conditions of the CONNECT BY clause, where the PRIOR operator refers to any line level = N - 1.
    For example, the line with name = "Hunold" satisfies the condition to connect BY when the FIRST line is the line where last_name = "Rooster", Hunold is in the game with the LEVEL of results = 2.
    Another example: the line with name = 'Lorentz' meets the condition to connect BY when the FIRST line is the line where last_name = "Hunold", Hunold is in the result set with LEVEL = 3.
    This is a classic example of a tree structure, where the rows in the table are connected to other lines in a parent-child relationship. In a tree, each row has 0 or 1 of the parents, but a line can have any humber children. Haan has 0 parent and 1 child (that is, Hunold). Hunold has 1 parent (De Haan) and 4 children. CONNECT BY queries are useful to deal with the trees like this, especially when the parent-child relationship may extend to a number any levels.

    Other queries is obtained to connect by is below, but he could not also include:

    Select the level - 1 the_date + SYSDATE-41
    of the double
    connect by level<= sysdate="" -="" sysdate-41="" +="">

    I don't understand whether you.
    SYSDATE-SYSDATE is just 0
    0 - 41 + 1 is just-40, so you might as well say:

    select SYSDATE-41 + level - 1 the_date
                                from dual
                              connect by level <= -40;
    

    In addition, LEVEL is always a positive integer, then the CONNECT BY State will never have the value TRUE, and if the CONNECT BY clause can never be TRUE, there is no reason to have a CONNECT BY clause.
    A more reasonable request is:

    SELECT     SYSDATE + LEVEL - 1     AS the_date
    FROM      dual
    CONNECT BY     LEVEL     <= 4     -- or any positive number
    ;
    

    which produces this output, the given number of days (4 in this example) from today:

    THE_DATE
    --------------------
    06-Dec-2011 11:08:24
    07-Dec-2011 11:08:24
    08-Dec-2011 11:08:24
    09-Dec-2011 11:08:24
    

    This is a very common way to generate a Counter of Table (a table, or, as in this case, a result set, that matters). For example, if you need for the aggregates per day in a table and you want to show 0 for days that never exist in the table, then you outer join in a table of counter like the one shown above.
    This is a common use of CONNECT BY, but this is an unusual exception to the rules that is prohibited govern CONNECT BY queries. I suggest you uderstand how the query on hr.employees, above, the work before you start trying to figure out how it works.

    Published by: Frank Kulash, December 6, 2011 11:15

    The pages below are introductions to CONNECT BY:
    http://asktom.Oracle.com/pls/asktom/f?p=100:11:0:P11_QUESTION_ID:489772591421
    http://Philip.Greenspun.com/SQL/trees

  • ORA-17629: unable to connect to the remote database server

    Hello

    I have put Dataguard in place with primary and 1 physical standby for learning/test database:

    I do NOT plan the unloading of RMAN backups on the physics of the day before.

    Recorded the primary database with RMAN and when "resync catalog db_unique_name all;" is issued.
    I get the following error:
    ---------------------------------------------------------------------------------------------------------------------
    RMAN > catalog resync db_unique_name all;
    from full resynchronization of the recovery catalog
    full complete Resync
    resynchronization of data base with DB_UNIQUE_NAME ASTTESTB
    RMAN-00571: ===========================================================
    RMAN-00569: = ERROR MESSAGE STACK FOLLOWS =.
    RMAN-00571: ===========================================================
    RMAN-03002: failed to db_unique_name resynchronization command at 28/09/2011 11:34:23
    ORA-17629: unable to connect to the remote database server
    ORA-17628: Oracle 17629 error returned by remote Oracle Server
    ------------------------------------------------------------------------------------------------------------------
    Configuration of RMAN for the main proceedings are the following:

    RMAN > show all to db_unique_name asttest;

    RMAN settings for database with db_unique_name ASTTEST are:
    CONFIGURE RETENTION POLICY TO RECOVERY OF 7-DAY WINDOW;
    CONFIGURE BACKUP OPTIMIZATION # by default
    SET UP DEFAULT DISK DEVICE TYPE; # by default
    CONFIGURE CONTROLFILE AUTOBACKUP # by default
    CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO "%F" # by default
    SET UP THE DEVICE TYPE DISK PARALLELISM 1 BACKUP BACKUPSET TYPE; # by default
    CONFIGURE BACKUP OF DATA TO DISK FILE TYPE DEVICE TO 1; # by default
    CONFIGURE BACKUP ARCHIVELOG FOR DEVICE TYPE DISK TO 1; # by default
    CONFIGURE MAXSETSIZE TO UNLIMITED; # by default
    CONFIGURE ENCRYPTION OF DATABASE # by default
    CONFIGURE THE ENCRYPTION ALGORITHM "AES128"; # by default
    CONFIGURE COMPRESSION ALGORITHM 'BASIC' AND 'DEFAULT' LIBERATION OPTIMIZE FOR TRUE LOAD; # by default
    CONFIGURE DB Nom_unique "asttest" CONNECT IDENTIFIER ' ASTTEST. UMDNJ. EDU'; _
    CONFIGURE DB "Asttestb" of nom_unique CONNECT IDENTIFIER "asttestb"; _
    CONFIGURE ARCHIVELOG DELETION POLICY TO APPLIED ON ALL STANDBY;
    CONFIGURE SNAPSHOT CONTROLFILE NAME TO ' / opt/oracle/product/11.2.0/dbhome_1/dbs/snapcf_asttest.f'; # by default

    Configuration of RMAN for instance physical standby are:

    RMAN > show all to db_unique_name asttestb;

    RMAN settings for database with db_unique_name ASTTESTB are:
    CONFIGURE RETENTION POLICY TO RECOVERY OF 7-DAY WINDOW;
    CONFIGURE BACKUP OPTIMIZATION # by default
    SET UP DEFAULT DISK DEVICE TYPE; # by default
    CONFIGURE CONTROLFILE AUTOBACKUP ON;
    CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO "%F" # by default
    SET UP THE DEVICE TYPE DISK PARALLELISM 1 BACKUP BACKUPSET TYPE; # by default
    CONFIGURE BACKUP OF DATA TO DISK FILE TYPE DEVICE TO 1; # by default
    CONFIGURE BACKUP ARCHIVELOG FOR DEVICE TYPE DISK TO 1; # by default
    CONFIGURE MAXSETSIZE TO UNLIMITED; # by default
    CONFIGURE ENCRYPTION OF DATABASE # by default
    CONFIGURE THE ENCRYPTION ALGORITHM "AES128"; # by default
    CONFIGURE COMPRESSION ALGORITHM 'BASIC' AND 'DEFAULT' LIBERATION OPTIMIZE FOR TRUE LOAD; # by default
    CONFIGURE DB Nom_unique "asttest" CONNECT IDENTIFIER ' ASTTEST. UMDNJ. EDU'; _
    CONFIGURE DB "Asttestb" of nom_unique CONNECT IDENTIFIER "asttestb"; _
    CONFIGURE ARCHIVELOG DELETION POLICY TO APPLIED ON ALL STANDBY;
    CONFIGURE SNAPSHOT CONTROLFILE NAME TO ' / opt/oracle/product/11.2.0/dbhome_1/dbs/snapcf_asttest.f'; # by default

    ----------------------------------------------------------------------------------------------------------------------

    When I tested missing missing datafile and control file scenario on the primary database, it worked (Advisor to recover data)

    However, missing datafile scenario does not work on the physics of the day before.
    Here are the steps I followed:
    ********************************************
    1 renamed a file of physical data - in standby mode:

    bash - $3.2 ls - ltr

    Total 107832

    -rw - r - 1 oracle oinstall 52429312 16 September 12:19 asttest_redo03.log

    -rw - r - 1 oracle oinstall 61874176 Sep 29 15:41 asttest_temp01.dbf

    -rw - r - 1 oracle oinstall 52436992 5 Oct 11:00 rmandg_data01.dbf

    bash - $3.2 mv rmandg_data01.dbf rmandg_data01.dbf_old

    bash - $3.2 ls - ltr

    Total 107832

    -rw - r - 1 oracle oinstall 52429312 16 September 12:19 asttest_redo03.log

    -rw - r - 1 oracle oinstall 61874176 Sep 29 15:41 asttest_temp01.dbf

    -rw - r - 1 oracle oinstall 52436992 5 Oct 11:00 rmandg_data01.dbf_old


    2. restore the datafile (find the data file # view v$ recover_file):
    RMAN > restore datafile 5;



    From restoration to 5 October 11

    Segmentation fault


    3. in spite of the error, published "recover datafile command.

    4 RMAN > recover datafile 5;



    From pick up to 5 October 11

    allocated channel: ORA_DISK_1

    channel ORA_DISK_1: SID = 10 type of device = DISK

    RMAN-00571: ===========================================================

    RMAN-00569: = ERROR MESSAGE STACK FOLLOWS =.

    RMAN-00571: ===========================================================

    RMAN-03002: failure of the command recover at 05/10/2011 12:00:40

    RMAN-06094: datafile 5 must be restored.


    5. manually copy the physical primary datafile - in standby mode, & then problem recover RMAN command:
    bash - $3.2 scp oracle@msudrainier:/ora03/oradata/asttest/rmandg_data01.dbf.

    rmandg_data01.dbf 100% 50 MB 16.7 MB/s 00:03

    bash - $3.2 ls - ltr

    Total 159096

    -rw - r - 1 oracle oinstall 52429312 16 September 12:19 asttest_redo03.log

    -rw - r - 1 oracle oinstall 61874176 Sep 29 15:41 asttest_temp01.dbf

    -rw - r - 1 oracle oinstall 52436992 5 Oct 11:49 rmandg_data01.dbf_old

    -rw - r - 1 oracle oinstall 52436992 5 Oct 12:01 rmandg_data01.dbf


    RMAN > recover datafile 5;



    From pick up to 5 October 11

    using channel ORA_DISK_1



    RMAN-00571: ===========================================================

    RMAN-00569: = ERROR MESSAGE STACK FOLLOWS =.

    RMAN-00571: ===========================================================

    RMAN-03002: failure of the command recover at 05/10/2011 12:01:59

    RMAN-06067: RECOVER the DATABASE required with a backup control file or created


    6. of course RMAN commands have failed to restore the missing data file;
    So I renamed the file to original and rebooted repeat services applies - this restore the data file and now the configuration state of the DG is normal.
    *********************************************************************************

    Not quite sure if I'm still he hands the right way or if the error above is related to RMAN not able to synchronize with the physics of the day before.

    The documentation I want to talk to is here (1 paragraph):

    [http://download.oracle.com/docs/cd/B28359_01/server.111/b28294/rman.htm#BAJDFBDD | http://download.oracle.com/docs/cd/B28359_01/server.111/b28294/rman.htm#BAJDFBDD]


    Any pointers/direction and advise is greatly appreciated.

    Best regards
    NK

    I got it!

    /home/oracle:STANDBY >$ORACLE_HOME/bin/rman target sys/ catalog /@rcatalog
    
    Recovery Manager: Release 11.2.0.1.0 - Production on Fri Oct 7 14:12:10 2011
    
    Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.
    
    connected to target database: PRIMARY (DBID=1562898590, not open)
    connected to recovery catalog database
    
    RMAN> resync catalog from db_unique_name all;
    
    resyncing from database with DB_UNIQUE_NAME PRIMARY
    starting full resync of recovery catalog
    RMAN output not resynced for database with DB_UNIQUE_NAME PRIMARY
    full resync complete
    

    If the necessary connection string a target/sys and a catalogue

    RMAN target sys / catalog /@rcatalog

    I did my standby

    Will try the primary

    Best regards

    mseberg

    Work on both. Great question!

    connected to target database: PRIMARY (DBID=1562898590)
    connected to recovery catalog database
    
    RMAN> resync catalog from db_unique_name all;
    
    starting full resync of recovery catalog
    full resync complete
    
    resyncing from database with DB_UNIQUE_NAME STANDBY
    RMAN output not resynced for database with DB_UNIQUE_NAME STANDBY
    
    RMAN> 
    

    Published by: mseberg on October 7, 2011 14:16

    Thanks a ton for sticking to it. I'll add this little thing to my web site.

    Published by: mseberg on October 7, 2011 14:22

  • CONNECT BY LEVEL

    Y at - it something I do wrong below? I need generate 9 lines instead of 39. Can someone please?

    Thanks in advance.

    With the help of 10g and 11g
    CREATE TABLE V9_MONTHLY (
    S_ID        VARCHAR2(4),
    P_ID        VARCHAR2(4),
    F_ID        VARCHAR2(4),
    ELIGIBLE_MONTH  DATE,
    CONTRACT    VARCHAR2(4),
    S_ADDRESS_SUFFIX VARCHAR2(1),
    REV     FLOAT,
    EXPENSE     FLOAT,
    NI      FLOAT ) ;
     
    INSERT INTO V9_MONTHLY ( S_ID, P_ID, F_ID, ELIGIBLE_MONTH, CONTRACT, S_ADDRESS_SUFFIX, REV, EXPENSE, NI ) VALUES ( 'S001', 'P001', 'F001', '01-DEC-2009', 'C001', 'B', '300', '200', '100' ) ;
    INSERT INTO V9_MONTHLY ( S_ID, P_ID, F_ID, ELIGIBLE_MONTH, CONTRACT, S_ADDRESS_SUFFIX, REV, EXPENSE, NI ) VALUES ( 'S001', 'P001', 'F001', '01-JAN-2010', 'C001', 'B', '100', '1000', '-900' ) ;
    INSERT INTO V9_MONTHLY ( S_ID, P_ID, F_ID, ELIGIBLE_MONTH, CONTRACT, S_ADDRESS_SUFFIX, REV, EXPENSE, NI ) VALUES ( 'S001', 'P002', 'F002', '01-FEB-2010', 'C001', 'B', '200', '10000', '-9800' ) ;
    
    
     (    SELECT s_id, p_id, f_id, ADD_MONTHS(ELIGIBLE_MONTH,LEVEL-1) ELIGIBLE_MONTH FROM
                                                                                                                                                        ( SELECT s_id, p_id, f_id, ELIGIBLE_MONTH 
                                                                                                                                                                                                                                                                        FROM V9_MONTHLY   ) 
                                                                                                                                                                                                                                                                                       CONNECT BY LEVEL <= 3 ) 

    could you pass your connection by level go out and do his own table

    WITH counter AS (    SELECT LEVEL cnt
                           FROM DUAL
                     CONNECT BY LEVEL <= 3)
    SELECT  s_id,
           p_id,
           f_id,
           ADD_MONTHS (ELIGIBLE_MONTH, cnt - 1) ELIGIBLE_MONTH
      FROM V9_MONTHLY, counter;
    
    S_ID     P_ID     F_ID     ELIGIBLE_MONTH
    S001     P001     F001     12/1/2009
    S001     P001     F001     1/1/2010
    S001     P002     F002     2/1/2010
    S001     P001     F001     1/1/2010
    S001     P001     F001     2/1/2010
    S001     P002     F002     3/1/2010
    S001     P001     F001     2/1/2010
    S001     P001     F001     3/1/2010
    S001     P002     F002     4/1/2010
    

    believe this should work if you're a fan of the model clause

    /* Formatted on 12/10/2010 2:30:51 PM (QP5 v5.149.1003.31008) */
    SELECT s_id,
           p_id,
           f_id,
           ELIGIBLE_MONTH
      FROM V9_MONTHLY
    MODEL
       PARTITION BY (s_id, p_id, f_id, ELIGIBLE_MONTH x)
       DIMENSION BY (0 d)
       MEASURES (eligible_month)
       RULES
          ITERATE (3)
          (eligible_month [ITERATION_NUMBER] =
                ADD_MONTHS (eligible_month[0], ITERATION_NUMBER));
    

    Published by: pollywog on December 10, 2010 14:38

    and once again using recursive with

    * Formatted on 12/10/2010 3:56:49 PM (QP5 v5.149.1003.31008) */
        WITH t ( s_id,
                   p_id,
                   f_id,
                   nbr,
                  ELIGIBLE_MONTH
                   ) AS
                  (
                  SELECT
                   s_id,
                    p_id,
                    f_id,
                    1,
                     ELIGIBLE_MONTH
                     FROM V9_MONTHLY
                     UNION /**/ALL
                      SELECT s_id,
                               p_id,
                               f_id,
                               nbr + 1,
                               ADD_MONTHS(ELIGIBLE_MONTH, 1) FROM t WHERE nbr <= 2
                     )
                     SELECT S_ID, P_ID, ELIGIBLE_MONTH FROM t
          
    

    Published by: pollywog on December 10, 2010 15:57

  • Equium M40x does not work with connected AC

    Hi all

    I have a laptop Toshiba Satellite M40x-189, there little about 2 years and recently I have problems with it.

    The laptop when it is connected to the Board, the green light appears, but after 5 seconds it laptop turn off. the looks of dead battery, because it does not load normally, I keep connect and disconnect the AC, so that the orange light appear sometimes, sometimes for 5 seconds only. It's frustrating. When the drums come to start getting free he takes forever to be full. just at the moment where there is a load on the battery, that I can work on the laptop, even with the connected AC, but instead to use the AC laptop running on the battery, which usually lasts less than an hour, and then it's the bit of history.

    All I need is just to work with connected AC, because I normally just use the AC.
    Well I don't know what the problem is, can someone help me please

    Hello

    For me, it looks like a problem with the electronic power supply on the motherboard.
    I don t think that there is an adapter of wit AC problem itself or with the bad connection between the power supply and the Commission.
    If the AC adapter would malfunction the battery would not charge. But charges of battery, it collects a very slowly but it charges

    Finally I n t think you can do something you go to the service of your country. In such cases you re on the right side

  • Easy VPN setup with interface to multiples with the same level of security

    Hello

    I want to configure an ASA 5505 with 7.2 (4) software and dual license ISP and when I configure two interfaces with the level 0 on two security interfaces and enable vpnclient the trace message appear:

    ERROR: Cannot determine the internal and external interfaces Easy VPN remote: multiple interfaces with the same levels of security.

    vpnlclient of configuration above:

    vpnclient Server x.x.x.x where x.x.x.x
    vpnclient mode network-extension-mode
    vpnclient nem-st-autoconnect
    vpnclient TUNNEL_EZVPN_TUNNELSPEC vpngroup password *.
    vpnclient username usr_ezvpn_tunnelspec password *.
    vpnclient enable

    interfaces:

    interface Vlan200
    nameif outside1
    security-level 0
    IP x.x.x.x 255.255.255.252
    !
    interface Vlan300
    nameif outside2
    security-level 1
    IP x.x.x.x 255.255.255.128
    !

    monitor the SLA to the routing:

    monitor SLA 100
    type echo protocol ipIcmpEcho 200.221.2.45 interface outside1
    NUM-package of 5
    frequency 30
    monitor als 100 calendar life never start-time now
    ALS 200 monitor
    type echo protocol ipIcmpEcho 200.154.56.80 interface outside2
    NUM-package of 5
    frequency 30
    Annex monitor SLA 200 life never start-time now
    ALS 300 monitor
    type echo protocol ipIcmpEcho 4.2.2.1 interface outside1
    NUM-package of 5
    frequency 30
    Annex monitor SLA 300 life never start-time now
    ALS 400 monitor
    type echo protocol ipIcmpEcho 200.244.168.149 interface outside1
    NUM-package of 5
    Timeout 3000
    threshold of 3000
    frequency 30
    Annex monitor SLA 400 life never start-time now

    Follow-up:

    !
    track 1 rtr 400 accessibility
    !
    Track 2 rtr 200 accessibility
    !

    routes:

    Route 0.0.0.0 outside1 0.0.0.0 x.x.x.x 100 track 1
    Route 0.0.0.0 outside2 0.0.0.0 x.x.x.x 200 track 2

    The track works normal.

    Kind regards!

    Try using the command "backup interface" on the secondary ISP interface.

    http://www.Cisco.com/en/us/docs/security/ASA/asa72/command/reference/b_72.html#wp1338585

    You need to increase the level of security to 1 for this interface.

    By default, EasyVPN uses the highest level of safety inside and the lowest outside.  Anything between the two must be set manually.  I assume you have an interior vlan defined but not added to the posted config.

Maybe you are looking for