A loop in the column date - hours per day in summary

All,

Run the query against my timesheet tables below, I get the following results:

SQL - CODE

SELECT
TS.ts_date Date,
TS.user_name name,
SCI Account account,
TS.no_of_hrs hours,
Sum (TS.no_of_hrs) OVER (PARTITION BY ts.ts_date) Daily_Total
Of
eba_time_timesheet ts,
eba_time_timecodes tc
WHERE
TS.timecode_id = tc.id AND
TS.user_name AS "JohnD".
ORDER BY
1

-RESULTS-

Date name hours Total daily
1 December 09 JOHND 489310 1.5 8
1 December 09 JOHND 486830 1.5 8
1 December 09 JOHND 481710 3 8
1 December 09 JOHND 481210 8 0.5
1 December 09 JOHND 486840 8 0.5
1 December 09 JOHND 485710 8 0.5
1 December 09 JOHND 481010 8 0.5
December 2 09 JOHND 481710 1 8
December 2 09 JOHND 485710 7 8
December 3 09 JOHND 481710 6 8
December 3 09 JOHND 488810 1.5 8
December 3 09 JOHND 481310 8 0.5
4 December 09 JOHND 489710 8 8
7 December 09 JOHND 481110 8 0.5
7 December 09 JOHND 489710 7 8
7 December 09 JOHND 481210 8 0.5

However, I prefer the Total column everyday be a row in the results instead of a column. Here's an example of how I prefer the results. This statement will then be sent to a calendar for each user to see here for each account and total time twice a day.

Date name hours
1 December 09 JOHND 489310 1.5
1 December 09 JOHND 486830 1.5
1 December 09 JOHND 481710 3
1 December 09 JOHND 481210 0.5
1 December 09 JOHND 486840 0.5
1 December 09 JOHND 485710 0.5
1 December 09 JOHND 481010 0.5
* 1 December 09 JOHND daily Total 8 *.
December 2 09 JOHND 481710 1
December 2 09 JOHND 485710 7
* 2 December 09 JOHND daily Total 8 *.
December 3 09 JOHND 481710 6
December 3 09 JOHND 488810 1.5
December 3 09 JOHND 481310 0.5
* 3 December 09 JOHND daily Total 8 *.
4 December 09 JOHND 489710 8
* 4 December 09 JOHND daily Total 8 *.
7 December 09 JOHND 481110 0.5
7 December 09 JOHND 489710 7
7 December 09 JOHND 481210 0.5
* 7 December 09 JOHND daily Total 8 *.

Any help would be greatly appreciated.

This is my 1st post, so if I missed something or you need more information please let me know.

I use Oracle 10 g

Hello

Welcome to the forum!

Whenever you have a question, it helps if you post the CREATE TABLE and INSERT statements for some examples of data.
For example:

CREATE TABLE     eba_time
(     ts_date          DATE
,     name          VARCHAR2 (10)
,     account          NUMBER (6)
,     no_of_hrs           NUMBER
);

