Convert it to the format DD-MON-YYYY/MM/DD/YYYY

I have an input variable date L_DATE as 11-Aug-2013(DD-MON-YYYY).
In my home, I am to convert the date in MM/DD/YYYY format.

The logic that I used the same thing in my stored Proc - COMPARE2 is:
R_DATE: = to_char (to_date(L_DATE,'DD-MON-YYYY'), ' MM/DD/YYYY');

But this is the error I get when operating the SP:
ORA-01843: not one month valid
ORA-06512: at "COMPARE2", line 51
ORA-06512: at line 2

Can anyone suggest how to fix this?

Hello

Apparently, you have an invalid value to l_date, such as 21-2013-Aug'.  Correcct of entry and the error occur.

You may have good reasons to need to accept the date information in a VARCHAR2 column, but you have every reason to keep the date information in a VARCHAR2 column?  Why not let r_date a date?

Tags: Database

Similar Questions

  • How to convert JAVA. SQL. Date the DATE in the format DD/MM/YYYY to DD/MM/YYYY

    I use an informix database that accepts the value of date as a DATE format...
    the other part of my app takes date from the field in the format DD/MM/YYYY... so I have to convert my java.sql.date in marker AAAA/MM/JJ JJ/MM/AAAA marker of the same type before inserting into db...
    but by using the parse method in SimpleDateFormat class can get the result format java.util.date...
    and also using method format may result in the conversion of strings...

    public class Dbop {
        static final java.text.SimpleDateFormat fmt = new java.text.SimpleDateFormat("dd/MM/yyyy");
        public static void main(String[] args) throws Exception {
            java.util.Date ud = fmt.parse("31/12/2010");
            java.sql.Date sd = new java.sql.Date(ud.getTime());
            String formattedSqlDate = fmt.format(sd);
            System.out.println("result:"+formattedSqlDate);
        }
    }
    
  • SQL * Loader: load data in the format MM/DD/YYYY HH: mi: SS PM

    Please advice how to load data in the format MM/DD/YYYY HH: mi: SS PM in an Oracle Table using SQL * Loader.

    -Should what format I give in the control file?
    -What would be the type of column to create the table to load data.

    Examples of data below;

    MM/DD/YYYY HH: MI: SS PM

    14:40:20 09/12/2012
    29/11/2011 11:23:12

    Thanks in advance
    Avinash

    Astr0 wrote:
    Hello Srini,

    I tried with the date of creation as DATE data type, but I had an error like

    ORA-01830: date format picture ends before converting entire input string
    CREATION_DATE               "TO_CHAR(TO_DATE(:CREATION_DATE,'MM/DD/YYYY HH:MI:SS AM'),'DD-MON-YYYY HH:MI:SS AM')",
    

    Try

    CREATION_DATE "to_Date(:CREATION_DATE,'yyyy-mm-dd hh:mi:ss AM')",
    

    Does that help? It is charging correctly in the timestamp column

    REDA

  • How to get the date in the format dd/mm/yyyy?

    Hello
    for this query:
    > select to_date (to_char (sysdate), ' dd/mm/yyyy') of double;
    I wanted to get a date in the format dd/mm/yyyy, but this query is not in the right format to date.
    How to get it?

    Why you are converting a date (it's a date in your table, right) tank and back to a date. When you want to display a date a certain way, you use to_char and specify the mask format to display the date as to_char (sysdate, 'dd-mm-yyyy'). Internally, dates are stored as bytes 7, you use to_char only for display purposes.

  • We had to find the date in the format "DD-MM-YYYY" and "DD/MM/YYYY '.

    Hello world

    I need to find the hire_date in the format "dd-mm-yyyy" and "dd/mm/yyyy '. This shows also some errors, I can't found. pls help to solve this problem...

    Hello

    Christine Schnittker says:
    ... It works as well:

    SQL> select to_date('22-02-2012','dd/mm/yyyy') dt from dual;
    
    DT
    ----------
    22-02-2012
    

    (Does anyone know anything that actually says?)

    The Manual of the SQL language , after listing the format items allowed in TO_DATE, says the following:

    Any nonalphanumeric character is allowed to match punctuation characters in the format model. For example, the following statement returns no error:
    SELECT TO_CHAR (TO_DATE('02#07','MM/YY'), ' MM/YY') FROM DUAL;

    TO_CH
    -----
    02/07

  • Date does not match the format DD-MON-RR

    I've created a form, and I have an element bound to a date type field.
    This element is a date picker, and when I choose a date on the calendar, the date appears correctly, in article 28-Dic-12

    The problem is, trying to create the record, I got an error:
    Date does not match the format DD-MON-RR

    But I do not understand how to solve this problem. The date is correct as far as I KNOW.

    Kind regards.

    change Application language derived from-> Application primary language

  • How do I get the date in the format dd/mm/yyyy hh: mm IS

    Hi all
    I want to display the sysdate in the format mm/dd/yyyy hh: mm IS. Please help if anyone knows.
    select to_char(systimestamp at time zone 'EST','mm/dd/yyyy hh:mi tzr') from dual
    

    do you think that... ??

    Ravi Kumar

  • What is the best way to obtain a string that represents a date in the format mm/dd/yyyy

    What is the best way to obtain a string that represents a date in the format mm/dd/yyyy

    It would be good if I could generate this string using the static methods of a class.






    You can use date formatter:

    Import mx.formatters.DateFormatter;
    ...

    var trainer: DateFormatter = new DateFormatter();
    formatter.formatString = "YYYY/MM/DD JJ:NN:SS;
    var today: Date = new Date();
    trace (formatter.format (now));

  • How to display the date in the format "DD-MON-AA HH:MIPM '?

    Hello

    I have a form in which P9_SUBMIT_TIME element is created with the display of text type.
    In the source, I entered SUBMIT_TIME as value to call the ID passed to the form-based data in the SUBMIT_TIME column. Type of source for this article is defined as the source of the database column.
    Currently the option displays 'DD-MON-YY HH.
    I don't understand why "HH" is also displayed.
    How can I display the item with the format 'DD-MON-YY HH:MIPM?

    Thank you
    Guy

    Hi GUY3!

    To change the format of a textfield that textfield edit and search for the attribute "Format Mask" in the region of the "Source". Here, you can enter a format or a list, choose a given format. The type of format you are looking for is in the list.

    Yours sincerely

    Florian W.

  • I have fb2 (zip) files on my PC. I would like to convert it to the format fb2

    Remember - this is a public forum so never post iIInformatiIon private such as numbers of mail or telephone!

    Ideas:

    • You have problems with programs
    • Error messages
    • Recent changes to your computer
    • What you have already tried to solve the problem

    Extract the fb2 file in the zip file using WinRAR

    http://download.CNET.com/WinRAR-32-bit/3000-2250_4-10007677.html

    If this post answers your question, click mark as answer .

  • timestamp field is generating the error for the format ("MON-DD-YY hh: mi PM")

    "I'm trying to save the value 11 April 09 17:00 ' in a field with the timestamp data type. I got error 'found character where expected number'.
    So I change value 11 April 09 05:00 ' and registered without any error.

    I need to know "How to save" 11 April 09 17:00 "in the field with the timestamp data type'."

    Hello

    I think that it is a common misconception of what TO_DATE and TO_TIMESTAMP actually do. They do not convert your data. Oracle does not store the format of date or timestamp to Oracle date is a date. This display mode is determined by your NLS settings. So if you save ME-DD-YYYY or DD-MON-AA, Oracle stores exactly the same thing.

    So you ask how to "convert" your timestamp before saving, you don't need to. You just need to explain the format in which you provide the data to Oracle. You have the format "HH24 MON-DD-YY" in your date picker. I guess you NLS parameters are for the format ' DD-MON-YY hh: mi PM'. In this case, you need to do

    TO_TIMESTAMP(:P_ITEM,'DD-MON-YY HH24:MI') 
    

    NOT

    TO_TIMESTAMP(:P_ITEM, 'DD-MON-YY HH:MI PM' )
    

    If you do this and then query the database, it will be returned in the format ' DD-MON-YY hh: mi PM' if that's what you NLS settings dictate.

    Hope it makes sense.

    Ben
    http://www.munkyben.WordPress.com
    Don't forget to mark the answers useful or correct ;)

  • How to convert sql server procedures in the format of oracle

    Hello

    I need help, I got some procedures that is written in the format MS Sql, I need to convert those to the format of the oracle, and I don't know how to do. Could someone help me?

    IN SQL server code format is:

    / * Object: StoredProcedure [dbo]. [sp_rpt_get_job_log_on_demand]    Script Date: 20/12/2013-09:07:26 * /.

    SET ANSI_NULLS

    GO

    SET QUOTED_IDENTIFIER ON

    GO

    CREATE PROCEDURE [dbo]. [sp_rpt_get_job_log_on_demand]

    (

    @JOB_ID INT

    @REPORT_DATE AS DATETIME

    , @PERIOD VARCHAR (100)

    )

    AS

    BEGIN

    SET @REPORT_DATE = CONVERT (DATETIME, CONVERT (DATE, @REPORT_DATE))

    DECLARE @MONTH INT = (YEAR (@REPORT_DATE) * 100) + MONTH (@REPORT_DATE)

    , @TODAY = INT ((((@REPORT_DATE) YEAR * 100) + MONTH (@REPORT_DATE)) * 100) + DAY (@REPORT_DATE)

    @YEAR INT = YEAR (@REPORT_DATE)

    SELECT J.JOB_ID

    J.JOB_NAME

    CASE

    WHEN F.FREQUENCY_SUBTYPE IS NULL, F.FREQUENCY_TYPE

    OF OTHER F.FREQUENCY_TYPE + '-' + F.FREQUENCY_SUBTYPE

    END AS FREQUENCY_TYPE

    L.TRANSACTION_DATE

    L.PROCESS_DATE

    START_TIME

    END_TIME

    DATEDIFF(MINUTE,START_TIME,END_TIME) AS TIME_TAKEN

    L.RECORD_COUNT

    ISNULL(L.EXECUTION_STATUS, 'NOT STARTED') AS EXECUTION_STATUS

    L.ERROR AS ERROR_DESC

    P.PRIORITY_NUMBER

    P.COLOR_CODE

    OF dbo.JOBS J AS

    INNER JOIN dbo. ACE OF FREQUENCY F

    ON J.FREQUENCY_ID = F.FREQUENCY_ID

    INNER JOIN dbo. JOB_PRIORITY AS P

    ON J.PRIORITY_ID = P.PRIORITY_ID

    LEFT JOIN dbo. TBK_POS_FACT_LOADING_SUMMARY ACE L

    ON J.JOB_ID = L.JOB_ID

    AND)

    (@PERIOD = 'TODAY' AND CONVERT (DATETIME, CONVERT (DATE, L.START_TIME)) = @REPORT_DATE) OR

    (@PERIOD = 'MONTHS' AND ((START_TIME) YEAR * 100) + MONTH (START_TIME) = @MONTH) OR

    (@PERIOD = 'YEAR' AND YEAR (START_TIME) = @YEAR)

    )

    AND CONVERT (DATETIME, CONVERT (DATE, L.START_TIME)) < = @REPORT_DATE

    WHERE F.FREQUENCY_TYPE <>'NONE'

    AND J.JOB_ID = @JOB_ID

    UNION ALL

    SELECT J.JOB_ID

    J.JOB_NAME

    CASE

    WHEN F.FREQUENCY_SUBTYPE IS NULL, F.FREQUENCY_TYPE

    OF OTHER F.FREQUENCY_TYPE + '-' + F.FREQUENCY_SUBTYPE

    END AS FREQUENCY_TYPE

    L.TRANSACTION_DATE

    L.PROCESS_DATE

    START_TIME

    END_TIME

    DATEDIFF(MINUTE,START_TIME,END_TIME) AS TIME_TAKEN

    L.RECORD_COUNT

    L.EXECUTION_STATUS

    L.ERROR AS ERROR_DESC

    P.PRIORITY_NUMBER

    P.COLOR_CODE

    OF dbo.JOBS J AS

    INNER JOIN dbo. ACE OF FREQUENCY F

    ON J.FREQUENCY_ID = F.FREQUENCY_ID

    INNER JOIN dbo. JOB_PRIORITY AS P

    ON J.PRIORITY_ID = P.PRIORITY_ID

    INNER JOIN dbo. TBK_POS_FACT_LOADING_SUMMARY ACE L

    ON J.JOB_ID = L.JOB_ID

    WHERE F.FREQUENCY_TYPE = 'NONE '.

    AND)

    (@PERIOD = 'TODAY' AND CONVERT (DATETIME, CONVERT (DATE, L.START_TIME)) = @REPORT_DATE) OR

    (@PERIOD = 'MONTHS' AND ((START_TIME) YEAR * 100) + MONTH (START_TIME) = @MONTH) OR

    (@PERIOD = 'YEAR' AND YEAR (START_TIME) = @YEAR)

    )

    AND J.JOB_ID = @JOB_ID

    AND CONVERT (DATETIME, CONVERT (DATE, L.START_TIME)) < = @REPORT_DATE

    END

    GO

    I tried to convert it to a format of oracle... But I get the error message.

    --------------------------------------------------------------------------------------------------

    CREATE OR REPLACE PROCEDURE POS.sp_rpt_get_job_log_on_demand_V)

    JOB_ID NUMBER,

    DATE OF REPORT_DATE,

    PERIOD VARCHAR2 (100))

    AS

    BEGIN

    l_MONTH: = TO_CHAR (REPORT_DATE, "YYYYMM");

    TODAY: = TRUNC (REPORT_DATE);

    l_YEAR: = TO_CHAR (REPORT_DATE, 'YYYY');

    SELECT J.JOB_ID,

    J.JOB_NAME,

    CASE

    WHEN F.FREQUENCY_SUBTYPE IS NULL, F.FREQUENCY_TYPE

    OF OTHER F.FREQUENCY_TYPE | '-' || F.FREQUENCY_SUBTYPE

    END

    AS FREQUENCY_TYPE.

    L.TRANSACTION_DATE,

    L.PROCESS_DATE,

    START_TIME,

    END_TIME,

    (END_TIME - START_TIME) AS TIME_TAKEN,

    L.RECORD_COUNT,

    NVL (L.EXECUTION_STATUS, "NOT STARTED") AS EXECUTION_STATUS,

    L.ERROR AS ERROR_DESC,

    P.PRIORITY_NUMBER,

    P.COLOR_CODE

    OF POS.JOBS J.

    POINT OF SALE. FREQUENCY F,

    POINT OF SALE. JOB_PRIORITY P,.

    POINT OF SALE. TBK_POS_FACT_LOADING_SUMMARY L

    WHERE J.FREQUENCY_ID = F.FREQUENCY_ID

    AND J.PRIORITY_ID = P.PRIORITY_ID

    AND J.JOB_ID = L.JOB_ID

    (PERIOD = 'TODAY'

    AND TO_CHAR (L.START_TIME, 'YYYYMMDD') =

    TO_CHAR (REPORT_DATE, 'YYYYMMDD'))

    OR (PERIOD = 'MONTHS' AND TO_CHAR (START_TIME, "YYYYMM") = MONTH)

    OR (PERIOD = 'YEAR' AND TO_CHAR (START_TIME, 'YYYY') = YEAR)

    AND F.FREQUENCY_TYPE <>'NONE'

    AND TRUNC (L.START_TIME) < = TRUNC (REPORT_DATE)

    AND JOB_ID = J.JOB_ID

    UNION ALL

    SELECT J.JOB_ID,

    J.JOB_NAME,

    CASE

    WHEN F.FREQUENCY_SUBTYPE IS NULL, F.FREQUENCY_TYPE

    OF OTHER F.FREQUENCY_TYPE | '-' || F.FREQUENCY_SUBTYPE

    END

    AS FREQUENCY_TYPE.

    L.TRANSACTION_DATE,

    L.PROCESS_DATE,

    START_TIME,

    END_TIME,

    (END_TIME - START_TIME) AS TIME_TAKEN,

    L.RECORD_COUNT,

    L.EXECUTION_STATUS,

    L.ERROR AS ERROR_DESC,

    P.PRIORITY_NUMBER,

    P.COLOR_CODE

    OF POS.JOBS J.

    POINT OF SALE. FREQUENCY F,

    POINT OF SALE. JOB_PRIORITY P,.

    POINT OF SALE. TBK_POS_FACT_LOADING_SUMMARY L

    WHERE F.FREQUENCY_TYPE = 'NONE '.

    AND J.FREQUENCY_ID = F.FREQUENCY_ID

    AND J.PRIORITY_ID = P.PRIORITY_ID

    AND J.JOB_ID = L.JOB_ID

    (PERIOD = 'TODAY'

    AND TO_CHAR (L.START_TIME, 'YYYYMMDD') =

    TO_CHAR (REPORT_DATE, 'YYYYMMDD'))

    OR (PERIOD = 'MONTHS' AND TO_CHAR (START_TIME, "YYYYMM") = MONTH)

    OR (PERIOD = 'YEAR' AND TO_CHAR (START_TIME, 'YYYY') = YEAR)

    AND JOB_ID = J.JOB_ID

    AND TRUNC (L.START_TIME) < = TRUNC (REPORT_DATE)

    END;

    /

    POS PROCEDURAL errors. SP_RPT_GET_JOB_LOG_ON_DEMAND_V:

    LINE/COL ERROR

    -------- -----------------------------------------------------------------

    4/28 PLS-00103: encountered the symbol "(" quand attend un de la) "

    Next:

    := . ), @ % of default characters

    The symbol ': = ' has been replaced by "("pour continuer.) "

    76/1 PLS-00103: encountered the symbol "END" when awaits an of the

    Next:

    . (* % & -+; / TA for rem rest mod < an exhibitor > (*))

    and or group having intersect less order start union where

    connect | multiset

    The symbol ';' was replaced by 'END' continue.

    Thank you and best regards,

    John of Vikash

    Keep in mind, DBMS_OUTPUT is reserved for debugging purposes. If you want the output to a front-end, you can use SYS_REFCURSOR as OUTPUT parameter and get the data of the SELECT query.

  • How to convert number in the Date format

    Hi Experts,

    I have a date column says. date key order number (ex: 20110202). How to convert this number in format DD/MM/YYYY.

    Thanks in advance
    V

    Vincent Krishna wrote:
    Hi Experts,

    I have a date column says. date key order number (ex: 20110202). How to convert this number in format DD/MM/YYYY.

    Thanks in advance
    V

    SQL> select to_char(to_date('20110202','YYYYMMDD'),'DD/MM/YYYY') from dual;
    
    TO_CHAR(TO
    ----------
    02/02/2011
    
  • DateChooser display the current date in the format YYYY/MM/DD on init

    I have two date fields. I would like a date picker to display the current date on the complete creation and the other must show 30 days after the date of the day.

    The format must be YYYY/MM/DD.

    I get currently has the date of the day in a called var currentDate, but she returned to 11 December 2008.

    Thanks in advance.

    I have

    You can use the property formatString, like this:

  • Insert the data; DD/MM/YYYY

    Hello

    Please can someone tell me a method that works in that I can enter the date in my table.

    CREATE TABLE BookCopy)
    BcId VARCHAR2 (5) NOT NULL,
    BtId VARCHAR2 (5).
    DateAcquired DATE,
    DateDestroyed DATE,
    (BcId) PRIMARY KEY,
    FOREIGN KEY (BtId) REFERENCES BookTitle (BtId));

    I tried several ways but can't output the date in the format DD/MM/YYYY simple. Thanks for any help.

    PUMA,

    Something like that

     INSERT INTO bookcopy
    (
        bcid,
        btid,
        dateacquired,
        datedestroyed
    )
    VALUES (
              'ABCD',
              'EFGH',
              TO_DATE (TO_CHAR (SYSDATE - 10, 'MM/DD/YYYY'), 'MM/DD/YYYY'),
              TO_DATE (TO_CHAR (SYSDATE, 'MM/DD/YYYY'), 'MM/DD/YYYY')
           );
    

    concerning

