Flackback Query with Versioning

Hi,
I am given 2 times. I need to know what has changed between the two times.
SELECT versions_startscn, versions_starttime,
       versions_endscn, versions_endtime,
       versions_xid, versions_operation,
       sec_id, ...,...,...,...,...
  FROM op_seremain_scd
  VERSIONS BETWEEN TIMESTAMP
      TO_TIMESTAMP('2010-06-10 12:00:00', 'YYYY-MM-DD HH24:MI:SS')
AND TO_TIMESTAMP('2010-06-14 11:00:00', 'YYYY-MM-DD HH24:MI:SS')I get the following:
1                                   00000060 Z
2                                   0000009CXT
3                                   00000647 Y
4                                   000312   X
5     8088277359248     11-JUN-10 03.31.52 PM               05000C004D580000     I     000SXW9IBT
6     8088277359248     11-JUN-10 03.31.52 PM               05000C004D580000     D     000SXW9IBTThe I means Inserted and D means Deleted. Simple enough. What if the row was updated? How does that get presented? Will I see what was changed or the record at that time?
I need to be able to show the record as is and what was changed. How can I accomplish that with the above example?
Possible?

Centinul wrote:
Have you setup a test case to find out?
SQL> DROP TABLE TEST;
Table dropped.
SQL>
SQL> COLUMN VERSIONS_OPERATION FORMAT A18
SQL> COLUMN VERSIONS_ENDTIME FORMAT A25
SQL> COLUMN VERSIONS_STARTTIME FORMAT A25
SQL> COLUMN COL1 FORMAT A4
SQL> COLUMN COL2 FORMAT A4
SQL> COLUMN PREV_COL1 FORMAT A9
SQL> COLUMN PREV_COL2 FORMAT A9
SQL> SELECT * FROM V$VERSION;
BANNER
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
PL/SQL Release 10.2.0.4.0 - Production
CORE     10.2.0.4.0     Production
TNS for 64-bit Windows: Version 10.2.0.4.0 - Production
NLSRTL Version 10.2.0.4.0 - Production
SQL> CREATE TABLE test
2  (
3          ID      NUMBER  PRIMARY KEY
4  ,       COL1    VARCHAR2(3)
5  ,       COL2    VARCHAR2(3)
6  );
Table created.
SQL> INSERT INTO test (id, col1, col2) VALUES (1,'ABC','DEF');
1 row created.
SQL> INSERT INTO test (id, col1, col2) VALUES (2,'GHI','JKL');
1 row created.
SQL> INSERT INTO test (id, col1, col2) VALUES (3,'MNO','PQR');
1 row created.
SQL> INSERT INTO test (id, col1, col2) VALUES (4,'STU','VWX');
1 row created.
SQL> COMMIT;
Commit complete.
SQL> exec DBMS_LOCK.SLEEP(10);
PL/SQL procedure successfully completed.
SQL> UPDATE  test
2  SET     col1 = 'ZZZ'
3  WHERE   id   = 3
4  ;
1 row updated.
SQL> COMMIT;
Commit complete.
SQL> SELECT  id
2  ,       col1
3  ,       prev_col1
4  ,       col2
5  ,       prev_col2
6  FROM
7  (
8          SELECT  id
9          ,       col1
10          ,       col2
11          ,       LAG(col1) OVER (PARTITION BY id ORDER BY VERSIONS_STARTTIME NULLS FIRST) AS prev_col1
12          ,       LAG(col2) OVER (PARTITION BY id ORDER BY VERSIONS_STARTTIME NULLS FIRST) AS prev_col2
13          ,       versions_operation                                                       AS vo
14          FROM    test
15          VERSIONS BETWEEN TIMESTAMP MINVALUE AND MAXVALUE
16  )
17  WHERE vo = 'U'
18  ;
ID COL1 PREV_COL1 COL2 PREV_COL2
3 ZZZ  MNO       PQR  PQR
SQL> spool off;With the Flashback Versions query you see each instance of the row. Therefore, you can use the LAG/LEAD analytical functions to collapse two row changes into a single row and look at the before and after image.
Hope this helps!Exactly! The example below has solved my issue and infact helped me solve another issue and combine it with this problem I had.
Thanks again.

