UNDERSTAND THE NEW DATE AND TIME DATA TYPES IN ORACLE 9I

제품 : SQL*PLUS
작성날짜 : 2001-08-01
UNDERSTAND THE NEW DATE AND TIME DATA TYPES IN ORACLE 9I
========================================================
PURPOSE
Oracle 9i 에서 소개되는 새로운 datetime data type 에 대해 소개한다.
Explanation
Example
1. Datetime Datatypes
1) TIMESTAMP
: YEAR/MONTH/DAY/HOUR/MINUTE/SECOND
2) TIMESTAMP WITH TIME ZONE
: YEAR/MONTH/DAY/HOUR/MINUTE/SECOND/
TIMEZONE_HOUR/TIMEZONE_MINUTE( +09:00 )
or TIMEZONE_REGION( Asia/Seoul )
3) TIMESTAMP WITH LOCAL TIME ZONE
: YEAR/MONTH/DAY/HOUR/MINUTE/SECOND
4) TIME WITH TIME ZONE
: HOUR/MINUTE/SECOND/TIMEZONE_HOUR/TIMEZONE_MINUTE
2. Datetime Fields
1) YEAR/MONTH/DAY/HOUR/MINUTE
2) SECOND(00 to 59.9(N) is precision) : Range 0 to 9, default is 6
3) TIMEZONE_HOUR : -12 to 13
4) TIMEZONE_MINUTE : 00 to 59
5) TIMEZONE_REGION : Listed in v$timezone_names
3. DATE 와 TIMESTAMP 와의 차이점
SQL> select hiredate from emp;
HIREDATE
17-DEC-80
20-FEB-81
SQL> alter table employees modify hiredate timestamp;
SQL> select hiredate from employees;
HIREDATE
17-DEC-80 12.00.00.000000 AM
20-FEB-81 12.00.00.000000 AM
단, 해당 Column 에 Data 가 있다면 DATE/TIMESTAMP -> TIMESTAMP WITH
TIME ZONE 으로 Convert 할 수 없다.
SQL> alter table employees modify hiredate timestamp with time zone;
alter table employees modify hiredate timestamp with time zone
ERROR at line 1:
ORA-01439: column to be modified must be empty to change datatype
4. TIMESTAMP WITH TIME ZONE Datatype
TIMESTAMP '2001-05-24 10:00:00 +09:00'
TIMESTAMP '2001-05-24 10:00:00 Asia/Seoul'
TIMESTAMP '2001-05-24 10:00:00 KST'
5. TIMESTAMP WITH LOCAL TIME ZONE Datatype
SQL> create table date_tab (date_col TIMESTAMP WITH LOCAL TIME ZONE);
SQL> insert into date_tab values ('15-NOV-00 09:34:28 AM');
SQL> select * from date_tab;
DATE_COL
15-NOV-00 09.34.28.000000 AM
SQL> alter session set TIME_ZONE = 'EUROPE/LONDON';
SQL> select * from date_tab;
DATE_COL
15-NOV-00 12.34.28.000000 AM
6. INTERVAL Datatypes
1) INTERVAL YEAR(year_precision) TO MONTH
: YEAR/MONTH
: Year_precision default value is 2
SQL> create table orders (warranty interval year to month);
SQL> insert into orders values ('2-6');
SQL> select warranty from orders;
WARRANTY
+02-06
2) INTERVAL DAY (day_precision) TO SECOND (fractional_seconds_precision)
: DAY/HOUR/MINUTE/SECOND
: Logon time 확인시 주로 사용
: day_precision range 0 to 9, default is 2
SQL> create table orders (warranty interval day(2) to second);
SQL> insert into orders values ('90 00:00:00');
SQL> select warranty from orders;
WARRANTY
+90 00:00:00.000000
7. Interval Fields
- YEAR : Any positive or negative integer
- MONTH : 00 to 11
- DAY : Any positive or negative integer
- HOUR : 00 to 23
- MINUTE : 00 to 59
- SECOND : 00 to 59.9(N) where 9(N) is precision
8. Using Time Zones
1) Database operation
- Defined at CREATE DATABASE
- Can be altered with ALTER DATABASE
- Current value given by DBTIMEZONE
2) Session operation
- Defined with environment variable ORA_SDTZ
- Can be altered with ALTER SESSION SET TIME_ZONE
- Current value given by SESSIONTIMEZONE
3) TIMESTAMP WITH LOCAL TIMEZONE
- TIME_ZONE Session parameter
: O/S Local Time Zone
Alter session set time_zone = '-05:00';
: An absolute offset
Alter session set time_zone = dbtimezone;
: Database time zone
Alter session set time_zone = local;
: A named region
Alter session set time_zone = 'America/New_York';
Reference Document
------------------

