Querying journal tables

Hello !!!
I intend to build a module where an authorized end-user can see the content of a journal table and run some queries on it (history of a specific file or actions performed by a given user). So, I would like to know if implementing indexes on a journal table is acceptable (both for performance and maintainance of the application). What could be the associated problems and do you know a more standard or better approach ?
I thank you very much,
Denis.

What you want is to join the 2 tables to return a single resultset:
http://en.wikipedia.org/wiki/Join_(SQL)
http://www.w3schools.com/Sql/sql_join.asp
SELECT profilePic, firstname, surname, eventName
FROM clients
    INNER JOIN events ON events.clientID = clients.clientID
WHERE clients.clientID = #URL.clientID#
Mack

Similar Messages

  • URGENT NEED HELP : JOURNALING TABLES AND TRIGGERS GENERATION

    Hi
    I need generate journaling tables for any tables to audit the update, delete statements executed for the users. I captured an existant schema, then and I change the derfiniton of the target tables, setting the value of Journaling to "Server".
    But, when I generate the DDL statements, the triggers of the journaling tables don't appears in the sql file.
    ¿What is the error?
    I thing that Designer generates the triggers and the journal tables, ¿It's true?
    Thanks in advance.
    Xavi

    You have to use the "Generate Table API" menu option. This will generate the "journalling" triggers.
    HTH
    Roel

  • How can I create a query with tables in INFOSET?

    Dear Gurus,
    How can I create a query with tables in INFOSET?
    Just tables and fields INFOSET?
    Kind Regards,

    Hello
    Check following SCN Article for your understanding/reference:
    - [Using Infoset Query ,SAP Query and Quick Viewer|http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/10eab7af-0e54-2c10-28a5-87b47adbe1a5]
    Regards
    JP

  • Error when querying a table through the Query Window

    I am running a query on the following table in the ODT Query window - for some reason I get the error below when trying to retrieve the data - I can query the table just fine through SQL Plus - it errors out whether I use grid or text window
    ERROR
    Arithmetic operation resulted in an overflow.
    CREATE TABLE "RF3_PROD_1"."F_EXTRACTMETRICS" ("EXTRACT_NAME" VARCHAR2(50) NOT NULL,"RUN_START_DATE" DATE NOT NULL,"RUN_END_DATE" DATE NOT NULL,"DURATION" NUMBER DEFAULT 0 NOT NULL,"EXTRACT_START_DATE" DATE NULL,"EXTRACT_END_DATE" DATE NULL,"NUM_RECS_ADDED" NUMBER DEFAULT 0 NOT NULL,"NUM_RECS_DELETED" NUMBER DEFAULT 0 NOT NULL,"STATUS" VARCHAR2(50) NOT NULL,"COMMENTS" VARCHAR2(500) NULL) TABLESPACE "EXTRACT_TAB_01_TS" PCTFREE 15 PCTUSED 75 INITRANS 1 MAXTRANS 255 STORAGE ( FREELISTS 1 FREELIST GROUPS 1 INITIAL 8388608 NEXT 516096 MAXEXTENTS 2147483645 MINEXTENTS 1 PCTINCREASE 0 )
    I would have formatted it nicer - but that is the way that ODT created it :)

    Christian,
    I found that this happens when trying to query number fields that are reals with a large decimal value (26 decimal values and above seem to be the magic number). What is strange is that I don't get this problem when I retrieve data from the same table using the Retrieve data option (versus a query for all the data in the Query Window) so they don't seem to be utilizing the same basic code to grab and then display the data interestingly enough (I am sure you knew that). Does this allow you to replicate the issue?
    Thanks,
    Bryan

  • JOURNAL 이 2번 POST 되어 BALANCE 와 JOURNAL TABLE 상에 금액 차이가 발생했을 경우

    제품 : FIN_GL
    작성날짜 : 2003-05-13
    JOURNAL 이 2번 POST 되어 BALANCE 와 JOURNAL TABLE 상에 금액 차이가 발생했을 경우
    ==============================================================
    PURPOSE
    gl_balances 와 gl_je_lines table 상의 금액이 차이가 날 경우 data fix 방법을 제공한다.
    Problem Description
    gl_balances 와 gl_je_lines table의 금액 차이가 나서 조사해 본 결과 일부 journal 이 2번 post 되었음을 발견하였다.
    Workaround
    Solution Description
    1. 해당하는journal batch를 Reverse 처리한 다음 Posting 까지 완료한다.
    2. delete 해야 할 data를 다시 한번 아래 문장으로 확인한다.
    set heading off
    set linesize 79
    column je_batch_id format a79 trunc
    column je_header_id format a79 trunc
    column je_line_num format a79 trunc
    column batch format a79 trunc
    column header format a79 trunc
    column entered_cr format a79 trunc
    column entered_dr format a79 trunc
    column code_combination_id format a79 trunc
    select
    'gjb.je_batch_id :'||' '|| gjb.je_batch_id je_batch_id,
    'gjh.je_header_i :'||' '|| gjh.je_header_id je_header_id,
    'gjb.name :'||' '|| gjb.name batch,
    'gjh.name header :'||' '|| gjh.name header,
    'gjl.je_line_num :'||' '|| gjl.je_line_num je_line_num,
    'gjl.entered_cr :'||' '|| gjl.entered_cr entered_cr,
    'gjl.entered_dr :'||' '|| gjl.entered_dr entered_dr,
    'gjl.code_combination_id :'||' '|| gjl.code_combination_id
    code_combination_id
    from gl_je_lines gjl, gl_je_batches gjb, gl_je_headers gjh
    where gjb.je_batch_id = gjh.je_batch_id
    and gjh.je_header_id = gjl.je_header_id
    and gjb.set_of_books_id = &set_of_books
    and gjb.name like '%Reversed_Batch_Name%';
    3. 위의 문장으로 delete 해야할 batch_id와 je_header_id 를 확인 한 후 아래 문장으로 data를 backup 해둔다. (만약의 경우를 대비해 반드시 backup한다.)
    create table gl_batch_temp as
    (select * from gl_je_batches
    where set_of_books_id=&set_of_books
    and je_batch_id=&batch_id);
    create table gl_header_temp as
    (select * from gl_je_headers
    where set_of_books_id=&set_of_books
    and je_header_id=&header_id);
    create table gl_line_temp as
    (select * from gl_je_lines
    where set_of_books_id=&set_of_books
    and je_header_id=&header_id);
    4. 아래 문장으로 해당 데이타를 gl_je_batches와 gl_je_headers, gl_je_lines 테이블에서 delete한다.
    delete from gl_je_batches where
    set_of_books_id = &set_of_books
    and je_batch_id= &batch_id;
    delete from gl_je_headers where
    set_of_books_id = &set_of_books
    and je_header_id= %je_header_id;
    delete from gl_je_lines where
    set_of_books_id = &set_of_books
    and je_header_id= &je_header_id;
    모든 작업 완료후에는 balance table과 gl_je_liens 테이블의 data가 일치하는지 다시 한번 확인해주세요.
    Reference Documents
    Note 132003.1

  • Query a table using Multi Select Item

    Hi everyone!
    I got a page where I have this multiselect item, and I want to query a table using its values.
    For example: The Multiselect item has this values: 1,2,3,4,5,6,7,8,9 and 10
    And I want to query every person who has ID_CLASS 1,4,7 and 9 by selecting those IDs from the list, and when I click que Consult button the Report displays those persons.
    Whowever I can't accomplish this, I was trying to find a post about this without success.
    Can anybody help me with this?
    Thanks!!

    Hi,
    This is my problem, I select 2 or more options in the multiple select item, then after I click the "Consult" buttom it submits the page, however only 1 option is highlighted. For example I choose the first two options, then I click Consult and the page is submitted. After that only one of the 2 options are selected, but I need to get the 2 options highlighted as selected items.
    If I clear cache I think I'll lost everything. (selected items)
    Thanks again!

  • How to implement 'Quick Select' column in a query result table?

    Hi,
    I have a requirement in OAF to design a search page with 'Quick select' column.
    One of the column in the query result table should be a quick select.
    Once user clicks on the quick select column, we have to navigate back to the previous page with the row value selected.
    Can anyone help me in this.
    Thanks.

    Also refer the search exercise in the toolbox tutorials.
    you can implement the quick search in the same way as update and delete buttons.
    --Prasanna                                                                                                                                                                                                                                                                                                                                   

  • Query in Table Maintanance Generator

    Hi,
    I have a query in table maintanance generator. In tables Extract and Total we have all the entries. Is it possible to get the entry which we made in the record. I mean i need the record in this i made the changes. I cant use above tqo tables because special characters are coming. Any body can suggest.
    Regards,
    Maheedhar

    Maheedhar,
    You will have to modify the program/code that was generated from the table maintenance generator to fit your requirements. 
    You can accomplish this by digging through the transport that you created, or by debugging through SM30 when you add a new entry or hit the save button.  You should be able to find a place to add your custom logic.
    Note:  If you modify this code, anytime in the future if someone re-generates this table maintenance, your custom code will be over-written.
    Thanks,
    David

  • Strange explain plan when query SYS tables

    Oracle Version 9.2.0.7
    We have an application that runs the following query on Oracle 9.2.0.7
    SELECT T1.TABLE_NAME,T1.COLUMN_NAME, T1.SRID, T2.SDO_UB, T2.SDO_LB, T1.OWNER FROM ALL_SDO_GEOM_METADATA T1, TABLE(T1.DIMINFO) T2 WHERE T1.OWNER=UPPER(:"SYS_B_0") AND T1.TABLE_NAME=UPPER(:"SYS_B_1")
    Without the self join the query is fine, but with the self join on our customers database the explain plan is doing full table scans and Hash Joins on SYS tables and takes 2 minutes.
    Rows Row Source Operation
    2 FILTER
    2 NESTED LOOPS
    1 TABLE ACCESS FULL SDO_GEOM_METADATA_TABLE
    2 COLLECTION ITERATOR PICKLER FETCH
    1 UNION-ALL
    0 FILTER
    0 NESTED LOOPS OUTER
    0 HASH JOIN
    37 TABLE ACCESS FULL TS$
    0 HASH JOIN OUTER
    0 NESTED LOOPS OUTER
    0 NESTED LOOPS OUTER
    0 NESTED LOOPS
    1 NESTED LOOPS
    1 TABLE ACCESS BY INDEX ROWID USER$
    1 INDEX UNIQUE SCAN I_USER1 (object id 44)
    1 TABLE ACCESS BY INDEX ROWID OBJ$
    1 INDEX RANGE SCAN I_OBJ2 (object id 37)
    0 TABLE ACCESS CLUSTER TAB$
    1 INDEX UNIQUE SCAN I_OBJ# (object id 3)
    0 TABLE ACCESS CLUSTER SEG$
    0 INDEX UNIQUE SCAN I_FILE#_BLOCK# (object id 9)
    0 TABLE ACCESS BY INDEX ROWID OBJ$
    0 INDEX UNIQUE SCAN I_OBJ1 (object id 36)
    0 TABLE ACCESS FULL USER$
    0 INDEX UNIQUE SCAN I_OBJ1 (object id 36)
    0 NESTED LOOPS
    0 FIXED TABLE FULL X$KZSRO
    0 INDEX RANGE SCAN I_OBJAUTH2 (object id 109)
    0 FIXED TABLE FULL X$KZSPR
    0 FILTER
    0 NESTED LOOPS OUTER
    0 HASH JOIN
    54 TABLE ACCESS FULL USER$
    0 HASH JOIN
    29447 TABLE ACCESS FULL OBJ$
    0 HASH JOIN OUTER
    0 HASH JOIN OUTER
    0 HASH JOIN OUTER
    0 NESTED LOOPS
    0 NESTED LOOPS OUTER
    0 NESTED LOOPS OUTER
    0 NESTED LOOPS
    0 NESTED LOOPS
    0 NESTED LOOPS
    1 NESTED LOOPS
    1 TABLE ACCESS BY INDEX ROWID USER$
    1 INDEX UNIQUE SCAN I_USER1 (object id 44)
    1 TABLE ACCESS BY INDEX ROWID OBJ$
    1 INDEX RANGE SCAN I_OBJ2 (object id 37)
    0 TABLE ACCESS CLUSTER TAB$
    1 INDEX UNIQUE SCAN I_OBJ# (object id 3)
    0 TABLE ACCESS CLUSTER TS$
    0 INDEX UNIQUE SCAN I_TS# (object id 7)
    0 TABLE ACCESS CLUSTER COL$
    0 TABLE ACCESS CLUSTER SEG$
    0 INDEX UNIQUE SCAN I_FILE#_BLOCK# (object id 9)
    0 TABLE ACCESS BY INDEX ROWID OBJ$
    0 INDEX UNIQUE SCAN I_OBJ1 (object id 36)
    0 TABLE ACCESS CLUSTER COLTYPE$
    0 TABLE ACCESS FULL USER$
    0 TABLE ACCESS FULL OBJ$
    0 TABLE ACCESS FULL USER$
    0 INDEX UNIQUE SCAN I_OBJ1 (object id 36)
    0 NESTED LOOPS
    0 FIXED TABLE FULL X$KZSRO
    0 INDEX RANGE SCAN I_OBJAUTH2 (object id 109)
    0 FIXED TABLE FULL X$KZSPR
    1 FILTER
    1 NESTED LOOPS
    1 NESTED LOOPS OUTER
    1 NESTED LOOPS
    1 TABLE ACCESS BY INDEX ROWID USER$
    1 INDEX UNIQUE SCAN I_USER1 (object id 44)
    1 TABLE ACCESS BY INDEX ROWID OBJ$
    1 INDEX RANGE SCAN I_OBJ2 (object id 37)
    0 INDEX UNIQUE SCAN I_TYPED_VIEW1 (object id 105)
    1 INDEX UNIQUE SCAN I_VIEW1 (object id 104)
    0 NESTED LOOPS
    0 FIXED TABLE FULL X$KZSRO
    0 INDEX RANGE SCAN I_OBJAUTH2 (object id 109)
    0 FIXED TABLE FULL X$KZSPR
    On our development database it takes 0.07 sec with no full table scans and no hash joins.
    Rows Row Source Operation
    2 NESTED LOOPS
    1 TABLE ACCESS BY INDEX ROWID SDO_GEOM_METADATA_TABLE
    1 INDEX RANGE SCAN SDO_GEOM_IDX (object id 36753)
    1 UNION-ALL
    0 FILTER
    0 NESTED LOOPS
    0 NESTED LOOPS OUTER
    0 NESTED LOOPS OUTER
    0 NESTED LOOPS OUTER
    0 NESTED LOOPS OUTER
    0 NESTED LOOPS
    1 NESTED LOOPS
    1 TABLE ACCESS BY INDEX ROWID USER$
    1 INDEX UNIQUE SCAN I_USER1 (object id 44)
    1 TABLE ACCESS BY INDEX ROWID OBJ$
    1 INDEX RANGE SCAN I_OBJ2 (object id 37)
    0 TABLE ACCESS CLUSTER TAB$
    1 INDEX UNIQUE SCAN I_OBJ# (object id 3)
    0 TABLE ACCESS BY INDEX ROWID OBJ$
    0 INDEX UNIQUE SCAN I_OBJ1 (object id 36)
    0 INDEX UNIQUE SCAN I_OBJ1 (object id 36)
    0 TABLE ACCESS CLUSTER USER$
    0 INDEX UNIQUE SCAN I_USER# (object id 11)
    0 TABLE ACCESS CLUSTER SEG$
    0 INDEX UNIQUE SCAN I_FILE#_BLOCK# (object id 9)
    0 TABLE ACCESS CLUSTER TS$
    0 INDEX UNIQUE SCAN I_TS# (object id 7)
    0 NESTED LOOPS
    0 FIXED TABLE FULL X$KZSRO
    0 INDEX RANGE SCAN I_OBJAUTH2 (object id 109)
    0 FIXED TABLE FULL X$KZSPR
    0 FILTER
    0 NESTED LOOPS
    0 NESTED LOOPS
    0 NESTED LOOPS OUTER
    0 NESTED LOOPS OUTER
    0 NESTED LOOPS OUTER
    0 NESTED LOOPS OUTER
    0 NESTED LOOPS OUTER
    0 NESTED LOOPS OUTER
    0 NESTED LOOPS
    0 NESTED LOOPS
    0 NESTED LOOPS
    0 NESTED LOOPS
    1 NESTED LOOPS
    1 TABLE ACCESS BY INDEX ROWID USER$
    1 INDEX UNIQUE SCAN I_USER1 (object id 44)
    1 TABLE ACCESS BY INDEX ROWID OBJ$
    1 INDEX RANGE SCAN I_OBJ2 (object id 37)
    0 TABLE ACCESS CLUSTER TAB$
    1 INDEX UNIQUE SCAN I_OBJ# (object id 3)
    0 TABLE ACCESS CLUSTER TS$
    0 INDEX UNIQUE SCAN I_TS# (object id 7)
    0 TABLE ACCESS CLUSTER COL$
    0 TABLE ACCESS CLUSTER COLTYPE$
    0 TABLE ACCESS CLUSTER SEG$
    0 INDEX UNIQUE SCAN I_FILE#_BLOCK# (object id 9)
    0 TABLE ACCESS BY INDEX ROWID OBJ$
    0 INDEX UNIQUE SCAN I_OBJ1 (object id 36)
    0 TABLE ACCESS CLUSTER USER$
    0 INDEX UNIQUE SCAN I_USER# (object id 11)
    0 TABLE ACCESS BY INDEX ROWID OBJ$
    0 INDEX UNIQUE SCAN I_OBJ1 (object id 36)
    0 TABLE ACCESS CLUSTER USER$
    0 INDEX UNIQUE SCAN I_USER# (object id 11)
    0 INDEX UNIQUE SCAN I_OBJ1 (object id 36)
    0 TABLE ACCESS BY INDEX ROWID OBJ$
    0 INDEX RANGE SCAN I_OBJ3 (object id 38)
    0 TABLE ACCESS CLUSTER USER$
    0 INDEX UNIQUE SCAN I_USER# (object id 11)
    0 NESTED LOOPS
    0 FIXED TABLE FULL X$KZSRO
    0 INDEX RANGE SCAN I_OBJAUTH2 (object id 109)
    0 FIXED TABLE FULL X$KZSPR
    1 FILTER
    1 NESTED LOOPS
    1 NESTED LOOPS OUTER
    1 NESTED LOOPS
    1 TABLE ACCESS BY INDEX ROWID USER$
    1 INDEX UNIQUE SCAN I_USER1 (object id 44)
    1 TABLE ACCESS BY INDEX ROWID OBJ$
    1 INDEX RANGE SCAN I_OBJ2 (object id 37)
    0 INDEX UNIQUE SCAN I_TYPED_VIEW1 (object id 105)
    1 INDEX UNIQUE SCAN I_VIEW1 (object id 104)
    0 NESTED LOOPS
    0 FIXED TABLE FULL X$KZSRO
    0 INDEX RANGE SCAN I_OBJAUTH2 (object id 109)
    0 FIXED TABLE FULL X$KZSPR
    2 COLLECTION ITERATOR PICKLER FETCH
    ALL_SDO_GEOM_METADATA is a view in the MDSYS schema (generated by Oracle ).
    SELECT SDO_OWNER OWNER,
    SDO_TABLE_NAME TABLE_NAME,
    SDO_COLUMN_NAME COLUMN_NAME,
    SDO_DIMINFO DIMINFO,
    SDO_SRID SRID
    FROM SDO_GEOM_METADATA_TABLE
    WHERE
    (exists
    (select table_name from all_tables
    where table_name=sdo_table_name
    and owner = sdo_owner
    union all
    select table_name from all_object_tables
    where table_name=sdo_table_name
    and owner = sdo_owner
    union all
    select view_name table_name from all_views
    where view_name=sdo_table_name
    and owner = sdo_owner))
    Statistics have been gathered for the MDSYS user.
    If this had not been SYS schema I would have immediately concluded that fresh statistics are required. The SYS objects concerend are valid with all indexes
    From my understanding you are not meant to gather stats for the SYS schema in Oracle 9 as Data Dictionary queries still uses RBO?
    Any ideas as to why Oracle is doing full table scans when querying SYS tables? The optimizer_mode is set to FIRST_ROWS.
    Any ideas greatly recevied.
    Thanks

    Maybe I'm missing something but this:
    INDEX FULL SCAN     SISESTAT     I0_ESTRUTURA_COMERCIALindicates that one of those indexes is being used.
    This:
    T_ESTRUTURA_COMERCIALIs nowhere to be found in your Explain Plan. It appears that either you have posted the wrong plan
    or Oracle is doing a query rewrite to a materialized view.

  • Journal tables in SQL Developer Data Modeler

    In my database I use journal tables, which can be generated automatically by Oracle Designer.
    Now that I'm trying to start using SQL Developer Data Modeler, I can't find how to make journal tables with it.
    Does anyone know whether Data Modeler supports journal tables or not? And if it does, how can I generate one?

    No automatic generation you have to create them manually - use copy/paste to speed up the process.
    Philip

  • Query DB2 tables from oracle using normal view

    This is with regard to querying db2 tables using oracle views. The view is created using dblink. The querying is not an one time activity.querying will be done once in a day. Can i use normal view (will it work ) or should i use materialised view. will i be able to view the added records in db2 table using normal view?
    thanks,
    vinodh

    Vinodh2 wrote:
    This is with regard to querying db2 tables using oracle views. The view is created using dblink. The querying is not an one time activity.querying will be done once in a day. Can i use normal view (will it work ) or should i use materialised view. will i be able to view the added records in db2 table using normal view?How can the SQL select statement via a dblink not work for a view, but the same SQL select statement work for a materialised view?
    Do you think the database link or remote database care whether the select SQL that hits it, comes from a PL/SQL procedure, a view, a materialised view, a job or whatever else? It has no idea what/who is behind that select SQL - and nor does it care.
    As for the benefits of a view vs. a materialised view - that depends on the requirements for needing to use that foreign database's data in the local database.

  • Refresh table-form query on table only

    Hello,
    I have a group being generated as a table-form layout. What I would like is for the table page to be refreshed always on entry. I can't set the group requery condition to always, or "when entering the page" as then the view object is executed going navigating from the table page to the form page. This seems a very simple requirement to me but Im struggling to come up with an elegant solution.
    Basically what i need is the refreshCondition on the invokeAction binding executable to be "Always and layout=table".
    Any help would be greatly appreciated !
    Cheers,
    Brent

    How do you do this, if your current page is a .jsff and not a .jspx? When I look at the refreshCondition, a .jsff does not have access to the facesContext.
    Thanks,
    Michelle
    Since this question was already answered, I created a new thread:
    Refresh table-form query on table only for .jsff pages
    Edited by: MSchaffer on Dec 1, 2010 11:54 AM

  • ORA-00604 ORA-00904 When query partitioned table with partitioned indexes

    Got ORA-00604 ORA-00904 When query partitioned table with partitioned indexes in the data warehouse environment.
    Query runs fine when query the partitioned table without partitioned indexes.
    Here is the query.
    SELECT al2.vdc_name, al7.model_series_name, COUNT (DISTINCT (al1.vin)),
    al27.accessory_code
    FROM vlc.veh_vdc_accessorization_fact al1,
    vlc.vdc_dim al2,
    vlc.model_attribute_dim al7,
    vlc.ppo_list_dim al18,
    vlc.ppo_list_indiv_type_dim al23,
    vlc.accy_type_dim al27
    WHERE ( al2.vdc_id = al1.vdc_location_id
    AND al7.model_attribute_id = al1.model_attribute_id
    AND al18.mydppolist_id = al1.ppo_list_id
    AND al23.mydppolist_id = al18.mydppolist_id
    AND al23.mydaccytyp_id = al27.mydaccytyp_id
    AND ( al7.model_series_name IN ('SCION TC', 'SCION XA', 'SCION XB')
    AND al2.vdc_name IN
    ('PORT OF BALTIMORE',
    'PORT OF JACKSONVILLE - LEXUS',
    'PORT OF LONG BEACH',
    'PORT OF NEWARK',
    'PORT OF PORTLAND'
    AND al27.accessory_code IN ('42', '43', '44', '45')
    GROUP BY al2.vdc_name, al7.model_series_name, al27.accessory_code

    I would recommend that you post this at the following OTN forum:
    Database - General
    General Database Discussions
    and perhaps at:
    Oracle Warehouse Builder
    Warehouse Builder
    The Oracle OLAP forum typically does not cover general data warehousing topics.

  • Why query against table(dbms_xplan.display) take too long?

    the env is PROD, version is Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi.
    Most of the time, when I do explain plan and query the table(dbms_xplan.display), it takes like 3-8 minutes to display the result.
    So, I wonder what might go wrong here?
    How a simple query would take this long?
    Any thought or guess are welcome.
    Thanks

    That is not an option here. I only have query privilege on PROD.
    All I can do is to figure out the reason for the slowness and advise the fix.
    Thanks.

  • Query a table according to SYSTIMESTAMP  for records within an interval

    Hello ,
    I am trying to query a table based on the systimestamp and taking two timestamp as intervals.Following is the query:
    select * FROM MY_TBL where to_char(SYSTIMESTAMP,'YYYY-MM-DD HH24:MI:SS')
    BETWEEN (to_char(SYSTIMESTAMP - INTERVAL '40' hour, 'yyyy-mm-dd HH24:MI:SS'))
    AND (to_char(SYSTIMESTAMP - INTERVAL '16' hour, 'yyyy-mm-dd HH24:MI:SS'));
    I am not getting any results.(no rows selected)
    So i tried:
    SELECT * FROM MY_TBL AS OF TIMESTAMP
    to_date(to_char(SYSTIMESTAMP - INTERVAL '40' hour, 'yyyy-mm-dd HH24:MI:SS'),'YYYY-MM-DD HH24:MI:SS')
    - to_date(to_char(SYSTIMESTAMP - INTERVAL '16' hour, 'yyyy-mm-dd HH24:MI:SS'),'YYYY-MM-DD HH24:MI:SS');
    ERROR at line 3:
    ORA-00932: inconsistent datatypes: expected TIMESTAMP got DATE JULIAN
    Since TIMESTAMP is in a different format.I may be getting this error.How do i cast TIMESTAMP in the above query to map to the intervals.
    Please let me know how to approach this issue.
    Thanks in Advance,
    Santosh

    Thanks for the quick and prompt replies....
    To provide a quick background.I am providing a daily report to my customer which is based on column (DATE type) in the table.But the records were inconsistent.Hence it was agreed that we get the report based on systime stamp.
    Range is : between day-before-yesterday midnight(START_TIME) and yesterday midnight(END_TIME).A perl script runs the report at midnight 2 AM as cron .So i figure the interval can be :
    (SYSTIMESTAMP - INTERVAL '40' hour) - It is 12 AM day before-yesterday-night if run at 2 AM - Interval 1
    --------------------------------------------------------BETWEEN----------------------------------------------------------------------------
    (SYSTIMESTAMP - INTERVAL '16' hour) - It is 12 AM day yesterday-night if run at 2 AM - Interval 2
    SQL> select to_timestamp(to_char(SYSTIMESTAMP - INTERVAL '40' hour, 'yyyy-mm-dd HH24:MI:SS'),'YYYY-MM-DD HH24:MI:SS')START_TIME from dual;
    START_TIME
    08-JUN-09 06.43.59.000000000 PM
    SQL> select to_timestamp(to_char(SYSTIMESTAMP - INTERVAL '16' hour, 'yyyy-mm-dd HH24:MI:SS'),'YYYY-MM-DD HH24:MI:SS') END_TIME from dual
    2 ;
    END_TIME
    09-JUN-09 06.44.46.000000000 PM
    How do i get the records for these two intervals.
    Thankyou..
    -Santosh

Maybe you are looking for

  • Windows Server 2012 Virtual Machine Failure

    I am running Windows Server 2012 R2 Host machine.  In Hyper-V, I created a WS 2012 VM. The VM starts out OK, but after a few hours of work (configure and install SharePoint 2013), starts throwing errors (Machine had to re-boot). Eventually, the VM be

  • How do I create a permanent backup of all my iTunes data, and movies?

    I'm confused about how to effectively backup and share my data.  And know others must have wrestled with this one too - so help please! Our family works across several platforms (PC, MacBookPro, 2 iPads, iPods, 2 iPhones and appleTV) and want to have

  • Do I really need a floppy ?

    This is my first build in about 20 years. I go back to 286/386sx days  If you notice in my profile, I don't have a floppy drive. I will be installing XP SP2 (haven't bought it yet) but want to get a head start on what I need to do to get prepared. I

  • Lg Extravert- One Contact Not Receiving Texts

    Lately I've had some trouble sending texts to my contacts, but I can typically resolve that by turning my phone off and back on. However, this time my phone won't send texts to only one contact. I've tried the usual and then I dialed *228 also. The t

  • Layout Server Installation

    Hi All, As per my knowledge, layout server installation can be done in two ways: 1. layout server as a central server with Multiple Publisher clients accessing common server. 2. layout server on individual clients system I want to know Pros and cons