Problem in converting character into date datatype

Hi Experts,
I am developing an oracle function in which I am passing an input in varchar2 and I want the return that varchar value in date datatype.
We are using to_date(to_char(:input,'YYYY-MON-DD')) but this is giving the output in simple format which is defined by the oracle i.e. 'MM-DD-YYYY'.
We need the output in 'YYYY-MON-DD' and that too in date datatype.
I guess you understand my question.
Waiting for your response.
Thanks

i think you understand this :
SQL>  select to_date('2013-06-13','yyyy-mm-dd') from dual;
TO_DATE('
13-JUN-13
SQL> alter session set nls_date_format = 'yyyy-mm-dd';
Session altered.
SQL> select to_date('2013-06-13','yyyy-mm-dd') d  from dual;
D
2013-06-13
SQL> alter session set nls_date_format = 'dd.mm.yyyy';
Session altered.
SQL> select to_date('2013-06-13','yyyy-mm-dd') d  from dual;
D
13.06.2013
SQL> exit
but if you have windows except alter session set you will need to see REGEDIT and Regional parameters.

Similar Messages

  • How to convert string into date datatype

    hi! there
    i've a date in string format like MM/dd/yyyy
    eg:String sDate = "01/30/2002";
    and i want to convert this string format into java date format
    same as 01/30/2002 only
    when i write like this
    SimpleDateFormat formatter = new SimpleDateFormat ("MM/dd/yyyy");
              String sDate = "1/11/2002";
              java.util.Date oDate = formatter.parse(sDate);
    i'm getting the output
    Fri Jan 11 00:00:00 GMT+05:30 2002
    i just want the out put like 01/30/2002
    plz,help me

    Hi,
    Just use back the SimpleDateFormat object you defined.
    String myDateInStr = formatter.format(oDate);
    this will format a java.util.Date object to a string representation according to the format you specified in the instantiation of SimpleDateFormat object.

  • Converting 99999999 to date datatype through sql/ssis

    Hi,
    I am developing an ETL in which we get this column which holds the value 99999999 in one of the columnwhich is of numeric datatype. User wants that field to be date time in destination. Please help me on how to convert that value into date datatype in SSIS.
    Please........

    Thank you Rajen,
    But I have used Collasce to solve this issue.
    COALESCE
    (NULLIF(t1.dtetrm,
    '99999999')
    ,'20991231')

  • How to convert Milliseconds into Date format

    Hi all,
    I am getting the output of a variable in milliseconds format, how can I convert it into date format
    For ex: I am getting input variable as 1366664691000 and I need to convert it to April 22, 2013 5:04:51 PM EDT ( or of SOA format). is there any function for this in XSL or XPath?
    Thanks,

    It is working fine if i test it in provided site...
    But it is returning "-1366664691001", If i am running it in EM. This is the code in my xsl
    <?xml version="1.0" encoding="UTF-8" ?>
    <?oracle-xsl-mapper
    <!-- SPECIFICATION OF MAP SOURCES AND TARGETS, DO NOT MODIFY. -->
    <mapSources>
    <source type="WSDL">
    <schema location="../JavaProcess.wsdl"/>
    <rootElement name="process" namespace="http://xmlns.oracle.com/SampleApplication/JavaEmbeddingActivity/JavaProcess"/>
    </source>
    </mapSources>
    <mapTargets>
    <target type="WSDL">
    <schema location="../JavaProcess.wsdl"/>
    <rootElement name="processResponse" namespace="http://xmlns.oracle.com/SampleApplication/JavaEmbeddingActivity/JavaProcess"/>
    </target>
    </mapTargets>
    <!-- GENERATED BY ORACLE XSL MAPPER 11.1.1.4.0(build 110106.1932.5682) AT [TUE MAY 07 10:21:02 EDT 2013]. -->
    ?>
    <xsl:stylesheet version="1.0"
    xmlns:bpws="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
    xmlns:xp20="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.Xpath20"
    xmlns:mhdr="http://www.oracle.com/XSL/Transform/java/oracle.tip.mediator.service.common.functions.MediatorExtnFunction"
    xmlns:bpel="http://docs.oasis-open.org/wsbpel/2.0/process/executable"
    xmlns:oraext="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.ExtFunc"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:dvm="http://www.oracle.com/XSL/Transform/java/oracle.tip.dvm.LookupValue"
    xmlns:hwf="http://xmlns.oracle.com/bpel/workflow/xpath"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:med="http://schemas.oracle.com/mediator/xpath"
    xmlns:ids="http://xmlns.oracle.com/bpel/services/IdentityService/xpath"
    xmlns:bpm="http://xmlns.oracle.com/bpmn20/extensions"
    xmlns:xdk="http://schemas.oracle.com/bpel/extension/xpath/function/xdk"
    xmlns:xref="http://www.oracle.com/XSL/Transform/java/oracle.tip.xref.xpath.XRefXPathFunctions"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:bpmn="http://schemas.oracle.com/bpm/xpath"
    xmlns:ora="http://schemas.oracle.com/xpath/extension"
    xmlns:socket="http://www.oracle.com/XSL/Transform/java/oracle.tip.adapter.socket.ProtocolTranslator"
    xmlns:ldap="http://schemas.oracle.com/xpath/extension/ldap"
    xmlns:client="client"
    exclude-result-prefixes="xsi xsl bpws xp20 mhdr bpel oraext dvm hwf med ids bpm xdk xref bpmn ora socket ldap">
    <xsl:template match="/">
    <xsl:variable name="lastMTime" select="1366664691000"/>
    <xsl:copy-of select="$lastMTime"/>
    <client:processResponse>
    <client:result>
    <xsl:value-of select='xsd:dateTime("1970-01-01T00:00:00") + $lastMTime * xsd:dayTimeDuration("PT0.001S")'/>
    </client:result>
    </client:processResponse>
    </xsl:template>
    </xsl:stylesheet>

  • How to convert files into DAT?

    Does anyone know how to convert files into DAT? Not The other way around please.

    This might do it:
    http://www.videoconverterformac.com/dat-converter-for-mac.html
    but can't imagine why you would want to!

  • Facing problem in converting string to date using getOANLSServices()

    I am trying to set a value for date field in my vo and trying to insert into the table.
    In controller I am getting the String which has a date:
    ex: String date="01-NOV-2007";
    while setting into the row I need to convert into Date but it is returning null.
    The below code I used
    to convert into date :
    Date dt = new Date(getOADBTransaction().getOANLSServices().stringToDate(date));
    But this dt is returning a null value is there any solution please advise me.
    Regards!
    Smarajeet

    Smarajeet ,
    See this thread, in one of my replies i have mentioned how to convert string to java.sql.date.You can use the same for oracle.jbo.domain.Date.
    urgent!How to set the default selected date for an OAMessageDateFieldBean
    --Mukul                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • How to convert varchar to date datatype while insert or update in table

    Hai All
    I need to convert to varchar to date.
    I have two Tables T1,T2
    T1 Structure
    Code varchar
    Time varchar
    Date varchar
    T2 Structure
    Empname var
    Empcode var
    Intime date
    Outtime date
    Intrin date
    Introut date
    Att_date
    Now i need to move Time form T1 to T2 Intime,outtime,intrin,introut according some condition
    So now i need to convert Varchar to Date while insert or update
    I have tried something
    Insert into T1 (code,intime,att_date)values
    (code,To_date(Date||time,'dd-mon-yyyy hh24mi'),att_date);
    OR While update
    Update T2 set Outtime=To_date(Date||time,'dd-mon-yyyy hh24mi') where...
    I got an error Ora-01861
    Regards
    Srikkanth.M

    You didn't show any example of your date or time values, butyou might need to add a space between them, like
    To_date(Date || ' ' || time,'dd-mon-yyyy hh24mi')

  • How to convert character into numeric

    Pls suggest me how to convert character value into numeric value.

    If you are looking for some FM then
    USE
    CALL FUNCTION 'CHAR_NUMC_CONVERSION'
    EXPORTING
    INPUT = 0
    IMPORTING
    NUMCSTR =
    or use
    Sample code below:
    codeDATA: lv_chr(4) type c,
    lv_num type p.
    CALL FUNCTION 'MOVE_CHAR_TO_NUM'
    EXPORTING
    CHR = lv_chr
    IMPORTING
    NUM = lv_num
    EXCEPTIONS
    CONVT_NO_NUMBER = 1
    CONVT_OVERFLOW = 2
    OTHERS = 3.
    IF SY-SUBRC 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.[/code]
    or USE
    CONVERT_STRING_TO_INTEGER
    or USE THESE FMs
    MOVE_CHAR_TO_NUM
    C14W_CHAR_NUMBER_CONVERSION
    CHAR_NUMC_CONVERSION
    reward if helpful

  • Problem in  Converting String to Date

    Hi All,
    I am having one String
    String date = "2006-01-17 15:19:57.0"
    I want to parse this String into Date object.
    I will really appriciate if somebody helps me out.
    Thanks.

    You're specifying a 'T' and a timezone in your format, but they're not present in the string you're parsing.
    I'm assuming from the way you're printing out the date, that your thinking is along these lines: "sdfInput will parse the input string, no matter what format it's in, and will produce a Date object. That Date object wil have the format specified in sdfInput."
    This is wrong on a couple of fronts:
    1) DateFormat doesn't magically figure out what format it's supposed to use for the String it's parse()ing. The String has to match the DF's format.
    2) Dates don't have formats. Only Strings do. A Date object is just a long. There's no relationship whatsoever between the Date that you get from parse() and the format that was used to produce it. When you print out a Date as you're doing, its toString method is called, which in turn uses a default format for your Locale.
    If you want to turn a date string in one format into a date string in another format, use two different DateFormat objects with two different formats. Date date = df1.parse(inputString);
    String outputString = df2.format(date);

  • Problem in converting AppleWorks into RTF

    Hi!
    I have a bunch of .cwk files (AppleWorks) that I need to convert into RTF format.
    In the script I use I have a proble with the following code:
    tell application "AppleWorks"
    activate
    open MonFichier
    save MonFichier in file (dossier & name_Fich & ".rtf") as file type "RTF" using translator "RTF"
    close MonFichier saving no
    end tell
    After execution I end up with a brand new file with .rtf extension but that is not a RTF file. If I try to open it with Textedit it does not open. Strangely enough, if I open the cwk file manually and save it as RTF manually, everything is fine....
    Can someone help me on this?
    Pascal

    Hello Pascal,
    I think you're seeing the known problem of AppleScript 2.0 used with some old program such as AppleWorks 6.
    Briefly, AW6's translator name parameter must be in plain string not Unicode text while all text literal is Unicode text in AppleScript 2.0.
    A workaround is to use data literal of class TEXT. Something like the following code.
    --CODE
    tell application "AppleWorks 6"
    open MonFichier
    tell document 1
    save in file (dossier & name_Fich & ".rtf") using translator «data TEXT525446» -- "RTF"
    close saving no
    end tell
    end tell
    --END OF CODE
    cf.
    A relevant topic:
    Script failing to translate AW to DOC
    http://discussions.apple.com/thread.jspa?threadID=1650891&tstart=0
    Hope this may help,
    Hiroto

  • Problem in converting english into spanish

    In one of our POC i need to create a custom workflow and calling it from HTML page.
    I did that by making a self registration workflow and put it under "..user/anonlogin.jsp"
    and then by some minimal customization i called it using link referrence "http://localhost:8080/idm/user/anonProcessLaunch.jsp?id=Self+Registration"
    it is working fine
    Now my problem is that i need to show the form according to the language store in the user session from HTML page.
    Now when i first go to "http://localhost:8080/idm/user/login.jsp" and then go to self registration page it converts the whole page into desired language preferrence but when i directly hit the url "http://localhost:8080/idm/user/anonProcessLaunch.jsp?id=Self+Registration" it doesn't convert my English language into spanish language which i hardcoded into process launch.jsp using
    form.setPostURL(response.encodeURL("user/anonProcessLaunch.jsp?lang=es " + "&cntry=US"));
    Please suggest the alternate way or where me miss in my way .
    Thanks a lot

    Ok , that is clear the customer has another query. He is trying to convert a pdf Arabic file into word formate but it is showing arabic font which is not in a proper form.i am attaching the print screen .

  • How to convert string into date

    Hi all,
    I m new to JDeveloper
    I m taking the date as a string then passing it as a string in the method.
    I want to convert tht string into the date of format (DD-MON-YYYY) or any other format
    require yur assistance in this job.
    THANKXX in advance
    ankit

    Is this what you are looking for:
    java.text.SimpleDateFormat formatter = new java.text.SimpleDateFormat("dd-MMMMM-YYYY");          
    java.util.Date date1 = null;
    try
       date1 = formatter.parse("Thu Jun 3 09:09:30 2004");
    catch(Exception e)
       e.printStackTrace();
    System.out.println("Date1 in millis : " + date1.getTime());
    System.out.println("Date1 in string : " + date1);
    java.util.Date date2 = new java.util.Date(date1.getTime());
    System.out.println("Date2 in string : " + date2);or look at http://java.sun.com/j2se/1.4.2/docs/api/java/text/SimpleDateFormat.html for more options

  • Audio problem when converting iMovie09 into FCE

    I originally converted analog tapes to digital and captured video/audio into iMovie 09. This worked well
    When then exporting via .xml and importing into FCE, the video portion worked well, but the audio portion is barely audible. Even when I turn the volume all the way up and use the decibel adjustments, the audio is hard to hear
    What should I do?
    Thanks for any help on this question
    Ron

    Tom -- the original analog tape was 8mm, recorded on a Sony Camcorder. In iMovie-09, I don't have any problem after having converted the analog tape to DV. It's becomes a problem (buzzing sound) when it export via XML into FCE4.0.1

  • Problem in Converting Database into Archivelog mode (Oracle 10G)

    Hi Team,
    I come across a strange problem in the ORACLE 10G Server.
    I am converting database mode from NoArchivelog to Archivelog mode through RMAN in 10G.
    Now When I execute these following commands through RMAN prompt it works properly as shown below?
    C:\>rman
    Recovery Manager: Release 10.2.0.1.0 - Production on Thu Nov 30 18:01:08 2006
    Copyright (c) 1982, 2005, Oracle. All rights reserved.
    RMAN> connect target /
    connected to target database: RAVI (DBID=4025722893, not open)
    RMAN> shutdown immediate;
    using target database control file instead of recovery catalog
    database dismounted
    Oracle instance shut down
    RMAN> STARTUP MOUNT;
    connected to target database (not started)
    Oracle instance started
    database mounted
    Total System Global Area 167772160 bytes
    Fixed Size 1247876 bytes
    Variable Size 79693180 bytes
    Database Buffers 79691776 bytes
    Redo Buffers 7139328 bytes
    RMAN> SQL 'ALTER DATABASE ARCHIVELOG';
    sql statement: ALTER DATABASE ARCHIVELOG
    RMAN> ALTER DATABASE OPEN;
    database opened
    RMAN>
    But this same script when i writes in the backup.ora file & pass to Rman prompt it fails,
    File backup.ora contains...
    run
    SHUTDOWN IMMEDIATE;
    STARTUP MOUNT;
    SQL 'ALTER DATABASE ARCHIVELOG';
    ALTER DATABASE OPEN;
    passed to RMAN as follows...
    C:\OracleCode\BACKUP>"C:\oracle\product\10.2.0\db_1\bin\RMAN.EXE" target /"connect target SYSTEM/sreedhar@RAVI" log="C:\ORACLE~2\LOGS\backup_log.log" append cmdfile="C:\ORACLE~2\BACKUP\backup.ora"
    RMAN> 2> 3> 4> 5> 6> 7> 8>
    then it fails giving the following errors...
    using target database control file instead of recovery catalog
    database closed
    database dismounted
    Oracle instance shut down
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03002: failure of startup command at 11/30/2006 18:05:59
    ORA-12514: TNS:listener does not currently know of service requested in connect descriptor
    Recovery Manager complete.
    The same thing is working in the Oracle 9i but not in the Oracle 10G.
    Can Anybody plz help me in this?
    Regards,
    S.Tiwari
    .

    export ORACLE_SID=<SID>
    rman target /cmdfile="C:\ORACLE~2\BACKUP\backup.ora"
    it will connect to the default SID, there's no such thing as a default SID, what do you mean?
    But what if there are more that one SID available & I
    want to connect to SID other than the default SID.just specify the desired SID prior starting rman.
    more over the same string is working with 9i but not
    with 10G.maybe due to a bug?
    to summarize, you have two options it you would like to start up the instance:
    either you specify the SID prior starting rman and use os authentication
    or
    you register the instance statically and use oracle authentication.
    regards,
    -ap

  • Garageband volume problem after converting project into mp3 formats

    Every time after I convert my music project into MP3 by clicking "send song to i-tune" in GarageBand, the volume of the music always come out to be softer than the original project before its been converted. Is there something I could do to fix that or to boost up the volume after I convert it?

    Boattt wrote:
    Is there something I could do to fix that or to boost up the volume after I convert it?
    http://www.bulletsandbones.com/GB/GBFAQ.html#exportvolumetoolow
    (Let the page FULLY load. The link to your answer is at the top of your screen)

