R12 and OTL Sql Query

I am from BI group and trying to extract all timecards from R12 OTL HXC schema. OTL has Project, Task, expenditure type. Expenditure Type will be used to get Pay element Type to match with Payroll. There is already one to one mapping table in OTL between Expenditure type and Pay element Type. I have built query which used hxc_time_building_blocks, hxc_time_attributes and others to get detail data of TimCard, the query gives start time, stop time, Project Id, Task Id, Pay element type, employee etc.
The issue I am facing is I can see only timec rad with approval status as 'SUBMITTED' and 'WORKING' but not 'APPROVED'. I can see same time_building_block_id in HXC_TIMECARD_SUMMARY table with approval status as 'APPROVED" but same time_building_block_id with approval status as 'SUBMITTED" in my query.
So my question is what I am doing wrong here, or are the 'APPROVED" time cards stored in some other table of HXC schema.
As my pretty much new and trying to understand OTL using ETRM, if anyone has qorking query or can direct me to correct tables where 'APPROVED" time cards can be found would be appreciated.
Thanks.
-- Hitesh

Hi Hitesh
I can't supply a sample piece of code, but the difference between the timecard building blocks and the timecard summary is that the building blocks contain records for each 'scope' of the timecard, right up to the timecard itself.
For example, the timecard is made up of building blocks as follows:
TIMECARD - The whole T/C
APPLICATION/PERIOD - The timecard period for each application which is in your Application Set (e.g Payroll and Projects)
DAY - e.g. Monday, Tuesday etc.
DETAIL - each hours type for each DAY.
All of these records can have a status. The status moves through WORKING, SUBMITTED, APPROVED or REJECTED.
The summary tables simply summarize the building blocks at TIMECARD and APPLICATION/PERIOD levels so that you don't need to query multiple records to work out the overall status.
If there is a mismatch between the summary and the building blocks then I suggest you have a more fundamental error.
But, it is possible that some but not all of the building blocks are approved while the whole timecard is still submitted. It will not become approved until ALL the building blocks are approved.
This may not fully answer the question but I hope it gives you a better understanding of the structure.
Regards
Tim
Edited by: TimW on Sep 24, 2009 2:04 PM

