Configuring date format in Oracle 8.1.7

I have just unloaded records from tables into an sql script file with insert statements. However, the date format for the records that I have unloaded is MM/DD/YYYY. When I try to run this sql script, oracle gives an error, saying it's not a valid month.
Oracle date format is DD-MMM-YY. How can I change the date format in oracle, so that I could insert these records in?

If your script does not have explicit TO_DATE conversions (which it should, by the way), like:
insert into t values (to_date('11/21/2002', 'mm/dd/yyyy'));then you can set the default date format to match the format in your script. So, if your script looks like:
insert into t values ('11/21/2002');then:
alter session set nls_date_format = 'mm/dd/yyyy';prior to running the script.

Similar Messages

  • I want convert string to date format in Oracle

    Dear All
    I want convert string to date format in Oracle,Format is given below
    'Friday, 02 March 2012 2:44 PM' to '02/03/2012 2:44 PM'

    >
    Hi Parwez,
    I want convert string to date format in Oracle,Format is given below
    'Friday, 02 March 2012 2:44 PM' to '02/03/2012 2:44 PM'SELECT TO_DATE('Friday, 02 March 2012 2:44 P.M.', 'DAY, DD MONTH YYYY HH:MI A.M.') from dual;
    As well as what the other poster suggested, look here: http://docs.oracle.com/cd/B19306_01/server.102/b14200/sql_elements004.htm#i34924
    HTH,
    Paul...

  • Problem with date format from Oracle DB

    Hi,
    I am facing a problem with date fields from Oracle DB sources. The date format of the field in DB table is 'Date base type is DATE and DDIC type is DATS'.
    I mapped the date fields to Date characters in BI. Now the data that comes to PSA is in weird format. It shows like -0.PR.09-A
    I have changing the field settings in DataSource  to internal and external and also i have tried mapping these date fields to text fields with out luck. All delivers the same format.
    I have also tried using conversion routines like, CONVERSION_EXIT_IDATE_INPUT to change format. It also delivers me the same old result.
    If anybody of you have any suggestions or if anybody have you experienced such probelms, Please share your experience with me.
    Thanks in advance.
    Regards
    Varada

    Thanks for all your reply. I can only the solutions creating view in database. I want some solution to be done in BI. I appreciate if some of you have idea in it.
    The issue again in detail
    I am facing an issue with date fields from oracle data. The data that is sent from Oracle is in the format is -0.AR.04-M. I am able to convert this date in BI with conversion routine in BI into format 04-MAR-0.
    The problem is,  I am getting data of length 10 (Output format) in the format -0.AR.04-M where the month is not in numericals. Since it is in text it is taking one character spacing more.
    I have tried in different ways to convert and increased the length in BI, the result is same. I am wondering if we can change the date format in database.
    I am in puzzle with the this date format. I have checked other Oracle DB connections data for date fields in BI, they get data in the format 20.081.031 which will allow to convert this in BI. Only from the system i am trying creating a problem.
    Regards
    Varada

  • Date Format in Oracle 11g XE

    Hello everyone,
    I have installed Oracle11XE and noticed that it has the following date format:
          SQL> SHOW PARAMETER NLS_DATE_FORMAT
          NAME                                 TYPE        VALUE
          nls_date_format                      string      RR-MM-DD
    I know that I can change the format for the session, like this:
         alter session set nls_date_format = 'DD-MON-YY';
    I also know that to change the system parameter I need to do the following:
         alter system set nls_date_format = 'DD-MON-YY' scope=spfile; 
         then restart the database.
    However, after I do the latter, the date format is still:
         SQL> select sysdate from dual;
         SYSDATE
         14-11-19
    Could someone tell me why this is happening and correct this?..
    Thanks.

    goodluck247 wrote:
    Hello everyone,
    I have installed Oracle11XE and noticed that it has the following date format:
          SQL> SHOW PARAMETER NLS_DATE_FORMAT
          NAME                                 TYPE        VALUE
          nls_date_format                      string      RR-MM-DD
    I know that I can change the format for the session, like this:
         alter session set nls_date_format = 'DD-MON-YY';
    I also know that to change the system parameter I need to do the following:
         alter system set nls_date_format = 'DD-MON-YY' scope=spfile;
         then restart the database.
    However, after I do the latter, the date format is still:
         SQL> select sysdate from dual;
         SYSDATE
         14-11-19
    Could someone tell me why this is happening and correct this?..
    Thanks.
    NLS_DATE_FORMAT is set at
    system
    client OS
    client oracle session.
    system setting is weakest because it is over-ridden by any other setting.
    See - But I want to store my date as ...

  • Date format in Oracle 10g XE

    I'm using Oracle 10g XE on Windows Vista and I'm curious as to what determines the date format.
    According to the globalization section in the Oracle installation guide the NLS_DATE format is dependent on the NLS_LANGUAGE setting. In my database the NLS_LANGUAGE is American, the NLS_TERITORY is America and all other NLS_* parameters are blank (default).
    From that I would expect the default date format to be mon-dd-yyyy.
    However when I run SELECT sysdate FROM dual the date is reported as dd/mm/yyyy and this was the default format when I used SQL Developer and when I used the command line SQL*Plus. Obviously something else is determining the date format, but what?

    Your settings are dependent on NLS_LANG on the client.
    They are derived from (assuming Windows) the regional settings of the O/S.
    This means in Western Europe the default 'American_America.WE8MSWIN1252'.
    This makes the default NLS_DATE_FORMAT dd-mm-yy.
    You can override this in the registry, or set up an after logon trigger.
    Sybrand Bakker
    Senior Oracle DBA

  • External date format in oracle source system

    Hai friends ,
    My situation is data reconciliation on the cube .I have virtual provider designed with date .My oracle source system has dates in external format say 19-sep-2009 .How to approach my virtual provider in BI with these date fields ..
    iam thinking of inversion routines to communicate with the source system and then reconvert again to BI format in the start routine .Suggest me if any logics with examples.
    Goodday.

    Hello,
    Please refer to the information in the SAP note 518241 , the note refers to DB connect but the section in the note on converting the
    date fields to SAP date format should also be helpful in your case.
    Best Regards,
    Des

  • Default date format in oracle

    Hi
    What is the default format of date in oracle?
    When I rum the following query
    select * from emp where hiredate='03-december-1981' ...
    It is returning two records.
    How is it possible?

    Kamran Agayev wrote:
    For input and output of dates, the standard Oracle date format is DD-MON-YY
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14220/datatype.htm#i1847
    Although it's there in the documentation, I find it misleading, as many times, the default nls_date_format has been changed to something else, either by the dba's, or by a front end application or whatever.
    It is ALWAYS safest to use to_date and to_char when working with strings-that-you-want-as-dates or dates-that-you-want-as-strings respectively.
    Any time you store a date in the database, store it in DATE format - this gives oracle valuable information (eg. that it's a date and not just a string) which allows it to make decisions correctly when comparing them. Eg. '22/01/2009' is earlier than '14/02/2009' if the database knows it is a date, but is later if all the database sees is a string (14 being less than 22, of course).
    Anything that is already in date format, you do not need to change if you're using it in calculations (eg. select date_col_1 - date_col_2 from my_table , or sysdate) but any time you interact with the database to input a date or extract a date, you need to use to_date or to_char. (it's less important with the latter, if you don't really care how the date is displayed). Do not ever to_date() something that is already a date - you force implicit conversions of the date and that is a) pointless and b) could cause bugs in your code.
    Even the experts sometimes get caught out with dates, when they rely on implicit conversions!

  • Date format in oracle system

    Hi expert,
    date format in our oracle is 'mm/dd/yy', here in a application table, we got following fields:
    ACCOUTING_FROM_DATE ACCOUTING_TO_DATE
    1/28/13 1/01/00
    could you please tell me what date is '1/01/00'?
    and how to change oracle data format without affecting system ?
    Many Thanks,

    1001197 wrote:
    Hi expert,
    date format in our oracle is 'mm/dd/yy', here in a application table, we got following fields:
    ACCOUTING_FROM_DATE ACCOUTING_TO_DATE
    1/28/13 1/01/00
    could you please tell me what date is '1/01/00'?No; that's one reason why 2-digit years are such a bad idea.
    and how to change oracle data format without affecting system ?To change the default display format for all DATEs in your session:
    ALTER SESSION  SET NLS_DATE_FORMAT = 'fmMM/fmDD/YYYY';This affects only your session; it will not affect other users in other sessions.
    Regardless of what the default format is, you can display an individual DATE in a given format using TO_CHAR
    SELECT     TO_CHAR ( accouting_to_date
              , 'fmMM/fmDD/YYYY'
              )          AS a_to
    FROM    table_x
    ;

  • Independently configure date format for XML/JSON serialization

    How do I configure the date format independently for each of my date fields?
    For example, let's say I have a CustomerOrder class with more than 1 java.util.Date fields in it.
    I need to be able to render like this:
    <customerOrder>
    <orderDate>2013-01-04T20:50:42.769Z</orderDate>
    <user>Bob</lastUpdateUser>
    <state>CO</state>
    <estShipDate>2013-01-04</estShipDate>
    </customerOrder>
    So one of the dates may not care about the hh:mm:ss.
    i.e. I cannot format every date the same way.
    Any ideas?
    This is my technology stack:
    - Tomcat 7
    - Jersey 1.16
    - Enunciate 1.26.2
    - Spring 3.1.2
    - Hibernate 4.1.7
    - JPA 2.0.3

    Otis,
    A "java.sql.Date" contains only a date, whereas a "java.sql.Timestamp" contains both date and time. So retrieve the data (from the database) as a "Timestamp" and not as a "Date".
    Perhaps if you'd care to post the relevant part of your code and show what you are getting and what you want to get, I may be able to help you further.
    Here's a small (uncompiled and untested) example:
    Connection conn = // However you get it.
    Statement stmt = conn.createStatement();
    ResultSet rs = stmt.executeQuery("select sysdate from dual");
    if (rs.next()) {
      Timestamp ts = rs.getTimestamp(1);
    }Good Luck,
    Avi.

  • Date Formats in Oracle Applications Forms and Oracle Self Service

    Can someone tell me what determines the Date format that appears on Oracle Applications Forms and Oracle Self Service ?
    *1.* In Oracle HRMS,all dates i see on the Forms are of the Format "MM/DD/YYYY" but my NLS Parameters are not in this format .I'm giving the results for the NLS parameters below.I thought the date formats are determined by the NLS format.Is there something else that determines the date format appearing on Oracle Applications Forms ?
    NLS_DATABASE_PARAMETERS
    NLS_DATE_FORMAT     :DD-MON-RR
    NLS_DATE_LANGUAGE     :AMERICAN
    NLS_LANGUAGE     :AMERICAN
    NLS_TERRITORY     :AMERICA
    NLS_INSTANCE_PARAMETERS
    NLS_DATE_FORMAT     :DD-MON-RR
    NLS_DATE_LANGUAGE     :
    NLS_LANGUAGE     :american
    NLS_TERRITORY     :america
    NLS_SESSION_PARAMETERS
    NLS_DATE_FORMAT     :DD-MON-RR
    NLS_DATE_LANGUAGE     :
    NLS_LANGUAGE     :american
    NLS_TERRITORY     :america
    *2* What about the profile option : ICX_DATE_FORMAT_MASK ? Does it determine the Date Format for Self Service alone or does it impact the date format appearing on Oracle Applications Forms and the actual database also ?
    *3* If I use a to_date function in ,say, a pl/sql function that i code for some custom requirements,what will be the output of the date format ? Does it take the format given in NLS paramaters or is it determined by anything else?
    Thanks in advance...

    Hi,
    Thanks for your reply ,but I'm still confused ..
    Here are the profile options I'm seeing for one of my instance :
    ICX: Date format mask - 12/31/1999
    ICX: Date language - American English
    ICX: Language - American English
    ICX: NLS Sort - BINARY
    ICX: Territory - United States
    ICX: Numeric characters - NULL
    NLS parameters are given in my original email.
    In Self Service applications(OAF) ,the date format is appearing in "mm/dd/yyyy" format but when i login to Forms based applications ,I see the date format as "dd-mon-yyyy".What determines this date format ?
    How can i make the date format to always return one format everywhere ,be it Self Service (OAF) or Oracle Forms ?
    I'm getting date format related errors for my code because of default date formats changing intermittently when i log into Self Service.I want to know if there is anyway to prevent this from happening?
    Thanks in advance.

  • Date format for oracle lite client database

    hello....
    When data is entered opened on the oracle lite webtogo OC4J client is giving the following errors:
    JBO-25009: Cannot create an object of type:java.sql.Date with value:2/21/08 12:00 AM
    JBO-27014: Attribute CreationDate in AppModule.ApplicantIncomesView1 is required
    JBO-27024: Failed to validate a row with key oracle.jbo.Key[85685 ] of type AppModule.ApplicantIncomesView1
    Which date format is supported on the OC4J client?The application has been developed using Jdeveloper JSF/ADF BC technology.

    user6998712 wrote:
    Hi all,
    My client has installed Oracle Lite version 10.3.0.3. Oracle Lite Database file (ODB) tends to grow too large. Oracle recommends resizing the Oracle Lite database by running Defrag.exe tool. please post URL where this is documented

  • Configuring Date format across a JSF application

    Hi,
    I know there's a way to use a date-time converter on a Date accessor on a backing bean, such as below..
    <h:outputText value="#{bean.dateInstance}">
        <f:convertDateTime type="both"/>
    </h:outputText>.. but is there a way to format dates consistently across the entire application? Does anybody know what is the default converter for Date's? I haven't done much research into it... I know you can create a custom converter to convert all objects of a certain class, but I assume there's already a default one for Dates that could just be configured to use a certain date pattern?
    Thanks in advance,
    James

    If your script does not have explicit TO_DATE conversions (which it should, by the way), like:
    insert into t values (to_date('11/21/2002', 'mm/dd/yyyy'));then you can set the default date format to match the format in your script. So, if your script looks like:
    insert into t values ('11/21/2002');then:
    alter session set nls_date_format = 'mm/dd/yyyy';prior to running the script.

  • Default Date Format in Oracle 9i

    What is the default date given by oracle 9i when the column is specified as NULL for the date column ?
    Just like in SQL Server 2000 when date is given as NULL, it will give date as
    '1900-01-01 00:00:00' in that column. What is it in Oracle 9i
    Thanx in advance!

    It will be a NULL, unless you specify a DEFAULT for the column:-
    <code>
    SQL> create table t ( x int, y date );
    Table created.
    SQL> insert into t ( x ) values ( 1 );
    1 row created.
    SQL> select * from t;
    X Y
    1
    SQL> alter table t modify ( y date default sysdate );
    Table altered.
    SQL> insert into t ( x ) values ( 1 );
    1 row created.
    SQL> select * from t;
    X Y
    1
    1 21-JUL-05
    </code>
    Regards
    Adrian

  • Date format in Oracle 8i

    Is the 'TZD' option available for entering and displaying dates in Oracle 8.1.7.4?
    For example, I'm using sqlldr to load in a date in this format in my controlfile:
    Mon Jun 27 00:15:00 EDT 2005
    DATETM          DATE 'DY MON DD HH24:MI:SS TZD YYYY',
    It will work until I place the timezone in the date.
    Thanks

    Prior to 9i and the TIMESTAMP data types, Oracle didn't have the concept of time zones in a DATE field, so there is no TZD format specifier.
    Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

  • Sort Date format in Oracle XML Publisher

    Hi All,
    I have a requirement like trx_date sort. i have taken trx_date in dd-mon-yyyy format. now i given sort option like this..
    <?for-each:G_TRX_ORDER_NUMBER?><?sort:TRANSACTION_TYPE?><?sort:DUE_DATE;'ascending';data-type=date?> <?sort:TRX_NUMBER?>
    now i have 3 dates
    07-NOV-10
    20-MAY-11
    20-DEC-10
    using above sort option.. this dates are not coming as per the ascending order.
    Can any one tell me what i have to ?
    Thanks

    What is your application release?
    Does the sort work for other data types?
    What if you change "<?sort:DUE_DATE;'ascending';data-type=date?>" to "<?sort:DUE_DATE;'ascending';data-type='date'?>", does it make any difference?
    Few examples about the sort can be found in these docs/links.
    How to Group Data Dynamically at Runtime in a BI/XML Publisher RTF Template? [ID 1062816.1]
    Sorting Data In eText Template [ID 1263511.1]
    Oracle XML Publisher User's Guide
    http://download.oracle.com/docs/cd/B25516_18/current/acrobat/115xdoug.zip
    Thanks,
    Hussein

Maybe you are looking for