Hi ,
I am facing the same problem and my scenario is also same (BAPI's).
So can you please tell me how you overcome this problem .
Thanks,
Rahul

Similar Messages

  • Cannot get the correct data type in Oracle JDBC

    Dear ALL:
    I used JDBC ResultSetMetaData to get the column data type for Oracle Database. I created a table including 2 columns AAA, which is NUMBER type, BBB which is FLOAT type.
    However, I found a problem that either NUMBER or FLOAT data types are reported as NUMBER type in JDBC.
    IN SQL 2000, it is okay. SMALLINT, INT, TINYINT, etc..can be reported correctly.
    Can anybody tell me that what's wrong here? I will be very appreciated.

    hi,
    i guess its a bug which is fixed with 10i.
    Elango.

  • How to add a new data type of oracle to SIM(7.0)

    Hi........
    I need to add a new data type(CLOB) to SIM of oracle .can anyone tell me how to modify or add this new data type.
    Any pointers to this will be highly appriciated.......
    thax in advance...

    Hi,
    Easiest way is to download the table eg into an Excel table (if possible) or text table. Drop the table from the database. Build your table with the new key field. Build the database table again and fill it.
    You can do it also over the database into a new table. Drop the old one. Build the enhanced one and fill it. Afterwards drop your (temporary) table.
    Maybe there are other ways, but this works.
    Success,
    Rob

  • Problem loading PostgreSQL Bytea data type to Oracle Raw data type

    We are migrating our database from PostgreSQL to Oracle. First, we convert the BYTEA data type in PostgreSQL to Oracle RAW. The BYTEA data type is variable bytes array. How can we load the BYTEA data type to Oracle RAW data type? Or I have to convert to different data type. thanks.
    Peter,

    hi,
    Instead of 'interval day to second' in method declaration use internal datatype 'DSINTERVAL_UNCONSTRAINED'.
    There are more unconstrained types in oracle.
    Bartek

  • How to access the Custom Data type variable given in Expression edit control To and From LabVIEW

    Hello, I would like to know how to access the custom data type variable given in the Espression Edit Control from LabVIEW and vice-versa
    Say, the FileGlobals.Reference_Handle (Custom Data Type Variable) contains the
    VISA I/O session (Which in turn contains VISA_DeviceName: String, Session: Number),
    Channel1: Number and
    Channel2: Number
    I am expecting the user to give FileGlobals.Reference_Handle as the input at the ExpressionEdit Control in the edit screen of the VI Call.
    I would like to know how to get the values of this custom data type to LabVIEW?
    Say, if I have the Cluster in LabVIEW like VISA I/O session (Deive Name and Session Number), Channel1 and Channel2
    how do i need to set this cluster to the Custom Data type variable in TestStand?
    Thanks and Regards
    Prakash 

    Hi,
    TestStand to LabVIEW: i didnt understand what you r trying to achieve. But if you are using references, Use Property nodes and Invoke nodes to achieve what you want in LabVIEW.
     LabVIEW to TestStand: check the image below: You need to click the button next to 'container'. I have used a cluster output in the VI.
    Hope this helps
    .......^___________________^
    ....../ '---_BOT ____________ ]
    ...../_==O;;;;;;;;_______.:/
    Attachments:
    1.JPG ‏187 KB

  • How do i get backed up purchases from an old iphone to a new one, but the only problem is an ipod is backed up into the new phone and i cant get my iphone data on to the new phone because its under i pod

    how do i get backed up purchases from an old iphone to a new one, but the only problem is an ipod is backed up into the new phone and i cant get my iphone data on to the new phone because its under i pod?

    Thanks very much!
    Although I had to add everything again to the playlist, at least I can just copy it over in future!

  • I got busy over the new year and forgot to purchase Applecare for my iPhone.  30 days past purchase date is too late - right?

    I got busy over the new year and forgot to purchase Applecare for my iPhone.  30 days past purchase date is too late - right?

    Thanks Peter.  I thought about that and had discounted the idea but since I am only 30 minutes away from my A store, I think I'll give it a try. I can be charming specially when I wear clean jeans and a nice top. :-) 
    Jerry H

  • APP-PAY-06841: Person change exit between the old and the new date.

    Hi,
    Please help me by answering this question as very urgent basis.
    ABC employee Effective date should be of future dated 10-jan-2011.
    But ABC employee joining date has been entered on 10-Aug-2010.
    amd also this date is also ended by updating on 10-Dec-2010.
    But these records are wrong.This employee's effective date should be form 01-Jan-2011.
    how to datetrack.
    if iam changing the date bye keeping effective date as 10-Dec-2010 an an iam changing the record to 01-jan-2011,its throwing the error as "**APP-PAY-06841: Person change exit between the old and the new date**"
    Thanks&Regards,
    Sowmya.K

    What is the application release?
    Please see these docs.
    Error: APP-PAY-06841: Person changes exist between the old date and the new date [ID 399056.1]
    APP-PAY-06841 When Changing Latest Start Date Of An Employee Who Was An Ex-Contingent Worker [ID 1146414.1]
    Unable To Change Start Date for Employee, Get Error "APP-PAY-06841: Person Changes Exist Between The Old Date And The New Date" [ID 603233.1]
    Correcting Latest Start Date in People Screen Gives Error APP-PAY-06841 [ID 368289.1]
    How To Change the Latest Start Date of an Employee? [ID 329692.1]
    Thanks,
    Hussein

  • Hello,i have updated to the new 11,and now i tunes will not open,error pops up,says Data Execution Prevention,and other error we can not complete ur i tune request,unknown error 4002,i have uninstalled and reinstalled ,has been not help.

    hello,i have updated to the new 11,and now i tunes will not open,error pops up,says Data Execution Prevention,and other error we can not complete ur i tune request,unknown error 4002,i have uninstalled and reinstalled ,has been no help.

    - Try restoring on another computer.
    -  Make an appointment at the Genius Bar of an Apple store.
    Apple Retail Store - Genius Bar

  • I just bought a new laptop because my old one died.  is there any way to sync my phone with the new machine and not lose all my data?

    i just bought a new laptop because my old one died.  is there any way to sync my phone with the new machine and not lose all my data?

    Copy everything from your backup copy of your old computer to your new one.
    Then sync.

  • Bought the new iphone and tried to restore it to my old iphone settings. It synced some of the old data onto it, but then it froze and continues to. It says to restore it but I'm afraid to lose my contacts. Will the contacts be lost?

    Bought the new iphone and tried to restore it to my old iphone settings. It synced some of the old data onto it, but then it froze and continues to. It says to restore it and erase everything, but I'm afraid to lose my contacts. Will the contacts be lost or will they be there when I sync it back up?

    Hello timotim56,
    This can be achieved by removing the device via iCloud.com
    iCloud: Remove your device
    http://support.apple.com/kb/PH2702
    Cheers,
    Allen

  • I have installed the new OS and have lost a part of my personal data: music files and pictures. The new safari is horrible. Give me back the previous version!

    I have installed the new OS and have lost a part of my personal data: music files and pictures. The new safari is horrible. Give me back the previous version! Or fix the bugs!

    These are user-to-user forums, they are not monitored by Apple (there are too many forums/threads/messages for that to happen). If you want to leave feedback for Apple then you can do so here : http://www.apple.com/feedback/ipad.html
    What bugs ? Have you not got your music, files, photos on your computer so that you can sync them back to the iPad ?

  • Reg. the creation of new data type in ECC 6.0

    Hi All,
    I have a requirement wherein I need to create a new data type INT with length as 4. Is there any way that we can add create a new data type.
    Thanks in advance,
    Durga.

    I have tried using t-code SE11 but i am unable to create.

  • I plugged in my ipod to my computer and I had the option to sync the new software and I did. Just as it was done itunes couldn't recognize my ipod and my only choice would be to restore back to store settings but I would loose ALL my data :(

    I plugged in my ipod to my computer and I had the option to sync the new software and I did. Just as it was done itunes couldn't recognize my ipod and my only choice would be to restore back to store settings but I would loose ALL my data

    Yes, you probably will but then you simply load your backup.

  • Is it possible to get the element data type of a Queue from itself?

    Hi everyone,
    i have a Q that has a cluster as element data type.
    now when i want to enqueue
    i'll use bundle-by-name
    and for that i'd have to have my data-type present
    (long cable from whereever (possibly from where i obtained the Q).
    my question is,
    whether there is a method/property-node/something that allows me to
    wire the Queue Refnum into it and receive the element-data-type,
    so i can then input into the top of bundle-by-name?
    (i really dont want to have that cable all over the place)
    the reason i ask here is that
    the help for the outgoing Queue Refnum from the Obtain Queue method,
    shows the element-data-type and so i hope there might be a solution.
    thx for your time
    and cheers
    j
    Solved!
    Go to Solution.

    If I understand your question correctly, the answer is "Yes, it's very easy ..."
    The answer is "Preview Queue".  Here I create a Queue of some mysterious type (it's a cluster having a Thing and a Center, but you don't know that yet).  I take the Queue reference from whereever I can find it and pass it into Preview Queue Element.  I take the output and use it to define my cluster in Bundle by Name.
    Two caveats.  This copies the first element of the Queue into the cluster, so you probably need to be sure to define all of the elements of your cluster.  But what if the Queue is empty (as mine is, above, as I just Obtained it) -- well, that's why 0 is wired into the TimeOut input, since I do not want to wait "forever" (-1) for the empty Queue to have an element!  Turns out that even in this case, you still get the correct Cluster elements!
    Neat, huh?
    Bob Schor

Maybe you are looking for

  • ITunes bugging a lot.

    When i close it, the process doesn't finish and if i close it using task manager, when i try to open iTunes again it freezes and i have to restart my computer to use it again.

  • System error in opening a query

    hi guys, this is the error i'm getting when opening this query which i need for my CR Abort System error in program in SAPLRR12 and form cell_fuellen_acell-01 Diagnosis: This internal error is a targeted termination since the program has an incorrect

  • Error While viewing data on XML model- java.sql.SQLException: constante num

    I am trying to read an XML file and I keep getting an error. At first it worked, and the it stopped working. I re-did everthing exactly as first time and I cannot get it work Here is what I do : 1)     Create Physical Architecture under the XML Techn

  • HT4818 I have a new IMac with an external disk drive, it won't instal bootcamp

    I have a new IMac with an external disk drive, it won't instal bootcamp because the windows 7 disk in the mac drive is the wrong format.. how do I instal bootcamp with windows 7 from the disk I have?

  • Urgent !!!! Duplicate invoice entry

    Hello Experts, I have a meeting tomorrow with business people to discuss the problems of "Double Entry Invoice" and how to control that. Here is what I was told by Business Unit head: I have observed that we sometimes make duplicate payments, usually