How to find out the rows inserted between a time period.
Hi,
Please help me to solve this.
Table - emp.
Colmns - empno(Primary Key),ename, mgr
How to find out the rows inserted between a time period.
For eg:- Between 02-Oct-2006 1 PM and 03-Oct-2006 2 PM.
regards,
Mathew.
Hi,
Maybe work:
For each row, ORA_ROWSCN returns the conservative upper bound system change number (SCN) of the most recent change to the row. This pseudocolumn is useful for determining approximately when a row was last updated. It is not absolutely precise, because Oracle tracks SCNs by transaction committed for the block in which the row resides
e.g.:
SGMS@ORACLE10> create table test(cod number);
Table created.
SGMS@ORACLE10> insert into test values (1);
1 row created.
SGMS@ORACLE10> insert into test values (2);
1 row created.
SGMS@ORACLE10> commit;
Commit complete.
SGMS@ORACLE10> insert into test values (3);
1 row created.
SGMS@ORACLE10> commit;
Commit complete.
SGMS@ORACLE10> select SCN_TO_TIMESTAMP(ora_rowscn),ora_rowscn,cod from test;
SCN_TO_TIMESTAMP(ORA_ROWSCN) ORA_ROWSCN COD
06/11/06 08:56:56,000000000 727707205 1
06/11/06 08:56:56,000000000 727707205 2
06/11/06 08:57:05,000000000 727707210 3Cheers
Similar Messages
-
How to find out the rows inserted in the last n minutes ?
Hi all,
I have a log table where, every time a warning is issued, a new row is added. The table has a field with the sysdate when the warning was issued.
I'd need to collect all warnings in the last (supposing) 30 minutes and send a mail to the administrator. Looking at some faqs I have elaborated this:
select * from PROCEDURE_LOGS p where ((p.DATE_LOG - sysdate)*-1440) < 30
However this does not produce anything.
Can anybody help me to correct this statement ?
Thanks a lot
FrankHi, Frank,
That looks okay to me. Are you sure you have rows in the table with a date_log in the last 30 minutes? Post some sample data (CREATE TABLE and INSERT statements), and the results you expect from that data for a given value of SYSDATE.
By the way, you can make the WHERE clause clearer like this:
select *
from PROCEDURE_LOGS p
where ( (sysdate - p.DATE_LOG)
* 1440 -- = 24 * 60
) < 30but this won't change the results.
Edited by: Frank Kulash on Dec 1, 2010 9:51 AM
I just saw Toon's reply:
where p.DATE_LOG > sysdate - (30 / 1440)as Toon suggested, is clearer still, and potentially more efficient if ther's an index on date_log. -
How to find out the common things between two rpds?
How to find out the common things between two rpds? And place the common things in a common RPD.
I thought of one solution.
Original RPD = A
Modified RPD = B
XML Patch created for A-B = X
Now open the XML Patch in IE or Mozilla and delete the columns/tables/variable/etc,. from the Original RPD A.
But its a cumbersome process, if the XML file is of very less size its Ok. If its 10-20 MB then going line by line and deleting the change is not the process to be followed.
I have to check whether its just the delete or modify or drop.
Let me know your thoughts. -
How to find out the names which have overlapping times
Hello:
I've a table which contains some names and their calling time period. I need to find out which of those names have overlapping time period.
Name|StartTime|EndTime
A|26/3/2011 12:33:16 PM|26/3/2011 12:40:10 PM
A|26/3/2011 12:41:28 PM|26/3/2011 12:43:19 PM
A|26/3/2011 12:42:28 PM|26/3/2011 12:47:50 PM
B|26/3/2011 10:22:28 PM|26/3/2011 10:50:10 PM
B|26/3/2011 10:49:28 PM|26/3/2011 10:53:50 PM
B|26/3/2011 10:50:28 PM|26/3/2011 10:59:50 PM
B|26/3/2011 10:59:58 PM|26/3/2011 11:10:50 PM
C|26/3/2011 11:05:58 PM|26/3/2011 11:10:50 PM
C|26/3/2011 11:40:58 PM|26/3/2011 11:50:50 PM
I need those names which have multiple calls and one call starts before the end of another call. If anyone have four calls and two of those overlapped (A has two overlapping and B has three overlapping), that name should also come into my list like below:
Name|Overlapping_Count
A|1
B|2
Can anyone help me please?
Thanks/RazinThans for pointing out the error in my post. It seems, being rather busy in this period, I'm starting to wear out as I missed the fact the overlaps would be returned twice. :(
I had in mind a more general case where as single row overlaps with more than one other row.
The OP's data contained one to one overlaps only and it seems no generalized approach was needed.
with
the_data as
(select 'A' name,to_date('26/03/2011 12:33:16','dd/mm/yyyy hh24:mi:ss') start_time,to_date('26/03/2011 12:40:10','dd/mm/yyyy hh24:mi:ss') end_time from dual union all
select 'A' name,to_date('26/03/2011 12:41:28','dd/mm/yyyy hh24:mi:ss') start_time,to_date('26/03/2011 12:43:19','dd/mm/yyyy hh24:mi:ss') end_time from dual union all
select 'A' name,to_date('26/03/2011 12:42:20','dd/mm/yyyy hh24:mi:ss') start_time,to_date('26/03/2011 12:42:50','dd/mm/yyyy hh24:mi:ss') end_time from dual union all
select 'A' name,to_date('26/03/2011 12:42:28','dd/mm/yyyy hh24:mi:ss') start_time,to_date('26/03/2011 12:47:50','dd/mm/yyyy hh24:mi:ss') end_time from dual union all
select 'B' name,to_date('26/03/2011 10:22:28','dd/mm/yyyy hh24:mi:ss') start_time,to_date('26/03/2011 10:50:10','dd/mm/yyyy hh24:mi:ss') end_time from dual union all
select 'B' name,to_date('26/03/2011 10:49:28','dd/mm/yyyy hh24:mi:ss') start_time,to_date('26/03/2011 10:53:50','dd/mm/yyyy hh24:mi:ss') end_time from dual union all
select 'B' name,to_date('26/03/2011 10:50:28','dd/mm/yyyy hh24:mi:ss') start_time,to_date('26/03/2011 10:59:50','dd/mm/yyyy hh24:mi:ss') end_time from dual union all
select 'B' name,to_date('26/03/2011 10:59:58','dd/mm/yyyy hh24:mi:ss') start_time,to_date('26/03/2011 11:10:50','dd/mm/yyyy hh24:mi:ss') end_time from dual union all
select 'C' name,to_date('26/03/2011 11:05:58','dd/mm/yyyy hh24:mi:ss') start_time,to_date('26/03/2011 11:10:50','dd/mm/yyyy hh24:mi:ss') end_time from dual union all
select 'C' name,to_date('26/03/2011 11:40:58','dd/mm/yyyy hh24:mi:ss') start_time,to_date('26/03/2011 11:50:50','dd/mm/yyyy hh24:mi:ss') end_time from dual
select name,count(distinct overlap) overlapping_count
from (select x.name,to_char(greatest(x.start_time,y.start_time),'yyyymmddhh24miss')||'|'||to_char(least(x.end_time,y.end_time),'yyyymmddhh24miss') overlap
from the_data x,the_data y
where x.name = y.name
and greatest(x.start_time,y.start_time) < least(x.end_time,y.end_time)
and x.start_time != y.start_time
and x.end_time != y.end_time
group by name
order by name
with
the_data as
(select 'A' name,to_date('26/03/2011 12:33:16','dd/mm/yyyy hh24:mi:ss') start_time,to_date('26/03/2011 12:40:10','dd/mm/yyyy hh24:mi:ss') end_time from dual union all
select 'A' name,to_date('26/03/2011 12:41:28','dd/mm/yyyy hh24:mi:ss') start_time,to_date('26/03/2011 12:43:19','dd/mm/yyyy hh24:mi:ss') end_time from dual union all
select 'A' name,to_date('26/03/2011 12:42:20','dd/mm/yyyy hh24:mi:ss') start_time,to_date('26/03/2011 12:42:50','dd/mm/yyyy hh24:mi:ss') end_time from dual union all
select 'A' name,to_date('26/03/2011 12:42:28','dd/mm/yyyy hh24:mi:ss') start_time,to_date('26/03/2011 12:47:50','dd/mm/yyyy hh24:mi:ss') end_time from dual union all
select 'B' name,to_date('26/03/2011 10:22:28','dd/mm/yyyy hh24:mi:ss') start_time,to_date('26/03/2011 10:50:10','dd/mm/yyyy hh24:mi:ss') end_time from dual union all
select 'B' name,to_date('26/03/2011 10:49:28','dd/mm/yyyy hh24:mi:ss') start_time,to_date('26/03/2011 10:53:50','dd/mm/yyyy hh24:mi:ss') end_time from dual union all
select 'B' name,to_date('26/03/2011 10:50:28','dd/mm/yyyy hh24:mi:ss') start_time,to_date('26/03/2011 10:59:50','dd/mm/yyyy hh24:mi:ss') end_time from dual union all
select 'B' name,to_date('26/03/2011 10:59:58','dd/mm/yyyy hh24:mi:ss') start_time,to_date('26/03/2011 11:10:50','dd/mm/yyyy hh24:mi:ss') end_time from dual union all
select 'C' name,to_date('26/03/2011 11:05:58','dd/mm/yyyy hh24:mi:ss') start_time,to_date('26/03/2011 11:10:50','dd/mm/yyyy hh24:mi:ss') end_time from dual union all
select 'C' name,to_date('26/03/2011 11:40:58','dd/mm/yyyy hh24:mi:ss') start_time,to_date('26/03/2011 11:50:50','dd/mm/yyyy hh24:mi:ss') end_time from dual
t as
(select name,
case when max(end_time) over(partition by name order by start_time,end_time rows between unbounded preceding and 1 preceding) > start_time
then 0
else 1
end start_of_group
from the_data
select name,
count(*) overlapping_count
from t
where start_of_group = 0
group by name
order by nameRegards
Etbin -
How to find out the n number of records inserted??
In File to JDBC Scenarios, i am inserting n records in Oracle.
How to find out the n number of records inserted??Hi,
If you are using the statement "UPDATE_INSERT", get the response on element <insert_count>count</insert_count>. It will give you the inserted rows.
This link can be very helpfull.
[http://help.sap.com/saphelp_nw2004s/helpdata/en/2e/96fd3f2d14e869e10000000a155106/frameset.htm]
regards.
roberti -
How do find out the number of rows
how to find out the number of rows of as all tables in a schema with one sql statement
Hi,
What u can try doing is...
declare
numrows number;
begin
for i in (select tname from tab)
loop
execute immideate 'select count(1) into numrows from ' | | i.tname ;
dbms_output.put_line(numrows);
end loop;
end;
Hope this helps. This works only in 8i. So if u need to do the same in 8.0 u have to use dbms_sql pkg.
The logic is same but the way u open ands execute the code is a bit diff.
Best Of Luck.
Regards,
Ganesh R -
How to find out the exact culpirit session
How to find out the exact culpirit client machine process to kill the session and release.
Thanks,We can not directly solve this mystery, only you can do so.
V$SESSION contains data for all connected sessions.
If no unique combination of fields exists that allows you to identify the culprit client session, then you are out of luck.
See you started this thread with the premise that 1 session connected to the DB is a problem.
OK, we will accept this as being true.
Now via SQL how/what can you SELECT so that only 1 row is returned & that row corresponds to "problem client" session?
Since this is YOUR system & not ours, only you can solve this mystery. -
How to make use of SE37- Function Module & how to find out the table?
Hi ,
1.Could anyone help me what's this SE37-Function module is all about,How to make use of this?
For Eg,If i want to delete a BOM permanently from the system then I have to use the Function module CM_DB_DEL_FROM_ROOT_BOM.
But after giving the particular name what should i do?
Please help me.
2.How to find out the respective table for a particular field sya for T code-COGI, T code MFBF,where its values are getting populated.,Please help in this issue.
Thanks in adavnce for spending some time
Raj.SHi Raj
Function Modules
Function modules are procedures that are defined in special ABAP programs only, so-called function groups, but can be called from all ABAP programs. Function groups act as containers for function modules that logically belong together. You create function groups and function modules in the ABAP Workbench using the Function Builder.
Function modules allow you to encapsulate and reuse global functions in the SAP System. They are managed in a central function library. The SAP System contains several predefined functions modules that can be called from any ABAP program. Function modules also play an important role during updating and in interaction between different SAP systems, or between SAP systems and remote systems through remote communications.
Unlike subroutines, you do not define function modules in the source code of your program. Instead, you use the Function Builder. The actual ABAP interface definition remains hidden from the programmer. You can define the input parameters of a function module as optional. You can also assign default values to them. Function modules also support exception handling. This allows you to catch certain errors while the function module is running. You can test function modules without having to include them in a program using the Function Builder.
The Function Builder also has a release process for function modules. This ensures that incompatible changes cannot be made to any function modules that have already been released. This applies particularly to the interface. Programs that use a released function module will not cease to work if the function module is changed.
Check this link
http://help.sap.com/saphelp_nw2004s/helpdata/en/9f/db988735c111d1829f0000e829fbfe/content.htm
You can execute function module in SE37ie you can perform the activiites defined in the function module by executing it.
By deleting BOM you mention the FM name in se37 and execute. In some function module it will ask input parameters as developed in the program , you have to give the input parameters and execute. -
How to find out the source of an event fired by button in a table in WD?
Hi experts,
I'm new to Web Dynpro and I need to know how to find out the source of an event (IWDCustomEvent) fired by a button in a table? I need to know which one is the clicked button (on which row)?
Help will be appreciated
RegardsHi GLM,
thanks for your reply. Yes I know about that but when a round trip to the server is made the lead selection is at the first row of the table and when i click the button on, for example, the 3rd row the getLeadSelection method returns 1 and the color marker for the current row stays on the first row. So I need to click first somewhere else on the 3rd row and then on the button in order to update the value of lead selection and it's not very nice. So if you have some other idea it would be very helpful. Or perhaps some workaround.
Regards -
How to find out the Hire date of an employee?
Hi All
What is effective date, Latest start date and other date fields which are are used when we create a new employee?
What is the difference between hire date and joining date?
How to find out the Hire date and joining date of an employee?
Regards
RahmanThe effective dates are related to date tracking. The effective start date shows when this version of the record became effective.
The Hire Date, or Latest Satrt Date shows the date on which the employee was last hired. If he was hired before from 01/01/01 to 31/12/01, then left but was hired again from 01/01/07, the Latest Hired Date would be 01/01/07 and the First Hired Date would be 01/01/01.
When using Oracle HR, datetracking allows you to either correct data (because it was wrong or incomplete), or update it (because a time effective change took place e.g. got married).
The[b] effective dates show when a record was updated. So, if an update was made on 07/02/07, and the update datetrack option was used, the current record would have its effective end date set to 06/02/07 (the day before the update) and a new version would be created with the updates and an effective start date of 07/02/07.
Hope this helps. -
How to find out the total, subtotal in alv report
hi dears,
how to find out the total, subtotal in alv report?
pls tell me logic ,
i will be waiting for eply
regards
eswarHi,
<b>ALV Grid List with sub-totals</b>
REPORT z_demo_alv_sort.
* This program lists orders (VBAK) with sort and sub-total for *
* 'sold-to-party' (KUNNR) and 'Sales organization' (VKORG) *
TABLES : vbak.
TYPE-POOLS: slis. " ALV Global types
SELECT-OPTIONS :
s_vkorg FOR vbak-vkorg, " Sales organization
s_kunnr FOR vbak-kunnr, " Sold-to party
s_vbeln FOR vbak-vbeln. " Sales document
SELECTION-SCREEN :
SKIP, BEGIN OF LINE,COMMENT 5(27) v_1 FOR FIELD p_max.
PARAMETERS p_max(2) TYPE n DEFAULT '20' OBLIGATORY.
SELECTION-SCREEN END OF LINE.
DATA:
BEGIN OF gt_vbak OCCURS 0,
vkorg LIKE vbak-vkorg, " Sales organization
kunnr LIKE vbak-kunnr, " Sold-to party
vbeln LIKE vbak-vbeln, " Sales document
netwr LIKE vbak-netwr, " Net Value of the Sales Order
waerk LIKE vbak-waerk, " Document currency
END OF gt_vbak.
INITIALIZATION.
v_1 = 'Maximum of records to read'.
START-OF-SELECTION.
PERFORM f_read_data.
PERFORM f_display_data.
* Form f_read_data
FORM f_read_data.
SELECT * INTO CORRESPONDING FIELDS OF TABLE gt_vbak
FROM vbak
UP TO p_max ROWS
WHERE kunnr IN s_kunnr
AND vbeln IN s_vbeln
AND vkorg IN s_vkorg.
ENDFORM. " F_READ_DATA
* Form f_display_data
FORM f_display_data.
DEFINE m_fieldcat.
add 1 to ls_fieldcat-col_pos.
ls_fieldcat-fieldname = &1.
ls_fieldcat-ref_tabname = 'VBAK'.
ls_fieldcat-do_sum = &2.
ls_fieldcat-cfieldname = &3.
append ls_fieldcat to lt_fieldcat.
END-OF-DEFINITION.
DEFINE m_sort.
add 1 to ls_sort-spos.
ls_sort-fieldname = &1.
ls_sort-up = 'X'.
ls_sort-subtot = &2.
append ls_sort to lt_sort.
END-OF-DEFINITION.
DATA:
ls_fieldcat TYPE slis_fieldcat_alv,
lt_fieldcat TYPE slis_t_fieldcat_alv,
lt_sort TYPE slis_t_sortinfo_alv,
ls_sort TYPE slis_sortinfo_alv,
ls_layout TYPE slis_layout_alv.
m_fieldcat 'VKORG' '' ''.
m_fieldcat 'KUNNR' '' ''.
m_fieldcat 'VBELN' '' ''.
m_fieldcat 'NETWR' 'X' 'WAERK'.
m_fieldcat 'WAERK' '' ''.
m_sort 'VKORG' 'X'. " Sort by vkorg and subtotal
m_sort 'KUNNR' 'X'. " Sort by kunnr and subtotal
m_sort 'VBELN' ''. " Sort by vbeln
ls_layout-cell_merge = 'X'.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
is_layout = ls_layout
it_fieldcat = lt_fieldcat
it_sort = lt_sort
TABLES
t_outtab = gt_vbak.
ENDFORM. " F_DISPLAY_DATA
***************** END OF PROGRAM Z_DEMO_ALV_SORT **********************
Regards
Sudheer -
How to find out the Dependencies in Jobs
Hi,
Could you please help out,in case of sap jobs ,how to find out the dependencies between jobs.
Thanks,
MadhuHi Madhu,
Please check this FM.
<b>BP_JOB_PARENT_CHILD_INFO
BP_JOB_GET_PREDECESSORS
BP_JOB_GET_SUCCESSORS</b>
Hope this will help.
Regards,
Ferry Lianto
Please reward points if helpful. -
How to find out the best settings for BDT
Hi there.
I am trying to predict a movie rating. I downloaded datasets from IMDb, prepared them. A tried all of the regression algorithms, but the best result is giving Boosted Decision Tree. Now I am dealing with the best settings in this algorithm.
With default, running time was 69 seconds and the mean absolute error was 0.4844, which is quite much I think. So I tried to improve it by changing parameters of the BDT module. I tried to set Leaves per tree to 150 and than experimentaly find
remaining parameters. I've come to Samples per leaf=12, Learning rate=0.04 and
Number of trees=700. Running time was 78 seconds and mean absolute error was 0.4596.
Input of the algorithm is joined matrix with 14 columns (11 features) and 67672 rows splitted into 70:30 (training:testing).
Is there any way how to find out the best setting of Boosted Decision Tree?Yordan's suggestion is correct, though the documentation is a bit outdated.
You can use the single parameter + sweeper mode or define your own custom ranges in the BDT module with the Parameter Range setting
Regards,
aK -
How to find out the selected item in the lsit
Hi all,
How to find out the selected item in the list,can any please post some examples which easy to understand,because iam not a good programmerThis sample program uses a checkbox as selection, you could also use a HOTSPOT.
report zrich_0002 no standard page heading.
data: imara type table of mara with header line.
data: check_box(1) type c,
report_lines type i.
start-of-selection.
* Create the gui status with BACK button in standard place
* and a READ button in the application toolbar
set pf-status 'CHECK'.
select * into corresponding fields of table imara from mara up to 100 rows.
loop at imara.
write:/ check_box as checkbox, imara-matnr, imara-matkl.
hide imara-matnr.
endloop.
report_lines = sy-linno - 1.
top-of-page.
write: 'List of materials'. uline.
top-of-page during line-selection. write: 'Material.....'. uline.
at user-command.
case sy-ucomm.
when 'READ'.
check_box = space.
set pf-status 'CHECK' excluding 'READ'.
do report_lines times.
read line sy-index field value check_box.
if check_box = 'X'.
write:/ 'You have selected material',
imara-matnr.
endif.
enddo.
endcase.
Regards,
Rich Heilman -
How to find out the time when the ASE started?
Normally, ASE not reboot for production. Only for maintenance or performance tuning, maybe need to reboot ASE.
Question is how to find out the time when ASE was started?
one way maybe is check errorlog. Any more simple way no need to login to server OS?Hi Kent,
In ASE 12.5 and up, you can do 'select @@boottime' For older releases, a general method is 'select crdate from sysdatabases where dbid=2'
1> select @@boottime, crdate from sysdatabases where dbid=2
2> go
crdate
Jul 15 2014 9:19AM Jul 15 2014 9:19AM
(1 row affected)
Cheers
Dan
Maybe you are looking for
-
Excise Tab is not appear in the MIGO display --- Import Process
Hi Experts , Excise tab is not appear in the display of the material document in Import process. Process flow. 1. Import Po. 2. Customs clearing (MIRO) 3. Capture excise invoice against the Import Po.(Reference to MIRO document ) 4.MIGO with movement
-
CC & PS WON'T LAUNCH / BRIDGE WON'T LET ME EDIT IN CAMERA RAW
I'm on Mac OS X. First problem I encountered today was that Bridge would not let me edit in Camera Raw. It gave me this warning: Camera Raw editing is not enabled. Camera Raw editing requires that a qualifying product has been launched at least once
-
"Can't use this version of iChat...
...with this version of OS X" is the message I get when trying to launch iChat from my MacBook. Works fine on my iMac. Recently downloaded Leopard to both computers. Any suggestions?
-
SQL*LOADER and date formatted data
Hi there, I don't want to load complex things in my table - just a simple date.... The control file is: load data infile 'c:\data\mydata.csv' into table test_table fields terminated by "," optionally enclosed by '"' ( sampledate, name ) The mydata.cs
-
i have noticed that recently my computer seems to be going to sleep all by itself (even though it is set to NEVER put the hard drive or monitor to sleep). It seems it always does this in the middle of me trying to burn a DVD, sometimes dozens of time