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
Frank
Hi, 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.
Similar Messages
-
How to find out the last date & time on which a program has been run
Hi Experts,
Can anybody tell how to find out the last date on which a purticular program has been run.
Valuable answers will be rewarded.
Thanks & Regards,
Satish.Hi!
Try STAD transaction. Unfortunately it contains a huge amount of data, so it is available only for a few days backwards... Maybe some weeks, but you can't make yearly reports from its data... So it's not useful to see, which program is in use or not...
I planned once to download it weekly, but it was not so important...
Regards
Tamá -
How to find out the last time login for a locked login account?
In ASE 15.4,there are many login account show as locked and unlocked. How to find out the last login time for those locked login account?
Thank you. The version of my ASE is 12.5.4.
This is what I got from select * from syslogins:
suid status accdate totcpu totio spacelimit timelimit resultlimit dbname name password language pwdate audflags fullname srvname logincount procid
1
30 2 10/25/2012 11:41:10.430 AM 0 0 0 0 0 . . ... us_english 02/24/2.0.08 12:55:38.640 PM 0 [NULL] [NULL] [NULL] [NULL]
this is what I got from exec sp_displaylogin 'mylogin':
1 Suid: 46
2 Loginame: mylogin
3 Fullname: FN LN
4 Default Database: mydb
5 Default Language: us_english
6 Auto Login Script:
7 Configured Authorization:
8 Locked: YES
9 Date of Last Password Change: Apr 17 2010 2:36PM
10 Password expiration interval: 0
11 Password expired: NO
12 Minimum password length: 6
13 Maximum failed logins: 0
14 Current failed login attempts:
15 Authenticate with: AUTH_DEFAULT
which one is for last login time? -
How to find out the Last line of a page in Smart forms
Hi Experts,
I need to find out the <b>last line of a page in smartforms</b>.
I have <b>Heading in a text element</b> and its <b>text in another text element</b>.
If the heading falls in the last line, its contents will be displayed in the next page. I want to print the heading in the next page.
Please advise on this issue.
Thanks in advance,
VivenYou can put both the heading and contents in a Folder node and check the page protection checkbox of the Folder node. This way both will be displayed on the same page always.
-
From my own session how to find out the last SQL that I issued ?
Why does the query bellow that would return the last sql issued only work on 10g version ?
Notice the output:
SQL> select * from v$version;
BANNER
Oracle9i Enterprise Edition Release 9.2.0.5.0 - 64bit Production
PL/SQL Release 9.2.0.5.0 - Production
CORE 9.2.0.6.0 Production
TNS for IBM/AIX RISC System/6000: Version 9.2.0.5.0 - Production
NLSRTL Version 9.2.0.5.0 - Production
SQL> select sql_text from v$sql where hash_value = ( select prev_hash_value from v$session where
sid = (select sid from v$mystat where rownum = 1));
SQL_TEXT
select sql_text from v$sql where hash_value = ( select prev_hash_value from
v$session where sid = (select sid from v$mystat where rownum = 1))
SQL> conn system@prod
Informe a senha: *******
Conectado.
SQL> select * from v$version;
BANNER
Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - 64bi
PL/SQL Release 10.2.0.2.0 - Production
CORE 10.2.0.2.0 Production
TNS for IBM/AIX RISC System/6000: Version 10.2.0.2.0 - Productio
NLSRTL Version 10.2.0.2.0 - Production
SQL> select sql_text from v$sql where hash_value = ( select prev_hash_value from v$session where
sid = (select sid from v$mystat where rownum = 1));
SQL_TEXT
select * from v$version
SQL>Peter, what version are you using ?
Everybody, our query seems to work only on 10g version. Notice the output bellow:
SQL> select * from v$version;
BANNER
Oracle9i Enterprise Edition Release 9.2.0.5.0 - 64bit Production
PL/SQL Release 9.2.0.5.0 - Production
CORE 9.2.0.6.0 Production
TNS for IBM/AIX RISC System/6000: Version 9.2.0.5.0 - Production
NLSRTL Version 9.2.0.5.0 - Production
SQL> select sql_text from v$sql where hash_value = ( select prev_hash_value from v$session where
sid = (select sid from v$mystat where rownum = 1));
SQL_TEXT
select sql_text from v$sql where hash_value = ( select prev_hash_value from
v$session where sid = (select sid from v$mystat where rownum = 1))
SQL> conn system@prod
Informe a senha: *******
Conectado.
SQL> select * from v$version;
BANNER
Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - 64bi
PL/SQL Release 10.2.0.2.0 - Production
CORE 10.2.0.2.0 Production
TNS for IBM/AIX RISC System/6000: Version 10.2.0.2.0 - Productio
NLSRTL Version 10.2.0.2.0 - Production
SQL> select sql_text from v$sql where hash_value = ( select prev_hash_value from v$session where
sid = (select sid from v$mystat where rownum = 1));
SQL_TEXT
select * from v$version
SQL> -
How to find out the last closed windows?
I closed several ( 5-6) firefox windows when shutting down my computeer, and after re-staring firefox chose to 'restore previous session' (set by default but failed to so automatically this time). Saddly, in my about:config there was the default of opening only 3 windows, which means that all the others windows and tabs are now gone.
My question is: can I fin out in the history, or or in the some firefox log files, the address of the pages that were open in those windows/tabs. A list of all closed tabs and the time they were closed would suffice. The 'recentely closed tabs' options does not appear to contain that information, only the tabs that were closed in the current window.
Details:
OS: Linux Ubuntu 14.04
Firefox 35.0.1
Cheers.Hi!
Try STAD transaction. Unfortunately it contains a huge amount of data, so it is available only for a few days backwards... Maybe some weeks, but you can't make yearly reports from its data... So it's not useful to see, which program is in use or not...
I planned once to download it weekly, but it was not so important...
Regards
Tamá -
To find out the last row that is updated in a View Object
Hi OAF Gurus,
I have requirement like,
I have to find out the last row that is updated on a particular View Object and I have send a mail to the users about the change.
JegSAMassMobVOImpl vo = getJegSAMassMobVO1();
JegSAMassMobVO is the View Object Name and it displays certain rows that has already been added to the VO in the Page.
Now the issue is when a user updates a particular row,I have to find which row gets updated and have to send a email to that particular employee about the change.
Just want to know,how to find out the last updated row in a particular VO.
Any Help would be appreciated as this a immediate requirement.
Regards,
Magesh.M.K.
Edited by: user1393742 on May 4, 2011 1:06 AMHi Magesh
It shoud be a Advanced table ,so when user will update the row ,the specific row will fire the PPR and on that event u can capture the row using row reference ,this is the sample code below
public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
super.processFormRequest(pageContext, webBean); OAApplicationModule am =
(OAApplicationModule)pageContext.getApplicationModule(webBean);
String event = pageContext.getParameter("event");
if ("<ItemPPREventName>").equals(event))
// Get the identifier of the PPR event source row
String rowReference =
pageContext.getParameter(OAWebBeanConstants.EVENT_SOURCE_ROW_REFERENCE);
Serializable[] parameters = { rowReference };
// Pass the rowReference to a "handler" method in the application module.
262
am.invokeMethod("<handleSomeEvent>", parameters);
In your application module's "handler" method, add the following code to access the source row:
OARow row = (OARow)findRowByRef(rowReference);
if (row != null)
Thanks
Pratap -
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 -
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 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 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 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
-
How to create conditions in BEx
Hi, Please tell me if my query condition on a KF looks like this how can i achieve this? Key Figure: 1.Forcast Accuracy 2.Actual 3.abserr Formula for Forecast Accuracy: If Actual>0,then do 1-abserr/actual, else 0
-
Can't upgrade to 1.2.3
I'm trying to update my 5G iPod to firmware version 1.2.3, but no dice. iTunes downloads the update, then tries to perform the update, but quits (crashes) mid-stream. My iPod isn't affected and still has version 1.2.1. Console reports that there was
-
Want information about oracle adf bc
Hello, i am working this technology from last 1 year .but we used EJB 3.0 as business component .but now i am to learn Oracle ADF BC . please give me any suggestion . Thanks Prateek
-
MBP having sleep issues: won't sleep by itself & waking up randomly
Lately my Macbook Pro's been having a few sleep issues. I set my energy saver settings so that the display should sleep after 10 minutes and the computer should sleep after 20, however what I often come back to after being away from my computer for a
-
Datastore configuration of sap bw
Hi, Please explain how to configure the datastore for importing SAP BW tables also do we need to do RFC configuration for this?