Maybe you are looking for

  • T410i decommissioning of Win 7 x 64 Win 7 x 32

    Hello I have the opportunity to buy cheaply a bestseller (2518-4QG) T410i with Win 7 x 64 preinstalled. Due to software compatibility, I would need to install Win 7 x 32. Is this possible? (Are there drivers available, etc..) How complicated is it to

  • WAG320N &amp; WRT610N

    Hello I try to use WAG320N with WRT610N. 3 computers will access WAG320N using Wi - Fi connection and computer 4-WRT610N (once again using the wireless). I used WRT610N with another modem adsl without configuration, but now it does not work. Users ca

  • Cisco IOS IPSec failover | Route based VPN with HSRP

    I can find the redundancy of vpn IPSec using policy based VPN with HSRP. Any document which ensures redundancy of the road-base-vpn with HSRP?

  • Error 80070002 Windows Update to update 2785094

    Windows 8 Pro x 64 Tonight, I get the error code 80070002 when you try to download the update on KB2785094.  All other updates have been installed without problems. I tried the solutions set out on http://support.microsoft.com/kb/947821 without succe

  • How to get parents given a sheet in a recursive table

    I want to get a list of all parents associated with a sheet in a data table.The table has 3 rows id, description, parent.If I have the id of one of the Articles I want to get all of his parents, is there a way to get it with a select or connect befor