How to display last 10 minutes data  only using sql query

Hi,
Presently, I'm using version is,
Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
PL/SQL Release 11.1.0.6.0 - Production
CORE 11.1.0.6.0 Production
TNS for 32-bit Windows: Version 11.1.0.6.0 - Production
NLSRTL Version 11.1.0.6.0 - Production
So, please consider SCOTT Schema to resolve my issue,
I want to display only last 10 minutes what records are inserted or updated or deleted.
Please provide in many ways!!
ThankQ!!

Hi,
See below:
select
from
  emp
EMPNO ENAME      JOB        MGR HIREDATE      SAL    COMM DEPTNO
7369 SMITH      CLERK     7902 17-DEC-80     800             20
7499 ALLEN      SALESMAN  7698 20-FEB-81    1600     300     30
7521 WARD       SALESMAN  7698 22-FEB-81    1250     500     30
7566 JONES      MANAGER   7839 02-APR-81    2975             20
7654 MARTIN     SALESMAN  7698 28-SEP-81    1250    1400     30
7698 BLAKE      MANAGER   7839 01-MAY-81    2850             30
7782 CLARK      MANAGER   7839 09-JUN-81    2450             10
7788 SCOTT      ANALYST   7566 19-APR-87    3000             20
7839 KING       PRESIDENT      17-NOV-81    5000             10
7844 TURNER     SALESMAN  7698 08-SEP-81    1500       0     30
7876 ADAMS      CLERK     7788 23-MAY-87    1100             20
7900 JAMES      CLERK     7698 03-DEC-81     950             30
7902 FORD       ANALYST   7566 03-DEC-81    3000             20
7934 MILLER     CLERK     7782 23-JAN-82    1300             10
14 rows selected
select
from
  emp
minus
select
from
  emp
   as of timestamp (systimestamp - interval '10' minute)
EMPNO ENAME      JOB        MGR HIREDATE      SAL    COMM DEPTNO
0 rows selected
update
  emp
set
  ename = ename || ' x'
where
  empno = 7934
--1 rows updated.
select
from
  emp
minus
select
from
  emp
   as of timestamp (systimestamp - interval '10' minute)
EMPNO ENAME      JOB        MGR HIREDATE      SAL    COMM DEPTNO
7934 MILLER x   CLERK     7782 23-JAN-82    1300             10
*/For changes, deletes and inserts compair the two result (emp and emp as of timestamp (systimestamp - interval '10' minute) ) with each other.
Regards,
Peter