INSERT INTO eba_time (ts_date, name, account, no_of_hrs) VALUES (TO_DATE ('1-Dec-09', 'DD-Mon-RR'),  'JOHND',  489310,  1.5);
INSERT INTO eba_time (ts_date, name, account, no_of_hrs) VALUES (TO_DATE ('1-Dec-09', 'DD-Mon-RR'),  'JOHND',  486830,  1.5);
INSERT INTO eba_time (ts_date, name, account, no_of_hrs) VALUES (TO_DATE ('1-Dec-09', 'DD-Mon-RR'),  'JOHND',  481710,  3);
INSERT INTO eba_time (ts_date, name, account, no_of_hrs) VALUES (TO_DATE ('1-Dec-09', 'DD-Mon-RR'),  'JOHND',  481210,  0.5);
INSERT INTO eba_time (ts_date, name, account, no_of_hrs) VALUES (TO_DATE ('1-Dec-09', 'DD-Mon-RR'),  'JOHND',  486840,  0.5);
INSERT INTO eba_time (ts_date, name, account, no_of_hrs) VALUES (TO_DATE ('1-Dec-09', 'DD-Mon-RR'),  'JOHND',  485710,  0.5);
INSERT INTO eba_time (ts_date, name, account, no_of_hrs) VALUES (TO_DATE ('1-Dec-09', 'DD-Mon-RR'),  'JOHND',  481010,  0.5);
INSERT INTO eba_time (ts_date, name, account, no_of_hrs) VALUES (TO_DATE ('2-Dec-09', 'DD-Mon-RR'),  'JOHND',  481710,  1);
INSERT INTO eba_time (ts_date, name, account, no_of_hrs) VALUES (TO_DATE ('2-Dec-09', 'DD-Mon-RR'),  'JOHND',  485710,  7);
INSERT INTO eba_time (ts_date, name, account, no_of_hrs) VALUES (TO_DATE ('3-Dec-09', 'DD-Mon-RR'),  'JOHND',  481710,  6);
INSERT INTO eba_time (ts_date, name, account, no_of_hrs) VALUES (TO_DATE ('3-Dec-09', 'DD-Mon-RR'),  'JOHND',  488810,  1.5);
INSERT INTO eba_time (ts_date, name, account, no_of_hrs) VALUES (TO_DATE ('3-Dec-09', 'DD-Mon-RR'),  'JOHND',  481310,  0.5);
INSERT INTO eba_time (ts_date, name, account, no_of_hrs) VALUES (TO_DATE ('4-Dec-09', 'DD-Mon-RR'),  'JOHND',  489710,  8);
INSERT INTO eba_time (ts_date, name, account, no_of_hrs) VALUES (TO_DATE ('7-Dec-09', 'DD-Mon-RR'),  'JOHND',  481110,  0.5);
INSERT INTO eba_time (ts_date, name, account, no_of_hrs) VALUES (TO_DATE ('7-Dec-09', 'DD-Mon-RR'),  'JOHND',  489710,  7);
INSERT INTO eba_time (ts_date, name, account, no_of_hrs) VALUES (TO_DATE ('7-Dec-09', 'DD-Mon-RR'),  'JOHND',  481210,  0.5);

I know that you have in fact two different tables, but if you already know how to join them, you could simplify a bit the issue by claiming there is only a single table. Could you tell what you're doing, like this: "what I posted as eba_time really is a join of two tables separate."

GROUP BY... CUMULATIVE (or GROUPING SETS) is a convenient way to get totals for the same set of results with the raw data. It helps if you have a primary key or a sime column that uniquely identifies each row.

Published by: Frank Kulash, April 21, 2010 12:17

Tags: Database