Similar Messages

  • SQL Query with wrong result

    Hello.
    I have a query with LEFT OUTER JOIN that I think returns invalid results. Here are the problem details:
    CREATE TABLE DOGERR(
    IdDog INTEGER,
    SfPdg CHAR(1),
    IdVpl INTEGER,
    SfVpGot INTEGER,
    SfZrr CHAR(1)
    INSERT INTO DOGERR(IdDog, SfPdg, IdVpl, SfVpGot, SfZrr) VALUES (1, 'S', 1, 1, '7');
    INSERT INTO DOGERR(IdDog, SfPdg, IdVpl, SfVpGot, SfZrr) VALUES (2, 'S', 1, 1, '7');
    INSERT INTO DOGERR(IdDog, SfPdg, IdVpl, SfVpGot, SfZrr) VALUES (3, '$', 1, 2, 'C');
    COMMIT;
    CREATE UNIQUE INDEX DOGERR_PK ON DOGERR(IdDog);
    And now the query:
    SELECT D.IdDog, D.SfPdg, D.IdVpl, D.SfVpGot, D.SfZrr, T.IdVpl AS IdVplJoin, T.SfVpGot AS SfVpGotJoin, T.SfZrr AS SfZrrJoin
    FROM DOGERR D
    LEFT OUTER JOIN (SELECT * FROM DOGERR WHERE SfPdg = 'S' OR SfPdg = 'S') T ON
    T.IdVpl = D.IdVpl AND T.SfVpGot = D.SfVpGot AND T.SfZrr = D.SfZrr
    WHERE
    D.IdDog = 3
    AND D.SfVpGot = 2
    AND D.SfZrr = 'C';
    This query should (by my understanding) return only one row in wich the joined subquery columns should be NULL. And indeed query returns only one row on Oracle Database 10g Release 10.2.0.1.0 - Production and on Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production:
    IDDOG = 3, SFPDG = "$", IDVPL = 1, SFVPGOT = 2, SFZRR = "C", IDVPLJOIN = NULL, SFVPGOTJOIN = NULL, SFZRRJOIN = NULL
    But on Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - 64bit Production it returns TWO rows:
    IDDOG = 3, SFPDG = "$", IDVPL = 1, SFVPGOT = 2, SFZRR = "C", IDVPLJOIN = 1, SFVPGOTJOIN = 1, SFZRRJOIN = "7"
    IDDOG = 3, SFPDG = "$", IDVPL = 1, SFVPGOT = 2, SFZRR = "C", IDVPLJOIN = 1, SFVPGOTJOIN = 1, SFZRRJOIN = "7"
    And now the interesting part: any of the following modified versions of query works even on Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - 64bit Production, although modifications should not modify the result set:
    -- Removed unnecessary WHERE conditions
    SELECT D.IdDog, D.SfPdg, D.IdVpl, D.SfVpGot, D.SfZrr, T.IdVpl AS IdVplJoin, T.SfVpGot AS SfVpGotJoin, T.SfZrr AS SfZrrJoin
    FROM DOGERR D
    LEFT OUTER JOIN (SELECT * FROM DOGERR WHERE SfPdg = 'S' OR SfPdg = 'S') T ON
    T.IdVpl = D.IdVpl AND T.SfVpGot = D.SfVpGot AND T.SfZrr = D.SfZrr
    WHERE
    D.IdDog = 3;
    -- Removed unnecessary OR condition in subquery
    SELECT D.IdDog, D.SfPdg, D.IdVpl, D.SfVpGot, D.SfZrr, T.IdVpl AS IdVplJoin, T.SfVpGot AS SfVpGotJoin, T.SfZrr AS SfZrrJoin
    FROM DOGERR D
    LEFT OUTER JOIN (SELECT * FROM DOGERR WHERE SfPdg = 'S') T ON
    T.IdVpl = D.IdVpl AND T.SfVpGot = D.SfVpGot AND T.SfZrr = D.SfZrr
    WHERE
    D.IdDog = 3
    AND D.SfVpGot = 2
    AND D.SfZrr = 'C';
    -- Removed columns from joined subquery from SELECT part
    SELECT D.IdDog, D.SfPdg, D.IdVpl, D.SfVpGot, D.SfZrr, T.IdVpl AS IdVplJoin, T.SfVpGot AS SfVpGotJoin
    FROM DOGERR D
    LEFT OUTER JOIN (SELECT * FROM DOGERR WHERE SfPdg = 'S' OR SfPdg = 'S') T ON
    T.IdVpl = D.IdVpl AND T.SfVpGot = D.SfVpGot AND T.SfZrr = D.SfZrr
    WHERE
    D.IdDog = 3
    AND D.SfVpGot = 2
    AND D.SfZrr = 'C';
    NOTE: the query itself is a little stupid but this is just to demonstrate the problem. We have faced this problem at a customer with our real-world query.
    So, my question is: why different results ?
    Thanks.
    David

    hi,
    welcome to the forum,
    don't have a solution, but I thought I'd let you know that the first SQL statement only returns 1 row on 10gR2
    SQL> SELECT D.IdDog, D.SfPdg, D.IdVpl, D.SfVpGot, D.SfZrr, T.IdVpl AS IdVplJoin, T.SfVpGot AS SfVpGo
    tJoin, T.SfZrr AS SfZrrJoin
      2  FROM DOGERR D
      3  LEFT OUTER JOIN (SELECT * FROM DOGERR WHERE SfPdg = 'S' OR SfPdg = 'S') T ON
      4  T.IdVpl = D.IdVpl AND T.SfVpGot = D.SfVpGot AND T.SfZrr = D.SfZrr
      5  WHERE
      6  D.IdDog = 3
      7  AND D.SfVpGot = 2
      8  AND D.SfZrr = 'C';
         IDDOG S      IDVPL    SFVPGOT S  IDVPLJOIN SFVPGOTJOIN S
             3 $          1          2 C
    SQL> select * from v$version;
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
    PL/SQL Release 10.2.0.4.0 - Production
    CORE    10.2.0.4.0      Production
    TNS for Solaris: Version 10.2.0.4.0 - Production
    NLSRTL Version 10.2.0.4.0 - Production

  • Sql query with dynamic fiscal year

    Hi,
    I wrote this query with static fiscal year and fiscal period, I need info on making the variables dynamic
    Fiscal year : starts from July1st. So this year until June'30 it is '2011' and from July'1st its '2012'
    Fiscal period: July1st its '1' and June'1st its '12'
    Query:
    select distinct o.c_num, o.ac_num, s.sub_ac_num, o.fiscal_year, o.ac_exp_date, s.sub_ac_ind
                             from org_account o
                                  left outer join sub_account s
                                  on o.c_num = s.c_num and o.ac_num = s.ac_num
                             where (o.ac_exp_date >= CURRENT_DATE or o.ac_exp_date is null)
                             and o.fiscal_year = *'2011'* --> need to be dynamic
                             and o.fiscal_period = *'12'* --> need to be dynamic
    thanks,
    Mano
    Edited by: user9332645 on Jun 2, 2011 6:55 PM

    Hi, Mano,
    Welcome to the forum!
    Whenever you have a question, please post a little sample data (CREATE TABLE and INSERT statements), and the results you want from that data.
    Always say which version of Oracle you're using.
    Since this is your first thread, I'll post some sample data for you:
    CREATE TABLE     table_x
    (     dt     DATE
    INSERT INTO table_x (dt) VALUES (DATE '2010-12-31');
    INSERT INTO table_x (dt) VALUES (DATE '2011-01-01');
    INSERT INTO table_x (dt) VALUES (DATE '2011-06-02');
    INSERT INTO table_x (dt) VALUES (DATE '2011-06-30');
    INSERT INTO table_x (dt) VALUES (DATE '2011-07-01');Is this the output you would want from that data?
    DT          FISCAL_YEAR     FISCAL_PERIOD
    31-Dec-2010 2011            06
    01-Jan-2011 2011            07
    02-Jun-2011 2011            12
    30-Jun-2011 2011            12
    01-Jul-2011 2012            01If so, here's one way to get it:
    SELECT       dt
    ,       TO_CHAR ( ADD_MONTHS (dt, 6)
                , 'YYYY'
                )     AS fiscal_year
    ,       TO_CHAR ( ADD_MONTHS (dt, 6)
                , 'MM'
                )     AS fiscal_period
    FROM       table_x
    ORDER BY  dt
    ;Since your fiscal year starts 6 months before the calendar year, you need to add 6 months to the actual date to get the fiscal year and month.
    The query above produces strings for fiscal_year and fiscal_period. If you'd rather have NUMBERs, then use EXTRACT instead of TO_CHAR:
    SELECT       dt
    ,       EXTRACT (      YEAR
                FROM     ADD_MONTHS (dt, 6)
                )     AS fiscal_year
    ,       EXTRACT (      MONTH
                FROM     ADD_MONTHS (dt, 6)
                )     AS fiscal_period
    FROM       table_x
    ORDER BY  dt
    ;The first query will work in Oracle 6 (and higher).
    I'm not sure when EXTRACT was introduced. It definitely works in Oracle 10, and may be available in earlier versions, too.

  • Issue with SQL Query with Presentation Variable as Data Source in BI Publisher

    Hello All
    I have an issue with creating BIP report based on OBIEE reports which is done using direct SQL. There is this one report in OBIEE dashboard, which is written using direct SQL. To create the pixel perfect version of this report, I am creating BIP data model using SQL Query as data source. The physical query that is used to create OBIEE report has several presentation variables in its where clause.
    select TILE4,max(APPTS), 'Top Count' from
    SELECT c5 as division,nvl(DECODE (C2,0,0,(c1/c2)*100),0) AS APPTS,NTILE (4) OVER ( ORDER BY nvl(DECODE (C2,0,0,(c1/c2)*100),0))  AS TILE4,
    c4 as dept,c6 as month FROM 
    select sum(case  when T6736.TYPE = 'ATM' then T7608.COUNT end ) as c1,
         sum(case  when T6736.TYPE in ('Call Center', 'LSM') then T7608.CONFIRMED_COUNT end ) as c2,
         T802.NAME_LEVEL_6 as c3,
         T802.NAME_LEVEL_1 as c4,
         T6172.CALENDARMONTHNAMEANDYEAR as c5,
         T6172.CALENDARMONTHNUMBERINYEAR as c6,
         T802.DEPT_CODE as c7
    from
         DW_date_DIM T6736 /* z_dim_date */ ,
         DW_MONTH_DIM T6172 /* z_dim_month */ ,
         DW_GEOS_DIM T802 /* z_dim_dept_geo_hierarchy */ ,
         DW_Count_MONTH_AGG T7608 /* z_fact_Count_month_agg */
    where  ( T802.DEpt_CODE = T7608.DEPT_CODE and T802.NAME_LEVEL_1 =  '@{PV_D}{RSD}' 
    and T802.CALENDARMONTHNAMEANDYEAR = 'July 2013'
    and T6172.MONTH_KEY = T7608.MONTH_KEY and T6736.DATE_KEY = T7608.DATE_KEY
    and (T6172.CALENDARMONTHNUMBERINYEAR between substr('@{Month_Start}',0,6)  and substr('@{Month_END}',8,13))
    and (T6736.TYPE in ('Call Center', 'LSM')) )
    group by T802.DEPT_CODE, T802.NAME_LEVEL_6, T802.NAME_LEVEL_1, T6172.CALENDARMONTHNAMEANDYEAR, T6172.CALENDARMONTHNUMBERINYEAR
    order by c4, c3, c6, c7, c5
    ))where tile4=3 group by tile4
    When I try to view data after creating the data set, I get the following error:
    Failed to load XML
    XML Parsing Error: mismatched tag. Expected: . Location: http://172.20.17.142:9704/xmlpserver/servlet/xdo Line Number 2, Column 580:
    Now when I remove those Presention variables (@{PV1}, @{PV2}) in the query with some hard coded values, it is working fine.
    So I know it is the PV that's causing this error.
    How can I work around it?
    There is no way to create equivalent report without using the direct sql..
    Thanks in advance

    I have found a solution to this problem after some more investigation. PowerQuery does not support to use SQL statement as source for Teradata (possibly same for other sources as well). This is "by design" according to Microsoft. Hence the problem
    is not because different PowerQuery versions as mentioned above. When designing the query in PowerQuery in Excel make sure to use the interface/navigation to create the query/select tables and NOT a SQL statement. The SQL statement as source works fine on
    a client machine but not when scheduling it in Power BI in the cloud. I would like to see that the functionality within PowerQuery and Excel should be the same as in Power BI in the cloud. And at least when there is a difference it would be nice with documentation
    or more descriptive errors.
    //Jonas 

  • BI 7.0 : Refresh of only one Query with VBA in  a MultiQueryWorkbook

    Does anyone know how to refresh only one query with VBA in a Workbook with several queries on different sheets?

    Hello together,
    thanks for your replies.
    In the backend EHP1 is installed and I think we don't need an extra update for the frontend. But in the VBA code of the frontend the code didn't changed.
    Our BEX Analyzer Addin version is:  7100.4.1100.34
    BEx Patch Level is: Support Package 11 Revision 1606
    The VBA code is:
    Public Function SAPBEXrefresh(allQueries As Boolean, Optional atCell As Range) As Integer
    'In the 7.0 Analyzer, ALL the items in the workbook can be refreshed, but refreshing
    'a query individually is not supported
    On Error Resume Next
      extErrorBegin ("3.x API SAPBEXRefresh called")
      If allQueries = True Then
        Common.MenuRefresh
        SAPBEXrefresh = 0
      Else
        SAPBEXrefresh = 700
        p_extErrorText = "With 7.0, this API is partly supported to refresh ALL items in the workbook, NOT an individual Query"
      End If
      extErrorEnd
    End Function
    As you can see a individually query with this VBA code is still not supported.
    Does anyone know how to change this code or if we need a special update?
    Daniel
    Edited by: Marc Schlipphak on Jan 19, 2010 7:35 PM

  • Input query with dynamic actual & forecast values by month per year

    Hello,
    I am working on a Input ready query for a forecasting application which shows both actuals and forecast numbers and the user will revise the forecast numbers by month
    Requirement: I want to build a Input query for monthly forecasting for the current year. It will be dynamic rolling of months with actuals & forecast data.
    E.g. My report has 12 months for the current year
    and if run the report in May, the months before May has to show the actuals and the months after May has to show the old forecast data so that the user will revise the numbers again in each month and save the data to the real time cube.
    Jan.Feb.Mar.Apr.May.Jun.Jul.Aug.Sept.Nov.Dec
    Act Act  Act Act Act  Old frcst for the remaining months
      user will revise forecast for these months
    So, i am able to create Input query with all restricted key figures( plan kf has change mode set to change, actual kf are not set change) and calculate key figures and all the logic is done on dynamically moving/rolling the data based on the input month of the year.
    But the problem is that i am using cal kf to dynamically roll months, i was not able to set the change option for the cal kf.
    So, how can i make sure that the dynamically changed plan months will open for entering forecast and the actuals months not to change?
    Do you guys have any better solutions in implementing it?
    I really appreciate it your input....:)
    Thanks,
    Srini

    Hi,
    Please look at the following DOC which may be useful to you and if so please grant me point.
    Regards,
    SUbha'
    Input-Ready Query
    Use
    You use input-ready queries to create applications for manual planning. These can range from simple data entry scenarios to complex planning applications.
    Integration
    You define a query that you want to use for manual planning in the BEx Query Designer (see Defining New Queries).
    In the Web Application Designer or the BEx Analyzer, you can combine the input-ready queries with other queries and planning functions to create complex planning applications.
    Prerequisites
    You can define an input-ready query on any of the following InfoProviders:
    ●     Aggregation levels (see Aggregation Levels)
    ●     MultiProviders that include at least one simple aggregation level
    The aggregation levels are created in the planning modeler; MultiProviders are defined in the modeling functional area of the Data Warehousing Workbench.
    Features
    Definition of an Input-Ready Query
    Once you have defined a query on an InfoProvider, you see the Planning tab page under the Properties of structural components (for example, in key figures or restricted key figures). The options provided there allow you to determine which structural components of an input-ready query are to be input ready at runtime and which are not. With structural components that are not input ready, you can also determine whether these components are viewed as reference data or are just protected against manual entry.
    For the structural components, you also have the following options:
    Input readiness of structural components of a query
    Option
    Description
    Not input ready (reference data)
    If they are being used as reference data, the structural components are not protected by data locks to ensure exclusive access for one user because this data serves as a reference for many users.
    This is the default setting.
    Not input ready (no reference data)
    If you want to protect structural components against manual entries but allow changes by planning functions, you can use locks to protect this data for one particular user. In this way you can ensure that the planning function works with the displayed data only and not with data that has been changed by other users.
    Input ready
    You can also determine whether an input ready query is to be started in change mode or in display mode. You find this property in the Query Properties on the Planning tab page. If there is at least one input-ready query component, the query (as long as it has not been determined otherwise) is started in display mode.
    In BI applications that use input ready queries as data providers, you can enter data manually at runtime. For more information, see Performing Manual Planning and Creation of Planning Applications.
    Example
    You want to create an input-ready query for manual planning for a plan-actual comparison of revenues for a set of products. You want the plan data in a real-time-enabled InfoCube and the actual data in a standard InfoCube.
           1.      Create a MultiProvider that includes the InfoCubes for the plan and actual data.
           2.      Define an aggregation level on the MultiProvider which contains the characteristic Product and the key figure Revenue.
           3.      On the aggregation level, create two restricted key figures Plan Revenue and Actual Revenue. For restriction, choose the characteristic 0INFOPROV and restrict it to the plan or actual InfoCube.
           4.      Add the restricted key figures to the key figure structure. Insert Product into the rows. For Plan Revenue, choose Input Ready for the input-readiness option. For Actual Revenue, choose the option Not Input Ready (Reference Data).
           5.      In the query properties, set the indicator that determines whether the queries are started in display or change mode as required.
    Example of an input-ready query
    Product
    Plan Revenue
    Actual Revenue
    P01
    20
    P02
    30
    If you want to keep actual and plan data in a real-time enabled InfoCube, you do not require a MultiProvider for the task described above. Create an aggregation level on the InfoCube and define the input-ready query for the aggregation level. In the example above, a version characteristic acts as the InfoProvider. Create restricted key figures with the plan or actual version and proceed as in the previous example.

  • Linking Access tables, creating a query with using both Access and Oracle

    Hello,
    I am using 3.0.04.34 version Oracle Developer. I am supposed to create a script/procedure to use both Access tables and oracle tables together. There is an option in developer to copy the access tables into oracle. But it doesn't help me. Because when we updated the access tables
    the copied ones are not be updated. How can I created a linked access tables to oracle and create a query with using both access and oracle table together.
    I will appreciate if you guys help me. I look forward to hearing from you guys.
    Thanks,
    Pinar

    Pinar,
    to be able to query MS Access tables in Oracle you need an additional product, the Oracle Database Gateway for ODBC. It allows you to link any foreign database into an Oracle database using a suitable ODBC driver. You can then access the MS Access tables through a database link based on the Database Gateway for ODBC. This will also allow you to join local Oracle and remote MS Access tables from your Oracle database.
    There's a note on My Oracle Support which gives you more details:Document 233876.1 Options for Connecting to Foreign Data Stores and Non-Oracle Databases - For example - DB2, SQL*Server, Sybase, Informix, Teradata, MySQL
    And there's also a dedicated Forum: Heterogeneous Connectivity

  • Creating Query with dynamic columns to show results

    Hi experts,
    I need to know how to create a query with dynamic columns. Meaning, I don't want to create a query with fixed columns representing the 12 periods of the fiscal year to show me actuals as the fiscal year proceeds.
    For example, if I am currently in the middle of period 3 (March) of a fiscal year, when I execute the query, I need it to automatically only show me the 'Actuals' for periods 1 and 2, without seeing the columns from periods 3 to 12 showing blank.
    Then when I am in the middle period 5 (May) the query should ONLY show me the columns for periods 1 to 4 'Actuals', no results should be shown for periods 5 to 12 yet, and I don't want to even see blank columns for period 6 to 12.
    How do I define my columns, to achieve this.
    Maximum points will be awarded.
    Thanks Everyone.

    Hi Josh,
    I'm having a little difficuluty understanding what should be included in my restricted key figures.
    The time characteristics that I have available to use are:
    0FISCPER3 (posting period)
    0FISCYEAR (fiscal year), currently using SAP EXIT to default current fiscal year.
    0FISCVARNT (fiscal year variant).
    In addition, I have the following characteristics available to be used in the columns:
    Value type (10)
    version (currently I'm using variable for it)
    Currency type (020)
    Currency (USD).
    Can you explain what my restricted key figure should be based on and how it should look.
    I tried to create a restircted key figure using 0AMOUNT, and 0FISCPER3. For 0FISCPER3  I created a range from 1 to previous period (using SAP EXIT that supplied previous period).I also had value type, version, currency type, and currency included in that restricted key figure.Then when I tried to drag 0FISCPER3 under the restricted key figure once again, it wouldn't let me, probably because I've already used 0FISCPER3 in the restricted key figure.
    Please let me know if my explanation is not clear.
    Your step by step help would be great.
    Thanks
    Edited by: Ehab Mansour on Sep 23, 2008 2:40 PM

  • Query with two spatial operators

    Hi,
    I need prepare query with sdo_any_interact and sdo_filter
    Following query doesn't work any ideas?
    SELECT ROWID, GEOMETRY, 'MVDEMO:L.MAJOR TOLL ROAD', null, 'null', -1, 'rule#0'
    FROM PARCELS P
    WHERE SDO_ANYINTERACT(P.GEOMETRY,
    (SELECT L.GEOMETRY
    FROM SHP_SIMPLYFIED L
    WHERE L.TASK = '4')) = 'TRUE'
    and MDSYS.SDO_FILTER(P.GEOMETRY
    , MDSYS.SDO_GEOMETRY(2003
    , 2180
    , NULL
    , MDSYS.SDO_ELEM_INFO_ARRAY(1, 1003, 3)
    , MDSYS.SDO_ORDINATE_ARRAY(482850, 236980, 510333, 248133))
    --, MDSYS.SDO_ORDINATE_ARRAY(:MVQBOXXL, :MVQBOXYL, :MVQBOXXH, :MVQBOXYH))
    , 'querytype=WINDOW') = 'TRUE'
    Kind regards,
    Tomek

    Hi Jack,
    Join - the same error:
    the error is
    ORA-00904: "MDSYS"."SDO_PQRY": invalid identifier
    00904. 00000 - "%s: invalid identifier"
    *Cause:
    *Action:
    Error at Line: 13 Column: 60
    TASK column - is not null, unique
    parcels are partitioned table (3 000 000 rows)
    i think this error is connected with partitoning
    in the first version i put any_interact into view with read only option
    select * from this view works fine but take a long time,
    next i build theme in MapBuider but preview return error (same), (MapBuilder buid query on view and add query_window filter to reduce number of objects)
    Thx,
    Tomek

  • Wrong result for query with like and %

    I have a strange problem with query with like and %.
    When I run this script:
    ALTER SESSION SET NLS_SORT = 'BINARY_CI';
    ALTER SESSION SET NLS_COMP = 'LINGUISTIC';
    -- SELECT * FROM NLS_SESSION_PARAMETERS;
    -- drop table test1;
    CREATE TABLE TEST1(K1 NVARCHAR2(80));
    INSERT INTO TEST1 VALUES ('gsdk');
    INSERT INTO TEST1 VALUES ('ąxyz');
    INSERT INTO TEST1 VALUES ('ŁFa');
    INSERT INTO TEST1 VALUES ('ła');
    INSERT INTO TEST1 VALUES ('Śab');
    INSERT INTO TEST1 VALUES ('Śrrrb');
    commit;
    select * from TEST1 where k1 like N'Ł%';
    I get this:
    K1
    ŁFa
    ła
    Śab <- WRONG
    Śrrrb <- WRONG
    4 rows selected
    When i change datatype to varchar2 this code work correct.
    Is this a bug or what ?
    The execution plan:
    PLAN_TABLE_OUTPUT
    SQL_ID d3d64aupz4bb5, child number 2
    select * from TEST1 where k1 like N'Ł%'
    Plan hash value: 4122059633
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
    | 0 | SELECT STATEMENT | | | | 2 (100)| |
    |* 1 | TABLE ACCESS FULL| TEST1 | 1 | 82 | 2 (0)| 00:00:01 |
    Predicate Information (identified by operation id):
    1 - filter((NLSSORT("K1",'nls_sort=''BINARY_CI''')>=HEXTORAW('014200'
    ) AND NLSSORT("K1",'nls_sort=''BINARY_CI''')<HEXTORAW('01610100') ))
    Note
    - dynamic sampling used for this statement (level=2)

    DATABASE NLS CONFIGURATION:
    NLS_CHARACTERSET AL32UTF8
    NLS_NCHAR_CHARACTERSET     AL16UTF16
    NLS_COMP     BINARY
    NLS_SORT     BINARY
    Oracle version 11.2.0.2.0

  • Problem accessing Infosets using Query with SQL

    Hi,
    I have Lumira desktop version 1.18.0.
    Using the Query with SQL connection, I successfully connected to SAP R/3 6. I was able to view the User Groups under CATALOG_VIEW, but it seems I cannot go beyong this point and select an Infoset. When I click on an Infoset I expect the Query pane to be populated with the SQL statement but nothing happens.
    I attached a screenshot for clarification
    Thanks
    Dany

    Hi Dany,
    A suggestion for you would be to use another client tool & check if the behavior is the same. I suggest that you use Information Design Tool (from BOE 4.1), create a connection to your ERP, then a data foundation on top of that connection and check if the behavior is the same. This way we can isolate if the problem is caused by the client tool or by the backend.
    My 2 cents
    Antoine

  • DUMP in SAPDBEQI when executing a Query with InfoSet = EQI

    Hi experts,
    I made a Query that contains an Infoset, with the logical database EQI. When I execute the query it shows the following DUMP:
    Runtime Errors = SAPSQL_AMBIGUOUS_FIELDNAME 
    Except.            = CX_SY_DYNAMIC_OSQL_SEMANTICS
    Maybe is an error? I think it is, but searching for a SAP Note I don't find anyone.
    What I could see is that the system is executing an extra validation, with this authority check:
    * additional authority checks via BAdI
      PERFORM authoritycheck_diaufk_badi_f01 USING diaufk 'IE07'.
    This function is encapsulated on the include "DBAFIF01".
    I am executing the SAP Query on version ECC 6.0.
    Lots of thanks,
    Javi

    Hi FireFighter,
    First of all, thanks for your answer. I have no problem of authorization to execute IE07.
    Do you have any other idea?
    Thanks!!!

  • Query Builder within SQL Developer 2.1 versus Query Builder Version 6.0.7.1

    Dear all,
    dear Sue Harper,
    we use Oracle 10g (upgrade to 11g is planed) and used the Oracle Query Builder Version 6.0.7.1 by now unless we got to know about the SQL Developer 2.1 including the Query Builder a few weeks ago to produce our SQL statements an efficient way.
    Even tho the SQL Developer 2.1 Query Builder already has some nice features, like sorting the data fields ascending, export to excel, etc, that the Oracle Query Builder Version 6.0.7.1 did not have had, we miss some essential features, like the in-statement, define column, etc while on the other side tables are not included in SQL-code unless fields are selected or i.e. date fields cannot be queried in the where conditions.
    I read the release notes and know that the SQL Developer 2.1 Query Builder is scheduled for rewrite in the next release.
    Does it make any sense to summarized all things we noticed and get in touch with whomever it may concern?
    Btw, if it would be possible to define a location for the stored connections within the SQL Developer 2.1 it would be very helpful... When starting SQL Developer 2.1 in our Windows Vista network environment it never finds the connection settings (file) automatically and we have to re-import the connections from a pre-defined directory.
    Nevertheless, the SQL Developer 2.1 is a pretty user-friendly and most times reliable tool we are thankful for.
    Kind regards,
    Stefan Wagner
    [email protected]

    @user12092220
    Yep, I saw your post; sorry for not replying, but i thought it's pretty the same problem i have. ;)
    The missing possibility to query date-fields in the where clause is really one of a many things i miss in the SQL Dev Query Builder, i am sure you use an "in" statement as well as we do. I think going back to the manual creation of the where condition like we had in Version 6.0.7.1.0 should be okay with most users, at least additional to the current solution as long as the rest of the query can be built within the graphic user interface. Further to save and open a query in gui mode is really, really important for us. Not to mention that the boxes for the tables cannot be stretched over a certain extend and i cant separate the columns any longer :/
    Other than that, SQL Developer is a pretty nice tool in my eyes, it's free and hopefully Version 3.0 will be closer to what we would like the SQL Developer to be like.
    Stefan

  • Query with char. in column

    Hello all
    I have input ready query, with one char. in the columns (Line of business). When i try to add new row with data, the system puts the data with line of business =#, even when i write it under another value of line of business.
    Is it not possible to add new rows with this kind of query structure?
    best
    Yuval

    I guess DB Version shouldnt be the problem. I'm getting error when i run in sqlplus
    dev@db> select {ts '2006-08-01 00:00:00'} from dual;
    select {ts '2006-08-01 00:00:00'} from dual
    ERROR at line 1:
    ORA-00911: invalid characterBut i'm able to get output when i run in Oracle sql developer
    This works in sqlplus
    dev@db> select timestamp '2006-08-01 00:00:00' from dual;
    TIMESTAMP'2006-08-0100:00:00'
    01-AUG-06 12.00.00.000000000 AMMessage was edited by:
    Sundar M

  • Use plan from stored_outlines from query with different syntax?

    Hello,
    I'd like to know is there any ability to use via stored_outlines plan from query with different syntax?
    Database version - 11.1.06
    If yes, maybe you'll take a look at steps (based on Metalink 726802.1), what I tried to do to make it work (with no success):
    alter session set create_stored_outlines=good;
    run good query
    create private outline good from SYS_OUTLINE_0... -< GOOD
    alter session set create_stored_outlines=bad;
    run bad query
    create private outline good from SYS_OUTLINE_0... -< BAD
    update ol$ set sql_text, textlen, signature, hash_value, hash_value2 from BAD to GOOD records
    leave ol$hintcount for GOOD untouched
    delete ol$ where ol_name='BAD';
    delete ol$hints where ol_name='BAD';
    delete ol$nodes where ol_name='BAD';
    execute dbms_outln_edit.refresh_private_outline('GOOD');
    alter session set sql_trace=true;
    alter session set use_private_outlines=true;
    run bad query
    examine trace file and find that it use execution plan different from both bad and good queries
    PS: Originally bad query is posted already Re: Poor performance while join of 2 comprehensive large views and small table
    PPS: Also I review thread CBO not picking correct indexes or doing Full Scans
    Thanks,
    Sergiy
    Edited by: kiberpress on Sep 30, 2009 6:59 AM

    A query with different syntax would result in a different hash value.
    Stored outlines work based on hash value.
    Your question is probably answered now.
    Sybrand Bakker
    Senior Oracle DBA

Maybe you are looking for

  • Can you use Flash to pull up bookmarks in a PDF?

    I think that you can do this using html but if you have a PDF in your root directory will Flash be able to link to bookmarked pages in that document?

  • Flickery transitions in iDVD slide show

    I have burned two disks now using iDVD and had no trouble but I do have a question about transitions in slide shows. On the first disk I used a slide show (8 minutes, 99 images) with the "fit to music" option and the "use safe area" option for the di

  • Use of setScalableModeOn() in DataProcessor results NullPointerException

    Hi, we are working with the BI Publisher API Version 5.6.2. Because we have giant data templates we receive everytime when we call the report an OutOfMemory exception in the DataProcessor. Therefore I set setScalableModeOn before the processData() me

  • HT1338 Error message with iphoto update

    I just got a macbook pro with retina display, every time I try to update iPhoto I get an error message "iPhoto failed to download: use the purchases page to try again", I do as I told and yet I get the same error message. Can anyone help?

  • IE 10 upgrade failure

    Hi Currently we have Windows 7 desktops with IE8. Our Corp requested to upgrade all 10000 systems to upgrade with IE10. I have already installed the pre-requisite patches on all systems using SCCM. But the installation of IE fails on 50% machines wit