Similar Messages

  • How to find last login date of a sql login?

    i want to disable the SQL Logins which are not logged in last 15 days. (I schedule a job every night to check and disable)
    For this 
    i want to find  last login date of all sql logins in an instance if the login didn't log in with in 15 days i want to disable them.
    In SYS.SYSLOGINS table we can see all the logins and 'isntname' tells us if it is SQL login or windows login. 
    but where to find the last login date of SQL log in ?
    Can any one help me?

    Hi HYDBA,
    If you use SQL Server 2005 or later, you can only get the current logon data using
    DMV likes:
    select
    max
    (login_time)as
    last_login_time, login_name
    from
    sys.dm_exec_sessions
    group
    by login_name;
    Related to your question there are two options:
    One is logon trigger,
    which is used to get current login time and login name comparing with the data from
    sys.dm_exec_sessions. If the current login time comparing with last login time is larger than 15 days, then prevent the current login.   
    Another one is to schedule a job, which is used to disable logon who’s current login time
    comparing with last login time is larger than 15 days.
    Hope it’s helpful for you.
    Regards, Amber zhang

  • How to display the out put of the sql query in a text file using forms

    I want to display the out put of the sql query in a text file using forms 6.0.Same could be done using spool command in sqlplus but i want it using forms....Fiaz

    Have a look at the text_io package:
    http://www.oracle.com/webapps/online-help/forms/10g/state?navSetId=_&navId=3&vtTopicFile=f1_help/oraini/c_text_io.html&vtTopicId=
    cheers

  • Checking correct data format using sql query

    1) I got column date of joining which accepts date in below format
    DD-MON-YYYY
    DD-MON-YY
    MON-DD-YYYY
    MON-DD-YY
    Month DD,YYYY
    Question:- how do i check whether all dates in Date of joining column are in above format or not using sql query?
    2) I got one more date column which accepts date in below format
    MMDDYYYY
    YYYYMMDD
    MM/DD/YYYY
    MM/DD/YY
    YYYY/DD/MM
    Question:- how do i check whether all dates in date column are in above format or not using sql query?
    sorry if it is a very simple question since I am new to sql and trying to learn ......Thanks for the answers from the group............

    In short, NO, it's not possible.  If you store dates correctly in the database as DATE datatype then you don't have this problem.  If you store them as VARCHAR2 you have a problem.
    So, you get a date of 20092012
    Is that 20th September 2012?  or is it 20th December 2009?
    What about...
    11-Jan-12
    Is that 11th January 2012 or 12th January 2011?
    Dates should never be stored on the database as strings.  That is why Oracle gives you a DATE datatype so you can store them properly.
    Also, when dates are passed from an application to the database, the application should be passing them as DATE datatype, and the application interface should be designed to accept dates from the user in a format specific to their country/locality and it would then know what that format is and automatically convert it to a DATE datatype before it gets anywhere near the database or any SQL.

  • How to delete last user session from backend SQL query?

    Sometimes user session gets closed between some work by any reason.
    When next time that user logs to P6, he gets some error or particular functionaly dosen't work for that user or system hangs.
    In that case if i decided to clear last session history of that user from database, how to write SQL query?
    I don't want to delete all user sessions from table USESSION and USESSAUD, i simply want to delete last user session of particular user (E.g XYZ).

    I am quoting this from MOS Doc Id "Why would multiple session records be present in the User Sessions screen in P6 Web, and why might some of them have different IP addresses? (Doc ID 1600172.1)"
    Multiple sessions show up for users since different sections of P6 Web have their own sessions associated with them. If a user is authorized to use multiple areas of the software they will have multiple sessions each time they log in. Additionally, if users are closing their browsers before logging out of P6 Web Access you might see some past sessions still appearing in the list. These will eventually be cleared out by background jobs, however you can also reset the sessions in the software by clicking the "Reset User" link (Administer > User Sessions > Manage User Sessions), or by choosing the "Reset All Users" link (Administer > User Sessions > Manage User Sessions) to do this for all past sessions.
    Multiple IP addresses for sessions can happen when a user logs in from different machines. For example, a person may login at their desk, but then go to a colleagues workstation to discuss a project, and log in from there. Doing so will leave them with multiple IP addresses in the session records.
    Hope this helps
    Regards,
    Sachin Gupta

  • How to convert milliseconds to date format in sql query

    Hi All,
    The following code is in java.     
    String yourmilliseconds = "1316673707162";**
    Date resultdate = new Date(Long.parseLong(yourmilliseconds));
    could you plese tell me how to convert milliseconds into date format in query and comparing with another date like(sysdate-3)

    Hello,
    http://stackoverflow.com/questions/3820179/convert-epoch-to-date-in-sqlplus-oracle
    Regards

  • Data Template using sql query

    Hi All,
    I'm trying generate xml data using data template approach. For this do i need to use XSQL to generate xml data?
    Can some one please tell me what is this XSQL and how it works?
    Thanks in advance,

    Hi Srini,
    Thank you very much for the link, its elucidates the xml data generation process using data template.
    One more question: is this method called (uses) XSQL anywhere??
    Thanks,

  • How  to count a number in number using sql query

    Hi Guys,
    I want to count a number in number.please answer this query.
    eg> i have a phone No : 9988585633
    Now i want to count a number of this phone no:
    if i will give no: 9 then it will return 2
    if i will give no: 8 ,tnen it will return 3.
    regards,
    Dhanush

    Something like this:
    $[CHE_TEST@asterix1_impl] var phoneno char(10);
    $[CHE_TEST@asterix1_impl] exec :phoneno := '9988585633';
    PL/SQL procedure successfully completed.
    $[CHE_TEST@asterix1_impl] ed
    Wrote file c:\temp\afiedt.sql
      1  with data as (
      2    select substr(:phoneno, level, 1) no
      3    from dual connect by level <= length(:phoneno)
      4  )
      5  select count(*), no
      6  from data
      7* group by no
    $[CHE_TEST@asterix1_impl] r
      1  with data as (
      2    select substr(:phoneno, level, 1) no
      3    from dual connect by level <= length(:phoneno)
      4  )
      5  select count(*), no
      6  from data
      7* group by no
      COUNT(*)|N
    ----------|-
             2|3
             1|6
             3|8
             2|5
             2|9cheers

  • Does anyone know how to display (in LabVIEW) the memory use during execution of an image and data acquisition VI to predict when it is time to cease the acquisition to prevent the program crashing?

    Does anyone know how to display (in LabVIEW) the memory use during execution of an image and data acquisition VI to predict when it is time to cease the acquisition to prevent the program crashing?
    I am acquiring images and data to a buffer on the edge of the while loop, and am finding that the crashing of the program is unpredictable, but almost always due to a memory saturation when the buffers gets too big.
    I have attached the VI.
    Thanks for the help
    Attachments:
    new_control_and_acquisition_program.vi ‏946 KB

    Take a look at this document that discusses how to monitor IMAQ memory usage:
    http://digital.ni.com/public.nsf/websearch/8C6E405861C60DE786256DB400755957
    Hope this helps -
    Julie

  • Does anyone know how to display (in LabVIEW) the memory use during execution of an image and data acquisitio​n VI to predict when it is time to cease the acquisitio​n to prevent the program crashing?

    Does anyone know how to display (in LabVIEW) the memory use during execution of an image and data acquisition VI to predict when it is time to cease the acquisition to prevent the program crashing?
    I am acquiring images and data to a buffer on the edge of the while loop, and am finding that the crashing of the program is unpredictable, but almost always due to a memory saturation when the buffers gets too big.
    I have attached the VI.
    Thanks for the help
    Attachments:
    new_control_and_acquisition_program.vi ‏946 KB

    got these vi's off ni site a while ago - see if they help
    Attachments:
    Memory_Monitor.zip ‏132 KB

  • How to display planned movement date and actual movement date together?

    Hi, Professionals,
    My purpose is to list delayed outbound deliveries.
    Anyone could tell me how to display planned movement date and actual movement date?
    Appreciate your help.

    Thanks Shiva.
    I tried another way to do it. It works only for a short period of time.
    By using VL06O, I list all outbound deliveries by limiting both planned goods movement dates and actual goods movements dates to the same week I would like to inspect. Say both from 7th/11 to 14th/11.
    then I list outbound delivery list with planned goods movement date to 7th/11 but left out actual goods movements dates this time.
    In excel, I compare those two lists and filter out those unique ones because those unique documents means delayed deliveries which cannot delivery according to planned date.
    However, the "delayed" list generated by this method has some noises. Not all of documents are really delayed although most of them do.
    I'm also looking for a way to list sales documents number of these delayed delivery documents so i can retrieve order details from it such as order value.
    Help still needed.

  • How to get last Build date of a dll in the real time target

    Info On My Project    
       I am working on LabWindows CVI 12.0 for development . This project is a real time application for hardware, which is having Phar Lap ETS as RTOS...  
    I am facing some problems while checking Build date of my Application file( .dll)
    I have tried to use GetFileDate API. But it is not supporting for realtime Target..
    So i have tried __DATE__ macro.. That also having some problems..
    How to get last Build date of a dll from the real time target  ??
    Please Help to solve this....
    Thanks
    Vaishakh A  K

    Please reply if any one have suggestion...

  • How to display the current date in the prompt value.

    Hi,
    How to display the current date in the prompt value. When the user runs the query he want the current date to be displayed in the prompt value and he should also be able to change the date if required ...... I am using web Intellegency BO XI3.0.
    Thanks,
    Shakthi.

    Please refer the below link.
    Prompt  with  default  date   (  currentdate-1  and current date-8)
    http://www.dagira.com/2008/07/15/how-can-i-make-today-my-default-prompt-value/
    http://www.dagira.com/2008/07/21/using-a-magic-date-value-in-prompts/
    Regards,
    Bilahari

  • Hi there i have issue in mavericks i thing so because now in 80% the battery shows it has 3 hours and 5 minutes left only using safari and mail....

    hi there i have issue in mavericks i thing so because now in 80% the battery shows it has 3 hours and 5 minutes left only using safari and mail....is there any fix or update.....help appreciated....

    Is the MacBook/Air still covered under any AppleCare plan?
    If you are in the US or Canada, the Apple Store with Genius
    bar can have a look at it, and diagnose it for free; you'd have
    to set an appointment at a store nearest you, for them do do it.
    Not sure how old the unit is or how it was used, charged, or re-
    charged; but those are the kinds of little things that may affect
    battery life or subtract possible useable Cycles off its life.
    Some users of MB/Air models (and MB/Pro, etc) had noticed
    a loss of battery capacity after an upgrade to Mavericks. So
    that may be some kind of revision to how the battery is seen
    by the newer OS X. No idea if Mavericks uses more power.
    To see an expert or specialist about this issue, for advice, &
    or test/diagnose may be an idea. Could be it needs a new
    battery. How does the rest of the battery/power specs look?
    Perhaps the MacBook just wants to get out on the town...

  • How to display the header data on different position in alv report

    hi all,
    how to display the header data on different position in alv report.
    for example ,
    customer                                                   name
      xxxx                                                         xxxx
                     vendor        name     street 
                      xxxx         xxxx      xxxxx
    pls   help me .

    hi
    as per my understanding you need to trnasfer header internal table data  to pdf..
    please check the following links for internal table to pdf..
    Convertion of Internal table data to PDF
    This link is related to ur issue
    Re: how to insert the calling of the FM: OTF to PDF
    Thanks

Maybe you are looking for