Similar Questions

  • Error: CONNECTION loop in the user data

    CONNECT IN a loop in the user data:

    Table X (sample data were actually lines 35K)

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

    CODE CASE OLD_ID New_id PERSON AUTH                                                           

    01 ab122 1234 0001 AU123 99393

    07 vv353 7872 0919 FV982 78282

    01 ab122 1982 9929 99393 AU123

    04 hjsss 8839 8302 JK920 32320

    01 ab122 0001 1982 AU123 99393

    05 cg899 6728 32322 IKL020 65252

    07 w353 0919 8282 FV982 78282

    now I need to order these data comparing the values of the line to old_id new_id for each combination of code, person, case

    need output like below

    Table X

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

    CODE CASE OLD_ID New_id PERSON AUTH                                                           

    01 ab122 1234 0001 AU123 99393

    01 ab122 0001 1982 AU123 99393

    01 ab122 1982 9929 99393 AU123

    04 hjsss 8839 8302 JK920 32320

    05 cg899 6728 32322 IKL020 65252

    07 vv353 7872 0919 FV982 78282

    07 w353 0919 8282 FV982 78282

    to get to what I use:

    -Request-

    Select * from table_x

    Start by old_id not in)

    Select new_id

    from table_x

    )

    CONNECT BY old_id new_id PRIOR =

    AND code = code PRIOR

    AND case EARLIER case =

    PER person = person PREREQUISITE

    -Request-

    works very well with the sample data, but the problem is when executed with actual table that has 35K record...

    Cause: The condition specified in a CONNECT BY clause caused a loop in the application, where the next record to be selected is a descendant of itself. When this happens, it may be no end to the query.

    Action: Check the CONNECT BY clause and remove the circular reference.

    Thank you

    AK

    Hello

    CONNECT_BY_ISCYCLE is a pseudo-column that you can use in a query of CONNECTION BY NOCYCLE.  It is separated from the CONNECT BY clause.

    Try this:

    Select code, "BREAKS", person

    , SYS_CONNECT_BY_PATH (old_id, "/") AS path

    from table_x

    where CONNECT_BY_ISCYCLE = 1

    Start by old_id not in)

    Select new_id

    from table_x

    )

    CONNECT BY NOCYCLE Old_id = new_id PRIOR

    AND code = code PRIOR

    AND 'CASE' = 'BOX' PRIOR

    PER person = person PREREQUISITE

    ;

    I hope that answers your question.
    If not, post a small example data (CREATE TABLE and only relevant columns, INSERT statements) and also publish outcomes from these data.
    Explain, using specific examples, how you get these results from these data.
    Always say what version of Oracle you are using (for example, 11.2.0.2.0).

    See the FAQ forum: https://forums.oracle.com/message/9362002#9362002

  • ORA-01436: CONNECT loop in the user data when the delimited string splitting by the

    I'm trying to split a string into records. The values are three characters more '-' with a limit of 12 values. The values themselves are a combination of two data, the first being two characters, a.

    The following example translates: ORA-01436: CONNECT BY a loop in the user data

    WITH
        Data(Code, Datum)
    AS
        (
         SELECT 'VGCU3VM', '00V-YYG-BVC-PIU-DV3-EVV-TVM-' FROM Dual UNION ALL
         SELECT 'VGAU3VM', '00V-YYG-BVA-PIU-DV3-EVV-TVM-' FROM Dual UNION ALL
         SELECT 'VGLN3CM', '00V-YYG-BVL-PIN-DV3-EVC-TVM-' FROM Dual UNION ALL
         SELECT 'VGLT3PM', '00V-YYG-BVL-PIT-DV3-EVP-TVM-' FROM Dual UNION ALL
         SELECT 'VGAT3RA', '00V-YYG-BVA-PIT-DV3-EVR-TVA-' FROM Dual
        )
    SELECT
        Datum,
        LEVEL,
        SUBSTR(Datum, ((LEVEL - 1) * 4) + 1, 2),
        SUBSTR(Datum, ((LEVEL - 1) * 4) + 3, 1)
    FROM
        Data
    CONNECT BY
        Code    = PRIOR Code
        AND    LEVEL    <= LENGTH(Datum) / 4;
    
    

    Remove the 'Code = Code PREREQUISITE"clause, to avoid the error, but too many records are returned, because nothing is to limit the records in their own groups.

    The following works:

    WITH
        Data(Code, Datum)
    AS
        (
         SELECT 'VGCU3VM', '00V-YYG-BVC-PIU-DV3-EVV-TVM-' FROM Dual UNION ALL
         SELECT 'VGAU3VM', '00V-YYG-BVA-PIU-DV3-EVV-TVM-' FROM Dual UNION ALL
         SELECT 'VGLN3CM', '00V-YYG-BVL-PIN-DV3-EVC-TVM-' FROM Dual UNION ALL
         SELECT 'VGLT3PM', '00V-YYG-BVL-PIT-DV3-EVP-TVM-' FROM Dual UNION ALL
         SELECT 'VGAT3RA', '00V-YYG-BVA-PIT-DV3-EVR-TVA-' FROM Dual
        )
    SELECT
        Datum,
        SUBSTR(Datum, ((Some.Num - 1) * 4) + 1, 2) A,
        SUBSTR(Datum, ((Some.Num - 1) * 4) + 3, 1) B
    FROM
        Data,
        (SELECT LEVEL Num FROM Dual CONNECT BY LEVEL <= 12) Some
    WHERE
        SUBSTR(Datum, ((Some.Num - 1) * 4) + 1, 2) IS NOT NULL;
    
    

    What causes ORA-01436?

    Hello

    Depending on your version, you can add another condition to your CONNECT BY clause.

    It works in Oracle 11.2.0.3.0:

    SELECT

    Point of reference,

    LEVEL,

    SUBSTR (Datum, ((LEVEL-1) * 4) + 1, 2),

    SUBSTR (Datum, ((LEVEL-1) * 4) + 3, 1)

    Of

    Data

    CONNECT

    Code = Code PRIOR

    AND LEVEL<= length(datum)="">

    AND PRIOR SYS_GUID () IS NOT NULL-* ADDED *.

    ;

    Thanks for the display of the data of the sample; This is really useful!

    In addition, relational databases are designed to have 1 piece of information in each column of each row, not a list delimited by up to 12 points.  It is so basic to the design of database he called the first normal form.  You're going to solve a lot of problems even before they occur if you paste to first normal form and change the table structure to resemble the result set of this query.  (Maybe that's exactly why you're doing this query.)

  • ORA-01436: CONNECT loop in the user data, but CONNECT_BY_ISCYCLE is equal to ZERO all the

    Hello

    When I run query below, it always throws the below error:
    SELECT connect_by_root code AS code_root,
        CODE,
        CODE_DESC,
        UP_CODE 
      FROM DI_CODE_LEVEL
      WHERE TYPE_CODE='SP'
        CONNECT BY PRIOR CODE=UP_CODE;
    
    ORA-01436: CONNECT BY loop in user data
    01436. 00000 -  "CONNECT BY loop in user data"
    But when I use NOCLYCLE and CONNECT_BY_ISCYCLE to see which line is in question.
    It shows nothing, which means CONNECT_BY_ISCYCLE = ZERO for all rows.
    select * from (
        SELECT connect_by_root code AS code_root,
            CODE,
            CODE_DESC,
            UP_CODE ,
            CONNECT_BY_ISCYCLE AS ISCYCLE
          FROM DI_CODE_LEVEL
          WHERE TYPE_CODE='SP'
            CONNECT BY NOCYCLE PRIOR CODE=UP_CODE
        ) 
    where ISCYCLE>0;
    Is there another reason that sql would lift ORA-01436?
    If there is a loop, then will the combination of NOCYCLE, CONNECT_BY_ISCYCLE will show?

    Thank you

    Hello

    Apparently, one or more of the "SP" lines are at the origin of the problem.
    The WHERE clause is applied after the CONNECT BY is finished, saying:

    select * from (
        SELECT connect_by_root code AS code_root,
            CODE,
            CODE_DESC,
            UP_CODE ,
            CONNECT_BY_ISCYCLE AS ISCYCLE
          FROM DI_CODE_LEVEL
          WHERE TYPE_CODE='SP'
            CONNECT BY NOCYCLE PRIOR CODE=UP_CODE
        )
    where ISCYCLE>0;
    

    is equivalent to

    select * from (
        SELECT connect_by_root code AS code_root,
            CODE,
            CODE_DESC,
            UP_CODE ,
            CONNECT_BY_ISCYCLE AS ISCYCLE
          FROM DI_CODE_LEVEL
            CONNECT BY NOCYCLE PRIOR CODE=UP_CODE
        )
    WHERE    TYPE_CODE = 'SP'
    AND     ISCYCLE   > 0;
    

    To see where the loop occurs, you must include the lines where type_code = "SP".

    When you debug "ORA-01436: CONNECT IN a loop in the user data ', view SYS_CONNECT_BY_PATH (uk,...), where the United Kingdom is a unique key. That will tell you much more than just the root information. You might want this:

    SELECT  connect_by_root code                AS code_root,
            CODE,
            CODE_DESC,
            UP_CODE
    ,     SYS_CONNECCT_BY_PATH (code, '/')     AS path          -- For debugging
    ,       CONNECT_BY_ISCYCLE                AS ISCYCLE     -- For debugging
    FROM      DI_CODE_LEVEL
    -- WHERE TYPE_CODE = 'SP'     -- Commented out for debugging
    where      ISCYCLE > 0          -- For debugging
    CONNECT BY NOCYCLE      PRIOR CODE = UP_CODE
    

    I hope that answers your question.
    If not, post a small example data (CREATE TABLE and only relevant columns, INSERT statements), and the results you want from this data.
    Explain how you get these results from these data.
    Always tell what version of Oracle you are using.

  • CONNECT IN a loop in the user data

    Could someone help me because I can not find a solution.

    I want to build a tree of 3 tables (parent-> children-> detail)

    Everything works fine with 2 tables, but when I add the third table I get always an error ORA: ORA-01436: CONNECT BY a loop in the user data

    CREATE TABLE nineham (organisatie_id NUMBER

    (, naam VARCHAR2 (50));

    --

    CREATE TABLE seizoenen (seizoen_id NUMBER

    organisatie_id NUMBER

    (, naam VARCHAR2 (50));

    --

    CREATE TABLE competities (competitie_id NUMBER

    seizoen_id NUMBER

    (, naam VARCHAR2 (50));

    --

    INSERT INTO nineham (organisatie_id, name) VALUES (1, 'ORGANISATIE_1');

    INSERT INTO nineham (organisatie_id, name) VALUES (2, 'ORGANISATIE_2');

    --

    INSERT INTO seizoenen (seizoen_id, organisatie_id, naam) VALUES (1, 1, 'SEIZOEN_1');

    INSERT INTO seizoenen (seizoen_id, organisatie_id, naam) VALUES (2, 1, 'SEIZOEN_2');

    INSERT INTO seizoenen (seizoen_id, organisatie_id, naam) VALUES (1, 2, 'SEIZOEN_3');

    INSERT INTO seizoenen (seizoen_id, organisatie_id, naam) VALUES (2, 2, 'SEIZOEN_4');

    --

    INSERT INTO competities (competitie_id, seizoen_id, naam) VALUES (1, 1, 'COMPETITIE_1');

    INSERT INTO competities (competitie_id, seizoen_id, naam) VALUES (2, 1, 'COMPETITIE_2');

    INSERT INTO competities (competitie_id, seizoen_id, naam) VALUES (3, 2, 'COMPETITIE_3');

    INSERT INTO competities (competitie_id, seizoen_id, naam) VALUES (4, 2, "COMPETITIE_4");

    INSERT INTO competities (competitie_id, seizoen_id, naam) VALUES (5, 2, "COMPETITIE_5");

    --

    --

    --

    SELECT LPAD (' ', LEVEL * 2, ' ') | Naam AS display

    LEVEL AS lvl

    DE)

    SELECT NULL AS parent

    child organisatie_id

    naam

    To nineham

    UNION ALL

    SELECT organisatie_id AS parent

    child seizoen_id

    naam

    OF seizoenen

    UNION ALL

    Seizoen_id SELECT parent

    Child AS NULL

    naam

    OF competities

    )

    START WITH parent IS NULL

    CONNECT BY PRIOR child = parent

    ;

    Hello

    When you perform a CONNECT BY query, you must have an identifier unique to each child.  You use numbers that are unique to each table, but are no longer unique when you UNION the paintings together.  When the query finds children 1, the fact that average organisatie_id = 1, or does that mean seizoen_id = 1, or does this mean competetite_id = 1?

    Etbin suggested you change data.  Which can be difficult; It might not even be possible.  In addition, you must make sure that the new IDS are unique.  When you assign advent = 10 to a node, for example, you must be sure that 10 is not an organisatie_id.

    Here is another solution that is guarranted to generate unique IDS, without changing the actual tables:

    SELECT LPAD (' ', LEVEL * 2, ' ') | Naam AS display

    LEVEL AS lvl

    DE)

    SELECT NULL AS parent

    organisatie_id AS child

    , 1 AS the level of

    naam

    To nineham

    UNION ALL

    SELECT organisatie_id AS parent

    seizoen_id AS child

    , 2 AS the level of

    naam

    OF seizoenen

    UNION ALL

    SELECT seizoen_id AS parent

    Child AS NULL

    , 3 AS the level of

    naam

    OF competities

    )

    START WITH parent IS NULL

    AND level = 1

    CONNECT BY PRIOR child = parent

    AND layer = FIRST + 1

    ;

    The composite key formed by your original ID, and the new level number is unique.

    Note that the query above is exactly what you have posted, with the addition of the lines that refer to level.

  • Tier 1 error - please set the time implementat full equivalent hours per day

    Hi all

    When you define the Structure of work plan allow the oracle projects, I get the below error

    Tier 1 error - please configure the implementation option full-time equivalent hours per day before activating the Structure of work plan.

    Invite can you share and doc or guide where can I set this option of implementation

    Thanks in advance

    Hello

    Go to projects > Setup > system > implementation Options

    There is a tab named - staffing
    On this form, you must enter the hours full time equivalents - per day and per week.

    Dina

  • How to cut the column data

    Gurus in the morning

    I have two tables with the data in the corresponding column, BUT I need to cut the columns in a table
    the data is displayed as follows in table xpq_log
    LOG_DATE                     LOG_PTR     LOG_HDR
    01/06/2011 00:00:00     0609pro     0609IN002C_06
    04/06/2011 00:00:00     0609pro     0609IN002C_06
    05/06/2011 00:00:00     0609pro     0609IN002C_06
    06/06/2011 00:00:00     0609pro     0609IN002C_06
    07/06/2011 00:00:00     0609pro     0609IN002C_06
    09/06/2011 00:00:00     0609pro     0609IN002C_06
    10/06/2011 00:00:00     0609pro     0609IN002C_06
    12/06/2011 00:00:00     0609pro     0609IN002C_06
    01/06/2012 00:00:00     0609pro     0609IN002C_06
    02/06/2012 00:00:00     0609pro     0609IN002C_06
    03/06/2012 00:00:00     0609pro     0609IN002C_06
    06/06/2012 00:00:00     0609pro     0609IN002C_06
    07/06/2012 00:00:00     0609pro     0609IN002C_06
    08/06/2012 00:00:00     0609pro     0609IN002C_06
    09/06/2012 00:00:00     0609pro     0609IN002C_06
    In the table of printpdf as follows
    PDF_REPORT     PDF_DESCRIPTION
    IN002C                     STOCK FILE PURGE - PRINT WH CONTROL
    How can I cut the column data (log_hdr) to match column (pdf_report)?

    Any help will be much appreciated

    user11978142 wrote:
    Yes the code always starts with an alphabetic character and always ends before the underscore character and the prefix is always digital.

    And Yes to the second comment WRT 1 to many relationship.

    WRT the duplicates I want the info displayed even if there is no matching printpdf

    You talk a LEFT OUTER JOIN, then:

    See the example below (the statement are just to reproduce the paintings, just use the last query):

    WITH xpq_log AS
    (
       SELECT '0499SYS003A_06' log_hdr FROM DUAL UNION ALL
       SELECT '0612PV410W1_06' log_hdr FROM DUAL UNION ALL
       SELECT '0609IN002C_06' log_hdr FROM DUAL UNION ALL
       SELECT '2201PA100D1_30' log_hdr FROM DUAL
    )
    , printpdf AS
    (
       SELECT 'SYS003A' pdf_report, 'STOCK FILE PURGE - PRINT WH CONTROL' description FROM DUAL UNION ALL
       SELECT 'PV410W1' pdf_report, 'Description 2' description FROM DUAL
    )
    SELECT a.log_hdr, REGEXP_SUBSTR (a.log_hdr, '[[:alpha:]][^_]*') AS pdf_report
         , b.description
      FROM xpq_log a LEFT OUTER JOIN printpdf b
           ON pdf_report = REGEXP_SUBSTR (a.log_hdr, '[[:alpha:]][^_]*');
    
    Output:
    LOG_HDR        PDF_REPORT     DESCRIPTION
    -------------- -------------- -----------------------------------
    0499SYS003A_06 SYS003A        STOCK FILE PURGE - PRINT WH CONTROL
    0612PV410W1_06 PV410W1        Description 2
    2201PA100D1_30 PA100D1
    0609IN002C_06  IN002C                                           
    

    Kind regards.
    Al

  • ORA-01436: CONNECT loop in the user data

    Hello

    I have a simple bit of SQL out details on HR supervisor strings in Oracle EBS:
    SELECT     LPAD(' ', (LEVEL - 1) * 10, ' ') || person_id level_label
             , LEVEL
             , description
          FROM applsys.fnd_user u
             , hr.per_all_assignments_f h
         WHERE u.employee_id = h.person_id
    START WITH SYSDATE BETWEEN effective_start_date AND effective_end_date
           AND person_id = :personid
    CONNECT BY PRIOR person_id = supervisor_id
           AND SYSDATE BETWEEN effective_start_date AND effective_end_date
    It will return data normally without problems - e.g. data dummy below - looks very good. The names and made up person_ids.
    LEVEL_LABEL                    LEVEL     DESCRIPTION
    000001                         1     Person Person 1
              000002               2     Harry Marry
                        000003          3     John Smith
                                  000004     4     Jenna Jones
                                  000005     4     Her Name
                                  000006     4     His Name
                                  000007     4     Joseph Coat
                                  000008     4     Les Miserables
                        000009          3     Mister Smith
                        000010          3     Miss Jones
                        000011          3     Andrew And
                                  000012     4     Claire So
                                  000013     4     Hilary Hi
              000014               2     Jenny Jones
                        000015          3     Amanda Mandy
                                  000016     4     James Jim
                                  000017     4     William Wonder
                                  000018     4     Crazy Cat
                                  000019     4     Silly Cat
                                  000020     4     Tall Hill
                                  000021     4     Amazing Grace
                        000022          3     Lovely Mountain
                                  000023     4     Joyous Spring
                                  000024     4     Anonymous Name
                                  000025     4     Brian Binky
    However, if I try for an another person_id, for which a user receives an error in one part of the Oracle EBS, I get this error:

    ORA-01436: CONNECT loop in the user data

    I'm guessing there is a loop of supervisor happening somewhere, but I don't know how to determine where it might happen.

    I was wondering if there is any way I can change the SQL code to be able to work out where the loop can be, as there are about 50 people involved in Ministry to this user and I have been through all their records and can not see a loop to look through the Oracle HR screens.

    I know it's a 'big ask' to ask a vague question about some oracle SQL, so apologies for that.

    Any advice much appreciated.

    Thank you

    Hello

    To see loops, do something like this:

    SELECT     SYS_CONNECT_BY_PATH (person_id, '/')     AS path
    FROM      applsys.fnd_user           u
    ,      hr.per_all_assignments_f      h
    WHERE      u.employee_id           = h.person_id
    AND     CONNECT_BY_ISCYCLE     = 1
    CONNECT BY NOCYCLE     PRIOR person_id = supervisor_id
         AND           SYSDATE      BETWEEN     effective_start_date
                             AND      effective_end_date
    ;
    

    If you would care to post CREATE TABLE and instructions INSERT for some samples, so I could test it.

    Note there is no START WITH clause.

    If, for example, Jones is the architect of Scott, Scott is the main contractor of Adams and Adams is the architect of Jones (much to other lines is not involved in a loop), then displays 3 rows of output, such as

    PATH
    ---------------------
    Jones/Scott/Adams
    Scott/Adams/Jones
    Adams/Jones/Scott
    

    Moreover, all the same CONNECT BY queries on these tables can be a lot faster if you've made the join and date filtering in a separate subquery first:

    WITH     combined_data     AS
    (
         SELECT     person_id, supervisor_id
         FROM      applsys.fnd_user           u
         ,      hr.per_all_assignments_f      h
         WHERE      u.employee_id      = h.person_id
         AND     SYSDATE      BETWEEN     effective_start_date
                        AND      effective_end_date
    )
    SELECT     SYS_CONNECT_BY_PATH (person_id, '/')     AS path
    FROM     combined_data
    WHERE     CONNECT_BY_ISCYCLE     = 1
    CONNECT BY NOCYCLE     PRIOR person_id = supervisor_id
    ;
    
  • ToolTip on the column data

    Hello

    I want to display the ToolTip on the column data.
    To this end, I work with the data format.
    under data format I use custom format.
    on the format of data, I wrote the following code.

    < b title = "This" about says month"> month < /b >

    but it demonstrated ToolTip on 'months' and not on real data.

    Is any HTML that display dynamic data, then we can put this code instead of 'months '.

    Please, give me suggestion.

    Concerning

    Prashant

    Did you add the ' @' in your HTML simbol? They must state the values in your column.

    You should have something like months @

    KR,
    A

  • How to view the anticipated date of 3 days bb

    Greetings

    How to view the early date to 3 days with bb.

    I was able to view the current in bb, but can not able to display the date fututre.

    Help, please

    concerning

    Anthony singh

    Hello

    Add 3 days to the current date.

    days3 long = (3 * 24 * 60 * 60 * 1000);   MS

    TimeFormat SimpleDateFormat = new SimpleDateFormat ("YYYY/MM/DD HH: mm: EEE");
    timeString = «"+ timeFormat.formatLocal (System.currentTimeMillis () + Days3);»

    Thank you

    Stephenson

  • How to get the last date of 3 days for the current month?

    Hello. Guy

    How to get the last date of 3 days for the current month?

    MY OUTPUT WOULD LOOK LIKE THIS

    JANUARY 29, 2016

    JANUARY 30, 2016

    JANUARY 31, 2016


    GUYS HELP ME / / /...

    SQL > select last_day (sysdate) - level + 1 double connect by level<= 3="" order="" by="">

    LAST_DAY)

    ---------

    29 JANUARY 16

    30 JANUARY 16

    31 JANUARY 16

  • Unable to store the component "time" in the column date Oracle's ADF

    Hi friends,

    I have a table with the date column. I'm trying to set the current date with the time in the column of the table. Java.sql.Date refers to the field of the VO. When I try to turn it using the setLastUpdatedDate() it not be saved. The time is get truncated and the time is saved is 16-mar-2015 00:00:00.  How can I keep the component "hour" as well in the column with the date data type. FYI the component "hour" is saved when I do the sql uisng the insert.

    JDev version is 11.1.1.7.0

    Thank you

    Hello

    java.sql.Dateis the DATE of SQL which means it stores years, months and days whilehour, minute, second and millisecond are ignored. Also sql.Date is not related to time zones.

    java.sql.Timestampcorresponds to the SQL TIMESTAMP, which is the exact nanosecond (Note that util.Date only supported milliseconds!) with customizable precision.

    try to use the timestamp if you want exact

  • How to divide the column Date OBIEE

    Hello
    We have the name of the date column: To_Date and the format is DD/MM/YY hh.
    How to divide the date in YEARS, MONTHS, DAY as new columns.
    kindly help on that.


    Kind regards.
    CHR

    Published by: 867932 on November 23, 2011 22:18

    Hi user,

    All 3 functions can be written in RPD too. MDB layer, duplicate the date column-> the mapping tab to column of Goto-> expression-> functions Builder Select-> calendar Date functions / hour-> select DayofMOnth function. The column of your logic formula will look like,

    DayofMonth (YourDateColumn)

    Rgds,
    DpKa

  • How to transmit frames CAN cyclically inside a loop obey the emission data informed BCD?

    Hi all!

    I don't know if I don't completely understand the behavior of the situation below. I use LabVIEW 2014 and PXI-8513 card under Windows.

    NOR-XNET help reading I understood:

    Cyclical data : the data frame transmitted cyclically (periodical). The period is defined in the "transmission data" field in the properties BOX of the framework in the DBC file.

    But how the transmission time can obey informed transmission data in DBC file if I call the XNET write VI in a loop with a waiting inside? I don't know if I fully understand how it works in a while loop.

    I watch the program below, how writing would behave?

    While the loop contains a "wait until the next multiple ms" 100 and the signal selected database (dbc) has a transmission time of 0.02 s (20ms), how many times would the framework passed in the first loop?

    If your answer is "Although the time of transmitting the frame is 0.02 s in this case writing is written only once", I have another question: How can I keep a loop writing frames obeying the time of transmission of the image of the CBD? Consider that I have signals selected different frameworks at different times to transmit.

    Thanks in advance!

    When you use the XNET write Point with Single mode, it updates the value that will be transmitted according to the schedule specified in the XNET (DBC file) database. If you call multiple entries before the frame was transmitted, only the last value written shuts down during the NPC.

    If you look in the help file XNET under the API OR-XNET for LabVIEW-> Sessions-> Modes of Session, you will find information, including an example of how it works.

    In your example - if you have a timing loop of 100ms, but your message cyclic time is 1s, then will send you only the last value of 'editorial' more message cycle time. If your timing loop is 100ms, but your message time is 10ms, so you pass the value even 10 times (about... windows calendar and all that).

    In essence, you CAN transmitting frame continues to run in the background according to the time where you specified in the DBC file, but you can then update the values which are transmitted asynchronously using the single-point VI write.

    If you want to check the values passed are updated every time - you must use the stream or queue mode and your frames to the output of the buffer. That, or you must use a RT target that can update the data in a deterministic way.

  • How can I limit the total number of hours per day, that my child may be on the computer?

    Summary of the issue
    Other issues of Windows Live family safety

    What version of Windows Live Family Safety do you use?
    Version 2011 (15.4.3538.513)
    Choose your operating system version:
    Windows 7

    Additional details
    How can I limit the total time per day my kind that can be on the computer? I see only menu in which I can determine which hours of the day, they are allowed to access. Concerning the lower self, for example him limit total daily in any hours 1 hour.

    Hello

    The feature of time safely of the family has changed recently. For more information, please see this sticky post:

    How to work the allocation of time and curfew? 

    You can also consult this thread. It has information on how parental control has changed and how to put in place.

    Thank you!

Maybe you are looking for