How to get the date-time value?
Hi All
I have a a field "START_TIME of type DATE". The value stored for that particular field is of the form "10/17/2006 2:23:40 PM" i.e. a date-time value.
Now when i try to get the values stored in the table in which the START_TIME field is defined i get the value in the form of "10/17/2006" .... I missed out the time information. Why is this so? How do i get the complete value as a string?
Thanks in advance. Vijay
Hi All
I have a a field "START_TIME of type DATE". The value stored for that particular
field is of the form "10/17/2006 2:23:40 PM" i.e. a date-time value.Actually it is stored as an internal date format (see my example SQL below, taking note of the dump'ed data).
Now when i try to get the values stored in the table in which the START_TIME field is defined i get the
value in the form of "10/17/2006" ....
I missed out the time information. Why is this so?
How do i get the complete value as a string?The value you see on the screen is the display format and this is determined by the client application that is displaying the date and what settings it is using. If a date column is retrieved from the database then all the data (date and time) is given back, but it's up to the application how that is displayed. e.g. you may see it differently if you view it is SQL*Plus against some other tool such as TOAD.
To change the display settings you can change your NLS_DATE_FORMAT setting or whatever setting is suitable for your client application, or you can use TO_CHAR with a format string to specify the components you want to see. The different with TO_CHAR is that you are converting it to a character string so don't attempt to do any date type comparisons on it after that conversion, e.g. don't try and compare if one date is greater than another, without converting it back to DATE datatype first.
SQL> create table t (x date);
Table created.
SQL> insert into t (x) values (sysdate);
1 row created.
SQL> select x from t;
X
02-JUN-08
SQL> select x, dump(x) from t;
X
DUMP(X)
02-JUN-08
Typ=12 Len=7: 120,108,6,2,13,32,51
SQL> alter session set nls_date_format = 'DD/MM/YYYY HH24:MI:SS';
Session altered.
SQL> select x, dump(x) from t;
X
DUMP(X)
02/06/2008 12:31:50
Typ=12 Len=7: 120,108,6,2,13,32,51
SQL>
Similar Messages
-
How to get the date time format in OCI
How to get a date time format in OCI instead of only date
You would have to use the OCIDateTime datatype for this. Refer to
OCI documentation for more details. -
How to get the date/time of flush shared_pool commands?
I think there´s some script, which in been runned with a privileged user, that is recurring flushing the shared_pool.
Is there a way to know the last date/time when an 'alter system flush shared_pool' was issued?
Or, better, how can I tell Oracle RDBMS to log these commands on alert.log?
Best regards,
Luis SantosYou can audit the alter system commands:
audit alter system;
You probably want to ensure the following two system parameters check the doc for your version:
audit_trail=db_extended
audit_sys_operations=true
They require a system bounce, but by default sys operations are not audited so you'll need the latter.
Query the dba_audit_trail. -
How can I get the Date & Time to appear on my final project in iMovie11?
I am using iMovie 11 and have imported video from a Canon Vixia-HF21 camera. The EXIF data is imported along with the video but when I produce the final product, the date and time do not appear. How can I get the Date & Time data to appear on the final product?
There is a date and time Title you can use. If I recall correctly, it displays date plus hours and minutes, but not seconds.
-
How do I to get the date/time stamp back on my texts in ioS7?
I've looked and looked to find an option and I can't seem to locate one. Does anyone know how to put the date/time stamp back...? It does appear in, but not consistently.
Swipe right to left and they will appear as you need them.
-
How to get the data from multiple nodes to one table
Hi All,
How to get the data from multiple nodes to one table.examples nodes are like A B C D E relation also maintained
Regards,
IndraHI Indra,
From Node A, get the values of the attributes as
lo_NodeA->GET_STATIC_ATTRIBUTES( IMPORTING STATIC_ATTRIBUTES = ls_attributesA ).
Similarily get all the node values from B, C, D and E.
Finally append all your ls records to the table.
Hope you are clear.
BR,
RAM. -
How to get the current month value for a customer exit variable?
How to get the current month value for a customer exit variable?
And also if we have an InfoObject with date value (including date, month, year), then how to derive the month value from this date type of Char.?
Thanks!Hi Kevin,
Check here........
Re: Customer Exist for "From Current Date To Month End"
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/25d98cf6-0d01-0010-0e9b-edcd4597335a
Cal month
Regards,
Vijay. -
How to get the date of the last transaction in a mounted standby database?
Hello,
Could you tell me how to get the date of the last transaction recorded in a MOUNTED standby database?
The following query doesn't work...because the database is not open...
select scn_to_timestamp(current_scn) from v$database;
ThanksHi,
You should be able to run the following command in mounted mode on standby database.
select current_scn from v$database;
then run the following to convert it to timestamp.
select scn_to_timestamp(99999999) from dual; *<-- Replace here the SCN value you got above. This needs to be run on the primary database due to standby database in mount mode.*
Alternatively you can also check at the alert.log file to find the last scn which has been applied.
Regards
Edited by: skvaish1 on Jan 19, 2010 11:15 AM -
How to get the date starting from 1 to the current date from the system dat
Dear all,
Please tell me how to get the date starting from 1 based on the system date
and it should come with respect of time also.
example.
suppose today is 6 Dec, 2006
so ABAP report should find the 1 dec. 2006.
Please help me as soon as possible.
Regards,concatenate sy-datum0(2) '01' sy-datum4(4) into v_firstdate.
or yo ucan use the fm:
HR_JP_MONTH_BEGIN_END_DATE
usage:
call function 'HR_JP_MONTH_BEGIN_END_DATE'
exporting
iv_date = sy-datum
importing
ev_month_begin_date = gv_begda
ev_month_end_date = gv_endda.
Regards,
Ravi
Message was edited by:
Ravi Kanth Talagana -
How to get the date in 01-jan-2008 format
hi
how to get the date in 01-jan-2008 formatCheck this example of how to get this format..
TABLES: T247.
DATA: V_DATE TYPE SYDATUM.
DATA: V_STRING(20).
V_DATE = SY-DATUM.
SELECT SINGLE * FROM T247
WHERE SPRAS = SY-LANGU
AND MNR = V_DATE+4(2).
IF SY-SUBRC = 0.
CONCATENATE V_DATE+6(2) '-' T247-KTX '-' V_DATE(4)
INTO V_STRING.
WRITE: / V_STRING.
ENDIF.
or
make use of this FM
CONVERSION_EXIT_IDATE_OUTPUT
and see its documentation.
or
/: SET DATE MASK = 'DD-MMM-YYYY'
&DATE&
check with this.
if it is not working try to give space between DD and MMM and YYYY
all of the three work...choose whichever suits u
eg2:
Use FM:CONVERSION_EXIT_IDATE_OUTPUT
Check this Program.....
DATA:DATE TYPE D VALUE '20070912'.
DATA:DATE2(12) TYPE C.
DATA:FINAL_DATE(15) TYPE C.
CALL FUNCTION 'CONVERSION_EXIT_IDATE_OUTPUT'
EXPORTING
INPUT = DATE
IMPORTING
OUTPUT = DATE2.
CONCATENATE DATE20(2) '-' DATE22(3) '-' DATE2+5(4) INTO
FINAL_DATE.
WRITE:FINAL_DATE.
Eg:3
use FM MONTH_NAMES_GET by passing month_names-spras = 'E'
it will return the Mont names in month_names-KTX ( 3 cha short name ) & month_names-LTX ( Long text ). then concatenate 'DD''-' month_names-KTX & 'YY'
reward points if useful -
How to get the previous record value in the current record plz help me...
In my sql how to get the previous record value...
in table i m having the field called Date i want find the difference b/w 2nd record date value with first record date... plz any one help me to know this i m waiting for ur reply....
Thanx in Advance
with regards
kotreshFirst of this not hte mysql or database forum so don;t repeate again.
to get diff between two date in mysql use date_format() to convert them to date if they r not date type
then use - (minus)to get diff. -
How to get the recovery time of transient response of a power supply with Labview basic package without analysis option? Does anyone have any idea or some similar function SUBVIs?
Recovery time of transient response is defined as the time from the beginning of the transient to the voltage point on the waveform fallen into 10percent of the overshoot. Well, the waveform is something like a pulse with a soft slope.I recommend plotting your data on a graph on paper. Take a look at the data, and determine what is unique about the point you are looking for. Look for how you can teach your program to look for this point.
I have written several algorithms that do similar, one in fact being for a power supply, the other being for RPM. Neither algorithm used any advanced analysis tools. They are just a matter of determining, mathematically, when you achieve what you are looking for. Just sit down with your graph (I recommend multiple copies) and draw horizontal and vertical lines that determine when you get to the point you are looking for. You are probably going to have to reverse the array and start from the end, so think in those terms.
If you have trouble, emai
l me a bitmap of the graph, and what you are looking for and I will try to be of further assistance. Don't do that however; until you you have given this a few tries. Your solution should be involve a lot of logic on analog levels.
Good luck -
How to get the CPU time of a query?
Hello all, will someone pls tell me how to get the CPU time instead of Elapsed Time of a query?
Thanks.If i am not wrong, Jonathan Lewis blogged about the changed behaviour.
Here is short test:
SQL> CREATE OR REPLACE FUNCTION Cpu RETURN NUMBER IS
2 Retval NUMBER;
3 BEGIN
4 SELECT m.VALUE
5 INTO Retval
6 FROM V$statname s, V$mystat m
7 WHERE s.Statistic# = m.Statistic#
8 AND NAME = 'CPU used by this session';
9 RETURN Retval;
10 END;
11 /
Function created.
cat cpu_test.sql
DECLARE
TYPE t IS TABLE OF NUMBER;
tt t;
BEGIN
dbms_output.put_line(cpu());
SELECT COUNT(*) over(PARTITION BY owner) BULK COLLECT INTO tt FROM all_objects;
dbms_output.put_line(cpu());
SELECT COUNT(*) over(PARTITION BY object_type) BULK COLLECT INTO tt FROM user_objects;
dbms_output.put_line(cpu());
SELECT COUNT(*) over(PARTITION BY owner) BULK COLLECT INTO tt FROM dba_objects;
dbms_output.put_line(cpu());
END;
SQL> select * from v$version
2 /
BANNER
Oracle9i Enterprise Edition Release 9.2.0.6.0 - Production
PL/SQL Release 9.2.0.6.0 - Production
CORE 9.2.0.6.0 Production
TNS for Linux: Version 9.2.0.6.0 - Production
NLSRTL Version 9.2.0.6.0 - Production
SQL> @cpu_test
0
0
0
0
PL/SQL procedure successfully completed.
SQL> @cpu_test
106
106
106
106
PL/SQL procedure successfully completed.
SQL> select * from v$version
2 /
BANNER
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Prod
PL/SQL Release 10.2.0.3.0 - Production
CORE 10.2.0.3.0 Production
TNS for Linux: Version 10.2.0.3.0 - Production
NLSRTL Version 10.2.0.3.0 - Production
SQL> set serveroutput on
SQL> @cpu_test
1
129
130
145
PL/SQL procedure successfully completed.
SQL> @cpu_test
145
273
275
290
PL/SQL procedure successfully completed.Best regards
Maxim -
RE:RRI Checks how to get the data my reports.
Hi,
I have two reports overview&Detail reports.When i execute overview report i am getting the data.in the same report i am integrated the detail report.when i am trying to open detail report in overview report i am not getting the data it shown the error No Data Available. But data is there in Detail report when i execute individually.
i Did the RRI Checks also,
Pls help me how to get the data in detail reports and also give me the steps which i have follow.
Regards
SomHI All
Let me rephrase my Question
I have an overview report and a detailed Report Both of them are working fine individually. But when i link them using RSBBS the detailed report is not giving any data. it gives "no Data available". There is no assignment details maintained. it is having the default value. (generic and *)
please let me know what might i be missing
Regards
D -
How to get the data from pcl2 cluster for TCRT table.
Hi frndz,
How to get the data from pcl2 cluster for tcrt table for us payroll.
Thanks in advance.
Harisumanth.ChPL take a look at the sample Program EXAMPLE_PNP_GET_PAYROLL in your system. There are numerous other ways to read payroll results.. Pl use the search forum option & you sure will get a lot of hits..
~Suresh
Maybe you are looking for
-
Today, 6/18/2014, on my laptop, running Win8.0, a Firefox icon appeared on the taskbar, saying a new version 30.0 was available. I clicked on it, but missed as it closed. Upon opening the hidden icons, I clicked on the Firefox icon, the words 'update
-
Voicemail Notifications!!!!
My voicemail notification keeps coming up even when I do not have voicemail. How do I stop this??? Help!!!!
-
Is there an App that allows me to Create -Edit -Save a Template type document directly on the iphone4 I am currently copy and pasting the template details into a new "note" Thanks in advance. Clive
-
Hi all, i can connect to the psn & i can send email, see who is online, go into the store....butbut... i cant play zombies (black ops) online. any of the black ops 1 or 2, zombies or main game online, nor world at war game, it gives me a message on s
-
SimpleXmlParser smp=new SimpleXmlParser(ifsSession); This gives a warning that it is deprecated. Also gives a run time error : Exception in thread "main" java.lang.NoClassDefFoundError: oracle/xml/parser/v2/XMLParseException at ParserTest.main(Parser