Maybe you are looking for

  • Cat TimesheetData dropdown doesn't refresh

    Hi Expert, In Cat WD application , we have a cell Absence use dynamic dropdown UI. when we click on the calendar, the timesheet data is refreshed, but not the dropdown list. Any idea ? thanks. Ben.J.

  • Automatic Login to Network problems!

    I have a 3 Mac network. They are connected to a gigabit switch that is attached to a gigabit Airport Extreme. My problem is that I want to have my computers automatically log in to my shared NAS drive when they startup in the mornings (they are on a

  • Some questions about sharing resources, eg via dropbox...

    Experts- I see that one way to share all topics with another RH user is to open the Topics List pod, select all topics, then drag the lot to Resource Manager (eg, the Dropbox folder therein). Is there a way to add images and other non-topic files in

  • External Storage over Wireless ?

    My new MacBook Pro will arrive in two days. It is configured with OS -X Also, the AirPort Wireless Router arrives then. I wish to be able to store files over the home wirelss net. What External Device could I use, likely in the 200gB range, that I co

  • Launching an AIR app from another (when offline)?

    I have a pair of AIR applications that are meant to work together as part of an application suite. One feature is that a user should be able to click a button in APP_1 and launch APP_2 (if installed). To do this I created a "LaunchButton.swf" that lo