Similar Messages

  • Combine and simplify SELECT and UPDATE sql query

    foreach (BidList t in bidList)
    query = "SELECT operator_id, plot_id, status FROM booking " +
    "WHERE status='open' AND postcode='" + _plot + "' AND operator_id='0'" +
    "ORDER BY datetime ASC;" +
    "UPDATE booking SET operator_id='" + t.OperatorId + "', status='allocated' " +
    "WHERE (plot_id=" + t.PlotId + " AND operator_id='0' AND status='open') LIMIT 1;";
    dbObject.InsertBooking(query);
    I am cleaning up my code, and came across the above SQL query. Before I make use of SQL parameters, I wanted to ask if it is possible to combine them, and if so, how?

    Consider making a single long query using ‘;’ as a separator:
        query = "";
        foreach (BidList t in bidList)
            query += "UPDATE . . . ; ";
        dbObject.InsertBooking(query);
    Use StringBuilder for more improvements.

  • Validate and Edit SQL Query Errors

    I am trying to "Validate or Edit SQL Query" in APEX 3.0. When I open up the SQL Query its highlighted in red and when I click on the Validate or Edit button it gives me an error.
    I modified my marvel.conf file to include:
    AddType text/xml xbl
    AddType text/x-component htc
    and this still didnt take care of it. Any ideas and thank you in advance.
    PS: OPS - Windows Server 2003
    Upgraded from 1.6 to 3.0

    I've gotten so used to command line editing, that I rarely us "ed". back in the days of DOS, the default editor was EDLIN - one of those goofy editors that only showed one line at a time, so it wasn't much of an improvement. you could switch to the old dos editor, but that wasn't much better (just checked, it's still there)
    some nice things with command line editing
    to change everthing between the first two single quotes
    c/'...'/'new criteria'to remove everything after a specific string
    c/from.../fromto change a string that contains (or will contain) slashes
    c.1/2.1/4.

  • Difference between Static SQL Query and Dynamic SQL Query.

    Hi,
    Please explain the basic difference between static and dynamic sql queries. Please explain with example.

    Static: http://download.oracle.com/docs/cd/E11882_01/appdev.112/e10472/static.htm
    Dynamic: http://download.oracle.com/docs/cd/E11882_01/appdev.112/e10472/dynamic.htm

  • R12 AR Aging SQL Query....

    Hello all,
    I am new to apps technical..
    Please send me, the AR aging SQL query for 12.1.3.
    Thanks in Advence,
    Regards,
    Muthu

    Hi;
    Similar issue mention here many times, Please see:
    https://forums.oracle.com/forums/search.jspa?threadID=&q=AR+Aging&objID=c3&dateRange=all&userID=&numResults=15
    Regard
    Helios

  • Different Result for SQL and PL/SQL query..need a bit of help

    If i just run:
    SELECT COUNT(*) from DB where (CLOSE_TIME-OPEN_TIME<5) and (CLOSE_TIME-OPEN_TIME>=1) and OPEN_TIME>'1/1/2011';
    It works great.
    If I run
    BEGIN
    SELECT COUNT(*) from DB where (CLOSE_TIME-OPEN_TIME<5) and (CLOSE_TIME-OPEN_TIME>=1) and OPEN_TIME>'1/1/2011';
    END
    I get the following error.
    ORA-04052: error occurred when looking up remote object [email protected]
    ORA-00604: error occurred at recursive SQL level 3
    ORA-06552: PL/SQL: Compilation unit analysis terminated
    ORA-06553: PLS-488: invalid variable declaration: object 'NUMBER' must be a type or subtype
    ORA-02063: preceding 2 lines from SMGLINK

    Hi,
    Whenever you have a problem, post a complete test script that people can run to re-create the problem and test their ideas. Include CREATE TABLE and INSERT statements for any or your own tables needed.
    Post the results you want from that sample data.
    Always say which version of Oracle you're using.
    bostonmacosx wrote:
    If i just run:
    SELECT COUNT(*) from DB where (CLOSE_TIME-OPEN_TIME<5) and (CLOSE_TIME-OPEN_TIME>=1) and OPEN_TIME>'1/1/2011';If OPEN_TIME is a DATE, then don't try to compare it to a string, such as '1/1/2011'. (This is not related to the present problem, only a future one.)
    It works great.
    If I run
    BEGIN
    SELECT COUNT(*) from DB where (CLOSE_TIME-OPEN_TIME<5) and (CLOSE_TIME-OPEN_TIME>=1) and OPEN_TIME>'1/1/2011';
    END
    I get the following error.
    ORA-04052: error occurred when looking up remote object [email protected]
    ORA-00604: error occurred at recursive SQL level 3
    ORA-06552: PL/SQL: Compilation unit analysis terminated
    ORA-06553: PLS-488: invalid variable declaration: object 'NUMBER' must be a type or subtype
    ORA-02063: preceding 2 lines from SMGLINKI would expect a different error "PLS_00428: an INTO clause is expected".

  • Build a sql query fro different table and insert into a table

    Hi I have a requirement ,
    i have some table 1 table which holds rules which rules i have to apply on the sql query
    2 table will hold table name and column name and transformation
    with these help of 2 tables i want to build a sql quey and the sql query need to be insert into another  table.

    Hi Karthick,
    I am not going to build Dynamic Data Model.
    i already have table 1 contains rules let's say COUNT,
    and another table contain source table name , column name , Target table name, Source Table name like that
    so with the help of these 2 tables i want to build Sql query and going to insert into 3rd table.

  • Different LOV behavior between SQL query data model and data template

    I have noticed different behavior when using parameters linked to list of values (LOV) of type menu with the multiple selection option enabled and a SQL query data model vs a data template. Here's the example because that first sentence was probably really confusing.
    SQL Query:
    select
    plmc.MonthCode, plmc.ModalityDim, plmc.ModalityName,plmc.RegionDim
    from
    DataOut.dbo.PatientLabMonthlyCross plmc
    where
    plmc.MonthCode = 200202
    and plmc.RegionDim = 1209
    and 1 =
    case
    when coalesce(:modalityDim,null) is null
    then 1
    else
    case
    when plmc.ModalityDim in (:modalityDim)
    then 1
    else 0
    end
    end
    Putting BI Publisher into debug mode, defining a data model of type SQL Query, defining a parameter called :modalityDim linked to a LOV that allows multiple selections, and selecting a couple of values from the LOV the output of the prepared statement is:
    [081607_122647956][][STATEMENT] Sql Query : select
    plmc.MonthCode,
    plmc.ModalityDim,
    plmc.ModalityName,
    plmc.RegionDim
    from
    DataOut.dbo.PatientLabMonthlyCross plmc
    where
    plmc.MonthCode = 200202
    and plmc.RegionDim = 1209
    and 1 =
    case
    when coalesce(?,?,null) is null
    then 1
    else
    case
    when plmc.ModalityDim in (?,?)
    then 1
    else 0
    end
    end
    [081607_122647956][][STATEMENT] 1:6
    [081607_122647956][][STATEMENT] 2:7
    [081607_122647956][][STATEMENT] 3:6
    [081607_122647956][][STATEMENT] 4:7
    [081607_122654713][][EVENT] Data Generation Completed...
    [081607_122654713][][EVENT] Total Data Generation Time 7.0 seconds
    Note how the bind variable :modalityDim was changed into two parameters in the prepared statement.
    When I use this same SQL Query in a data template the output is:
    [081607_012113018][][STATEMENT] Sql Query : select
    plmc.MonthCode,
    plmc.ModalityDim,
    plmc.ModalityName,
    plmc.RegionDim
    from
    DataOut.dbo.PatientLabMonthlyCross plmc
    where
    plmc.MonthCode = 200202
    and plmc.RegionDim = 1209
    and 1 =
    case
    when coalesce(?,null) is null
    then 1
    else
    case
    when plmc.ModalityDim in (?)
    then 1
    else 0
    end
    end
    [081607_012113018][][STATEMENT] 1:'6','7'
    [081607_012113018][][STATEMENT] 2:'6','7'
    [081607_012113574][][EXCEPTION] java.sql.SQLException: Syntax error converting the nvarchar value ''6','7'' to a column of data type int.
    Note the exception because it is trying to convert the multiple parameter values.
    Am I doing something completely wrong here? I really need to use a data template because I will need to link a couple of queries together from different database vendors.
    -mark

    This is for 10.1.3.4 - because in 11g every SQL query is automatially part of a data model.
    In 10g SQL query is for simple unrelated SQL queries.
    If you need to use advance features such as:
    a) multiple SQL queries that are joined in master-detail relation ships
    b) before/after report triggers
    Then you will need to use the data template, which is an XML description
    of the queries, links, and PL/SQL calls.
    hope that helps,
    Klaus

  • Where and how do I get the SQL Query used by the Microsoft Generic Report Library - Alerts?

    Background:
    I'm tasked with the following: I need to create a new Report and the SQL
    The two canned reports that I can pattern after are: Microsoft Generic Report Library
    - Alerts (there is also an alert detail report that can be chosen within the alert report that we may want to use instead)
    - Most Common Alerts
    I'm trying to do this:
    Add another parameter to search on customfield3.
    It should be able to report on all alerts that were assigned to the specific team for the time period along with the top 10 (most common alerts) assigned to the team for the time period.
    Choose as the objects (group) all servers, but Imay need to adjust the report to just look at all alerts without having to provide objects or a group
    The struggle I'm having is: I know SQL. I know how to create an RDL file.
    But Where are the RDL files for the canned reports so I can modify the canned RDL and modify its SQL and forms?
    What is the SQL/ where can I find the SQL used for the Generic Report Library -> Alerts

    Easy but you need to extract it from Microsoft Generic Report Pack. 
    So.. the procedure is as follows:
    1) You export and unseal Management Pack from your SCOM using
    Boris's OpsgMgr tools (MPViewer
    2.3.3)
    2) Ok you've got unsealed xml, now the tricky part, use
    MpElementsExtract tool, example of usage:
    MPElementsExtract.exe <MP.xml> /ex /destination:<destination>
    That you way you get several folders out of mp:
    DWScripts, DWSubScripts, LinkedReports, ReportResources, Reports
    Take a look into content of first 2, there will be pure sql scripts, and rdl's are in Reports folder :)
    Other way is to just use SQL profiler and catch SQL query while generating report. 
    --- Jeff (Netwrix)

  • XML version in R12 and 11i

    hi,
    can someone post the command to check the XML version installed in R12 and 11i.
    Regards,
    Milan

    Hi Milan,
    can someone post the command to check the XML version installed in R12 and 11i.Use query:
    SQL> select wf_event_xml.xmlversion()xml_version from sys.dual;
    XML_VERSION
    Oracle XML Parser       2.0.2.9.0       Production
    SQL>thanks,
    X A H E E R

  • Error in executing SQL query

    Hi All,
    I am working with labview application.
    The database being used is Access.
    The tables i have to use contains the special symbol -   (not underscore.)
    Let the table name be user-data
    When i am executing the query select * from user-data its showing
    error message syntax error in from clause.
    I tried just typing the query in access also and got the same error.
    I believe its because of the usage of the special character other than underscore in table name
    Many applications using the same database is running in VB already.So there is no way for me to rename the table.
    I know i am asking an invalid question.But still....
    Is there any way for me to use the same table name and execute sql query.
    Thanks in advance

    There should be. Try putting the table name in quotes - some DBMS use single quotes, some use double quotes. For example say the table name has a space in it. Try something like:
    select * from 'a funny table';
    or
    select * from "a funny table";   (Actually, I think I'd try this one first...)
    Failing this, you have two choices: change the name of the table, or dump Access and go with a real DBMS - which you will probibly want to do anyway because it will only be a matter of time before you start hitting a performance wall. Access is particularly bad if you have more than one process making a connection to it at a time. Interms of alternatives, there are a couple really good open-source products out there, as well as no-cost versions of Oracle and SQL-Server.
    Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • SQL query as a filter in OBIEE

    i have a list of student_ID in one table ( lets say A) and its subset in another table( table B)
    i want a filter such that only the student_ID in table A which are not in table B are selected.
    i am selecting operator "not equal to/ is not in" of the student_id in table A and choosing SQL query option for adding the value.
    select distinct student_id from DatabaseName.B
    Its not working. Its giving error after a lot of minor tweaks.
    Can you help how to resolve this

    1.) Answers references RPD objects and NOT database objects. (ref. "select distinct student_id from DatabaseName.B"
    2.)
    - Create analysis (1) which retrieves all student_id's from your table B
    - save
    - Create analysis (2) which retrieves student_id's from table A
    - Create a filter criteria on column student_id: column "student_id" -> Operator "is based on results of another analysis" -> Saved analysis = "/whereeveryoustoredthat/analysis (1)" -> Relationship "is not equal to any" -> Use values in Column "student_id"
    3.) Bob's your uncle

  • Handling property name with spaces in SQL query

    Hello,
    I have some JSON that looks like this:
        "SystemId": "112234",
        "Parameter": {
            "Total Hours": [
                    "timestamp": "2015-03-15T15:20:00Z",
                    "itemValue": "0"
                    "timestamp": "2015-03-15T15:15:00Z",
                    "itemValue": "296"
    ..and am having trouble with the space in the "Total Hours" property name.  When executing a SQL query, I have tried to reference it as ["Total Hours"], [Total Hours], and "Total Hours", but none of these works.  I
    have also reviewed the "Querying DocumentDB" and "DocumentDB SQL Query Language" documents, but am unclear on how to escape this space.  As this is valid JSON, I would expect to be able to handle it via DocumentDB SQL query, but am
    not certain what I am missing.  
    Thanks for your help.
    Please remember to mark replies as answers if they help you.

    Given that the property with the name with the space contains an array, I attempted to query using:
     SELECT * FROM c WHERE c.Parameter.c["Total Hours"][0].timestamp = "2015-03-15T15:15:00Z" and a few other permutations, but no luck.  Did I misunderstand?
    Please remember to mark replies as answers if they help you.

  • Writing a function to find whether a value is present in a sql query output

    Hi gurus,
    I would like to write a function to which i will pass a value and a sql query as parameters.
    Now the function needs to execute that sql query and find whether the given value is present in the output list
    when the query is executed. If it is present it should return 'T' otherwise 'F'
    My function will look like
    CREATE FUNCTION CHECK_VALUE(VALUE VARCHAR2,V_SQL VARCHAR2) RETURN VARCHAR2
    SELECT CHECK_VALUE('Dallas','SELECT LOCATION_CODE FROM HR_LOCATIONS')
    It should check whether the value 'Dallas' is present in the output list returned by the sql query.
    Any help will be appreciated.
    Thank you.

    CREATE OR REPLACE
      FUNCTION CHECK_VALUE(
                           VALUE VARCHAR2,
                           V_SQL VARCHAR2
        RETURN VARCHAR2
        IS
            RETVAL VARCHAR2(4000);
            REFCUR SYS_REFCURSOR;
        BEGIN
            OPEN REFCUR FOR V_SQL;
            LOOP
              FETCH REFCUR INTO RETVAL;
              EXIT WHEN REFCUR%NOTFOUND;
              IF RETVAL = VALUE
                THEN
                  CLOSE REFCUR;
                  RETURN 'T';
              END IF;
            END LOOP;
            CLOSE REFCUR;
            RETURN 'F';
    END;
    Function created.
    SQL> SET SERVEROUTPUT ON
    SQL> EXEC DBMS_OUTPUT.PUT_LINE(CHECK_VALUE('DALLAS','select loc from dept'));
    T
    PL/SQL procedure successfully completed.
    SQL> EXEC DBMS_OUTPUT.PUT_LINE(CHECK_VALUE('PARIS','select loc from dept'));
    F
    PL/SQL procedure successfully completed.
    SQL> SY.

  • Some hierarchy related issues, SQL Query is including unselected columns?

    Hello Guys...
    I have something strange happening in my report.. First of all, the RPD I have is built according to JDE model.
    There is a schema which looks like this:
    BU Dim ------->Fact<---------Account Dim <--------BU Account Dim (Indeed a copy of BU Dim)
    A dim hierarchy is created as AccountDim with Account Desc at the lowest bottom level, the dimension key at that level is AcctID which is the unique identifier.
    The issue comes when I created a report using Account, Account Desc, Fact Measures. The measures are not displayed as per account even if the joins and aggr levels are all defined correctly at the proper level..
    I checked the sql that is generately, it is interested that whenever I include Account Desc column in the report, the SQL will include Actid column in the select and groupby part, which results in data being at the wrong level..
    When I remove Actid from Account Hierarchy as the key, the report runs correctly and the SQL query won't include Actid column.. However, since the removal of the ACTid key from Account Hierarchy will cause other reports not running properly, I have to revert the change back to normal.. I'd like to know what to do in order to investigate more deeply as what's going on and as why the SQL will include columns fields that are not selected at answer levels..
    Any suggestions will be greatly appreciately.. I'd like to provide the rpd file, but not sure how to..
    Many Thanks

    Hi, Vikeng,
    Why use the salary table at all, if you're not ever getting any information from it?
    Why not:
    SELECT  EmpName
    ,      DeptName
    ,      'N/A'          AS SalaryValue
    FROM     Employee
    ,     Department
    WHERE      Employee.EmployeeId     = Department.EmployeeId
    Are you saying that somethimes there is a relationship, but not with this sample data?
    If so, post some different sample data (CREATE TABLE and INSERT statements) that has a relationship for some rows, and not for others. Post the results you want from that data, and explain, with specific examples, how you get those results from that data.
    You might just need an outer join.

Maybe you are looking for