How to convert  Oct 12, 2005 03:25:57 PM IST into date type using To_Date

Hi Friends,
I am converting following string to date format in oracle 8i
TO_DATE('Oct 12, 2005 03:25:57 PM IST','Mon DD, YYYY HH24:MI:SS AM TDZ') from Dual,
But it is throwing
ORA-01820: format code cannot appear in date input format error.
Anybody help!!!
Regards
Shameem

Hi,
ORA-01820 format code cannot appear in date input format
Cause: A date specification contained an invalid format code. Only the following may be specified when entering a date: year, month, day, hours, minutes, seconds, Julian day, A.M./P.M. and B.C./A.D.
Action: Remove the invalid format code from the date specification.
This one works (if the input string always has the same length / format):
TO_DATE(substr('Oct 12, 2005 03:25:57 PM IST',1,21),'Mon DD, YYYY HH24:MI:SS')
Regards,
Gerd
P.S. Sorry, of course we have to take care of the P.M.:
TO_DATE(substr('Oct 12, 2005 03:25:57 PM IST',1,24),'Mon DD, YYYY HH:MI:SS PM')
Regards,
Gerd
Message was edited by:
[email protected]

Similar Messages

  • How to convert mm/dd/yy to dd/mm/yy in ABAP PROGRMS without using offsets

    how to convert mm/dd/yy to dd/mm/yy in ABAP PROGRMS without using offsets

    Do this way..
    data: lv_date(8)   type c.
    write sy-datum to lv_date DD/MM/YY.
    or
    write:/ sy-datum using edit mask '__/__/__'
    Regards,
    Santosh
    Message was edited by:
            Santosh Kumar Patha

  • How to get the values from struct data type using java code..?

    Hi ,
    I am newer to java.
    we are using oracle database.
    How to get the data from struct data type using java code.
    Thanks in Advance.
    Regards,
    kumar

    Hi Rajeev,
    To retrieve a FilterContainer you will need to traverse the report structure:
    ReportStructure boReportStructure = boDocumentInstance.getStructure();
    ReportContainer boReportContainer = (ReportContainer) boReportStructure.getReportElement(0);
    FilterContainer boFilterContainer = null;
    if (boReportContainer.hasFilter()) {
         boFilterContainer = boReportContainer.getFilter();
    } else {
         boFilterContainer = boReportContainer.createFilter(LogicalOperator.AND);
    Calling boDocumentInstance.getStructure() will retrieve the entire structure for the document.
    Calling boReportStructure.getReportElement(0) will retrieve the structure for the first report of the document.
    Hope this helps.
    Regards,
    Dan

  • How to convert PM Module Breakdown Duration (AUSZT) floating point value into Minutes

    Hi Frnds,
    My requirement is to display a normal alv report. Out of which one of the filed is from VIQMEL-AUSZT (Breakdown Duration).
    Which is of Data type FLTP.
    Details:
    AUZTV
    AUZTV
    TIMS
    6
    Start of Malfunction (Time)
    12:39:19
    AUZTB
    AUZTB
    TIMS
    6
    End of Malfunction (Time)
    12:42:00
    AUSZT
    AUSZT
    FLTP
    16
    Breakdown Duration
    1.6100000000000000E+02
    Now I want to convert the value '1.6100000000000000E+02' into Minutes.
    Kindly let me know the solution.
    Note: I tried with standard FM 'PM_TIME_CONVERSION' and converted the break down value into hours.
    For example: 1.6100000000000000E+02 to 4,472222222222222E-02.
    But i want to convert the break down duration value into perfect minutes.
    With Regards,
    Sudhir.

    Simply equate to a variable of type P decimals zero. It should give you value in seconds. Divide it by 60 to have it in minutes.

  • How can I retrieve a LONG data type using ADO

    In VB I am using an ADODB object to retrieve data from an Oracle table that has a LONG data type column...
    specifically: SELECT TRIGGER_BODY FROM USER_TRIGGERS WHERE TRIGGER_NAME = 'MYTRIGGER'
    I have tried using the GETCHUNK method but it only returns the first 150 or so characters no matter how
    many times I call it???? here is the sample code I'm using........
    Dim Cn As ADODB.Connection, Rs As ADODB.Recordset, SQL As String
    Dim sChunk() As Byte
    Set Cn = New ADODB.Connection
    Set Rs = New ADODB.Recordset
    Cn.CursorLocation = adUseServer
    Cn.Open "Provider=OraOLEDB.Oracle.1;Password=hrzadmin;Persist Security
    Info=True;UserID=hadmin;Data Source=xxx.local"
    SQL = "SELECT trigger_body from user_triggers where trigger_name = 'MYTRIGGER'"
    Rs.Open SQL, Cn, adOpenStatic, adLockReadOnly
    Debug.Print Rs!trigger_name
    Debug.Print Rs!trigger_body
    sChunk = rs.Fields("trigger_body").GetChunk(500)
    Debug.Print sChunk

    I have a similar code which works for chunk size >400,
    The image I am trying to retrieve is huge so the chunksize is also more.
    Did you try with any non meta table?
    For your reference I am pasting my application code below.
    Hope it helps.
    --Jagriti
    Private Sub cmdGetImage_Click()
    Dim bytchunk() As Byte 'variable to store binary data
    Dim destinationFileNum As Integer 'variable for filenumber
    'recordset for fetching Product Image for the product selected form the list
    Dim recProductImage As New ADODB.Recordset
    Dim offset As Long
    Dim totalsize As Long
    Dim roundTrips As Long
    'variables used in calculation of time taken to fetch the image
    Dim startTime As Currency, EndTime As Currency, time As Currency, Freq As Currency
    Dim i As Integer 'counter variable
    i = 0
    On Error GoTo ErrorText 'redirect to error handler
    '** Step 1 **'
    'validating if product is selected from the list
    If cboSelectProduct.Text = "" Then
    MsgBox "Select product from the list!"
    Exit Sub
    End If
    '** Step 2 **'
    'validating if "optChunk" optionbox is selected then
    '"txtChunksize" textbox should contain a value
    If optchunk.Value = True Then
    'validate if chunksize value is null
    If txtChunkSize.Text = "" Then
    MsgBox "Enter value for chunksize "
    Exit Sub
    End If
    'validating that the chunk size entered should be a positive value
    If CInt(txtChunkSize.Text) < 1 Then
    MsgBox "ChunkSize value should be positive!"
    Exit Sub
    End If
    End If
    '** Step 3 **'
    'open image column from product_information table using m_Oracon connection
    recProductImage.Open "SELECT product_image FROM product_information " & _
    " WHERE product_id =" & cboSelectProduct.ItemData(cboSelectProduct.ListIndex) _
    , m_Oracon, adOpenStatic _
    , adLockOptimistic, adCmdText
    'check if product image exists for the product selected
    If Not IsNull(recProductImage!product_image) Then
    'setting mouse pointer on the form "frmChunkSize" to wait state
    frmChunkSize.MousePointer = vbHourglass
    '** Step 4 **'
    'assigning "desitinationFileNum" variable to next file number
    'available for use
    destinationFileNum = FreeFile
    'allocates a buffer for I/O to the temporary file "tempImage.bmp"
    'at the current application path
    Open App.Path & "\tempImage.bmp" For Binary As destinationFileNum
    '** Step 5 **'
    'Get the frequency of internal timer in Freq variable
    QueryPerformanceFrequency Freq
    'start the timer
    QueryPerformanceCounter startTime
    'clear "imgProduct" imagebox
    imgProduct.Picture = LoadPicture("")
    '** Step 6 **
    If optValue.Value = True And optchunk.Value = False Then
    '** Step 7 **
    'using ADO Value property
    bytchunk = recProductImage("product_image").Value
    'appending byte arrary data to the temporary file
    Put destinationFileNum, , bytchunk
    'displaying "No. of Round Trips" in a label to 1
    lblRoundTrips = 1
    ElseIf optchunk.Value = True Then
    '** Step 8 **
    'converting the value entered "txtChunkSize" textbox to long
    'and assigning it to chunksize variable
    m_chunksize = CLng(txtChunkSize.Text)
    'assigning the actual size of the image retrieved to a variable
    totalsize = recProductImage("product_image").ActualSize
    'calculating and assigning the "No. of Round Trips" to a variable
    roundTrips = totalsize / m_chunksize
    'in case fragment of data left, incrementing roundtrips by 1
    If (totalsize Mod m_chunksize) > 0 Then
    roundTrips = roundTrips + 1
    End If
    'In this loop the image is retrieved in terms of chunksize
    'and appended to the temporary file
    Do While offset < totalsize
    '** Step 9 **
    'retrieving product_image from the recordset, in chunks of bytes
    bytchunk = recProductImage("product_image").GetChunk(m_chunksize)
    offset = offset + m_chunksize
    'appending byte arrary data to the temporary file
    Put destinationFileNum, , bytchunk
    Loop
    'displaying "No. of Round Trips" in a label
    lblRoundTrips = roundTrips
    End If
    '** Step 10 **'
    'stop the timer after image retrieval is done
    QueryPerformanceCounter EndTime
    'close the opened file handle
    Close destinationFileNum

  • How to sync the album and track info that I entered into a CD using iTunes with the actual disc?

    Hello,
    I recently recorded some cover songs, and I imported them into iTunes. So, after entering the track info (track names and album art) into each track using "Get Info", I burned them to a CD. I was completely shocked that the track info and album artwork did not get inputted onto the CD. So, I entered the track info, but could not add the album artwork.
    How to add the album artwork is not as important a question. But it's one of my 2.75 questions.
    My other issue is that the info that I put on the CD using iTunes is only visible within iTunes. Therefore, I cannot get the track names elsewhere.
    My 2.5 questions are:
    1) How do I get the track and album info to display in Windows Explorer and Windows Media Player (and the touchscreen CD Player in the car)?
    2) How do I add digital album artwork to the CD (so that it shows on the touchscreen CD Player in the car - if iPods have the artwork and it shows on the car's screen, a CD should be able to show the artwork on the car's screen, when talking about limitations of the car)
    2.5) How do I make that artwork display across everywhere I plug that disc into?
    2.75) How do I ensure that when others import my CD, my artwork, track names, and album name also import from the CD?
    I have already burnt the CD, so I would prefer a way to tweak the properties of the already burnt CD rather than burning a whole new disc.
    Thank you!
    -Royce

    1) Metadata visibility in Windows Explorer and/or Windows Media Player depends on OS version and file type. The mp3 format has the widest support. As for the touchscreen CD Player in your car who can say? If it can play data discs the results will be better than with audio CD. If it can display CD text then this option should be selected when creating an audio CD.
    2) Artwork cannot be attached to the tracks on an audio CD. If your car system supports it all then it will be with data discs. Check the specifications of the system for the media types it can support on a data disc.
    2.5) Simply ensure the artwork is embedded in the tag.
    I have two scripts that can help with this, CreateFolderArt and EmbedFolderArt.
    The scripts have a slightly different purpose.
    CreateFolderArt ensures that every album folder ends up with a Folder.jpg image which is the art that iTunes already knows about. Side effects are that if artwork has been updated in iTunes the folder art should be updated also, and if any track from the album doesn't have embedded artwork it gets embedded.
    EmbedFolderArt was actually written for someone who already had various artwork images stored in the folders and wanted them added to their tracks, but not if iTunes had already downloaded a better quality image.
    2.75) Again, use a data disc format. Note that you should not be giving away copies of copyrighted material.
    Audio CDs are finalized, you cannot change any properties of them unless they are on rewritable media in which case you can erase the whole disc and start over.
    tt2

  • How to change existing terminals from "view as icon" to view as data type through program

    I got some legacy LabVIEW code from other people. And there are tons of existing terminals displayed as icon. Is there any way to do batch process to change all of them to view as data type?
    Thanks a lot!
    Solved!
    Go to Solution.

    If you have a VI in 2010, you can save it as far back as 8.0.  There is a thread on this forum dedicated to downconvert requests (and on for upconvert, as well).  So post your VI there, and it will probably be converted quickly.
    Scripting has existed in LabVIEW since about version 5.1.  It was created to support scripting LabVIEW code in products such as the DAQ Assistant and Motion Assistant.  The first product to use this technology was the Vision Assistant.  However, the early versions are very primitive with limited or no support for common functions (e.g. Delete).  Usually, support was added when it was needed for a project.  Scripting took a huge leap in quality when LabVIEW 7.0 was released, since it is used behind the scenes to generate the code for Express VIs (which were introduced in 7.0).  Scripting steadily improved in quality and features until it was released to general use in LabVIEW 2009.  We are still working to expose all the development time functionality.
    Take home message is that you can downconvert your VI, but there is no guarantee that the functionality you have in LabVIEW 2010 will exist in 7.1.  While this is true in general, it is especially true of scripting functions.
    This account is no longer active. Contact ShadesOfGray for current posts and information.

  • How to create a generic stack (whose elements can be of any data types) ???

    How do you define a "Stack" class that takes the Data type as its constructor argument ,and creates a new instance of that stack type ??? e.g. Stack("double") should create a stack of doubles ,and so on...
         Putting it in another way, how do you go about defining a Stack ,if you are not sure what data types will be pushed into it at runtime ??? Making a Stack of Objects doesn't seem the appropriate choice since, in that case also, you won't be sure of which of the "parseInt(),paresDouble(),Integer(),Double() etc." functions to retrieve the value.

    Write your own stack class which delegates push and pop calls to an internal instance of the java.util.Stack. In addition the class has an attribute of type Class. When the push method is invoked the object in the argument will be tested whether it is an instance of the class stored in the type attribute. If not an IllegalArgumentException should be thrown.
    Here is the minimal code for such a type-save stack (the main method shows its usage):
    import java.util.Stack;
    public class TypeSaveStack {
        private Stack _stack = new Stack();
        private Class _type;
        public TypeSaveStack(Class type) {
            _type = type;
        public void push(Object element) {
            if (_type.isInstance(element)) {
                _stack.push(element);
            } else {
                throw new IllegalArgumentException(element
                                  + " is not an instance of " + _type);
        public Object pop() {
            return _stack.pop();
        public static void main(String[] args) {
            TypeSaveStack doubleStack = new TypeSaveStack(Double.class);
            doubleStack.push(new Double(Math.PI));
            System.out.println(doubleStack.pop());
            try {
                doubleStack.push("foo");
            } catch (Exception e) {
                System.out.println(e);
    }

  • How to read varbinary data type using sql server

    Hello,
         I'm converted a text file data into varbinary format, and stored in DB table. Now I need to read
    Varbinary column and store in Temp table
    in sql server.
     can some one help on this.
    Regards,
    Praven
    Regards, Praveen

    I understand this question is related to your previous thread and I believe what Erland suggested is the best way to implement this.
    https://social.msdn.microsoft.com/Forums/en-US/a96a8952-0378-4238-9d9d-85b053182174/send-direct-text-file-as-a-input-parameter-to-sp?forum=transactsql
    I believe when the user uploads the data its getting uploaded onto the Application Server, You could then open the file and import the files into SQL server(all using application code) and do the manipulations. I believe this is the better way of handling
    this.
    Also what is the expected file size and what is the kind of data you are expecting?
    Satheesh
    My Blog | How to ask questions in technical forum

  • How can i re-enable/restore a disabled iPad and keep the data without using a laptop or iCloud

    Hello,
    Is there a way to re-enable a disabled iPad and maintain the data taking into consideration that no iCloud backup was made and the computer it was last synced with was not available? any idea?

    No, sorry.  Without a backup in iCloud or iTunes, you will have to set it up as if new and anything on it will be lost now.
    You can always re-download purchased apps and content (other than audiobooks) once it is restored, from the respective iTunes or App stores.

  • How to Drag a image from a folder and drop it into Photoshop, InDesign using keyboard?

    Hi!
    Others may think silly about this question but the reality is I have to drag and drop several images into InDesign from a folder each one by one. Is it possible to drag and drop images from desktop (folder) to Adobe InDesign, Photoshop, etc?
    Thanks!
    Hope a positive reply.

    Thanks Peter/Jongware
    I searched Google and found the link below but became unable to use 'drag and drop'
    http://www.knowledgesutra.com/forums/Keyboard-Mouse-t49017.html
    I'm using Windows 7 Ultimate.
    Thanks.

  • How to convert String to date ? - MS access

    I want to convert a string "10-10-08" [ MM-dd-yy ] into date type in same format to use that in query statement [MS Access].
    In table , I am using field called "date" with "MM-dd-yy" format.
    Example:
    <%@ page import= "java.sql.*"%>
    <%@ page import="java.text.SimpleDateFormat"%>
    <%@ page import="java.util.Date"%>
    <%
    String d="10-9-08";
         SimpleDateFormat dateFormat = new SimpleDateFormat("MM-dd-yy");
              Date date = dateFormat.parse(d);
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
         Connection con = DriverManager.getConnection("jdbc:odbc:bspipdb");
         Statement st = con.createStatement();
    ResultSet rs=st.executeQuery("Select * from datacollectdb where date='"+date+"'");
    %>
    I am getting "java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Data type mismatch in criteria expression.
    " error.
    How to use the string "10-10-08" in where statement?

    sangee wrote:
    I want to convert a string "10-10-08" [ MM-dd-yy ] into date type in same format to use that in query statement [MS Access].
    In table , I am using field called "date" with "MM-dd-yy" format.I think a column named "date" is a very bad idea. Not just because "date" is a keyword. It's not very self-describing. How about "birth_date" or "hire_date" or "went_on_my_first_date"?
    Example:Scriptlets? There's your second mistake.
    <%@ page import= "java.sql.*"%>
    <%@ page import="java.text.SimpleDateFormat"%>
    <%@ page import="java.util.Date"%>
    <%
    String d="10-9-08";The way you're doing things, "2-40-99" is a valid date. Is that what you want?
         SimpleDateFormat dateFormat = new SimpleDateFormat("MM-dd-yy");
              Date date = dateFormat.parse(d);
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
         Connection con = DriverManager.getConnection("jdbc:odbc:bspipdb");Wrong again. Better to use a PreparedStatement and bind that Date.
         Statement st = con.createStatement();
    ResultSet rs=st.executeQuery("Select * from datacollectdb where date='"+date+"'");
    %>
    I am getting "java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Data type mismatch in criteria expression.
    " error.
    How to use the string "10-10-08" in where statement?Use PreparedStatement and bind.
    Your JSP should not be getting a database connection. Pool it.
    Your code is wrong on every level. You don't close resources, you don't separate you app into layers, your database code is not in a POJO. I'd recommend that you throw this away and start again.
    %

  • How do I convert .pdf into searchable OCR using Adobe Acrobat Capture 3.0?

    How do I convert .pdf into searchable OCR using Adobe Acrobat
    Capture 3.0?
    Our division is digitizing it's files, and we've been using
    Adobe Acrobat 5.0 (2). We've 'scanned-in' several hundred
    documents, but they have been saved as .pdf files (which are
    currently not 'searchable', as they are only scanned images).
    We just received the Adobe Acrobat Capture 3.0 program, and
    we were told that we would be able to scan-in any new documents and
    save them both as .pdf and OCR documents (Optical Character
    Recognition). Therefore, we were told, we would be able to search
    through the body of the document, using OCR, and not just through
    the document filename, as we had been doing before.
    HOWEVER, we don't know how to use this new OCRing program.
    Also, we don't know how to convert the .pdf documents which we've
    already scanned into OCR recognizable documents.
    Is someone able to assist us here in this forum?
    Merci beaucoup / Shokran jazilan / Thank you very much!
    - Michael Kim Jamal Riegelman
    United Nations Headquarters
    Department of Peacekeeping Operations
    Europe and Latin America Division
    Office: (917) 367.9186
    Email: [email protected]

    Hi Michael
    Unfortunately I believe you have posted your issue in the
    wrong forum. I believe you are looking for the forum linked below.
    http://www.adobeforums.com/cgi-bin/webx/.ef7cbdf/
    You might try re-posting your issue there.
    Cheers and good luck! Rick

  • How to convert time stamp to time in update rule

    Anybody know how to convert time stamp to time only?  Any FM that I can use?
    time stamp example
    20010203100201
    Result:
    10:02:01
    Thank
    Sudree

    Please search the forum

  • How to convert following ABAP routine into Java

    Hi Experts
    I m new to IPC
    How to convert following ABAP routine int java
    READ TABLE XKOMV INTO XKOMV_AUX WITH KEY
                 KSCHL = 'ZCU2'
                 KPOSN = komp-kposn.
      IF SY-SUBRC EQ 0.
        MOVE XKOMV_AUX-KWERT TO XKWERT.
        MOVE XKOMV_AUX-KBETR TO XKOMV-KBETR.
            w_kwert = xkomv_aux-kwert * -1.
    DO any one has documentation on convertion of abap routines into java
    Thanks & Regards
    Sowmya

    Hi sowmya,
    download this document through this u can solveur problem
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/107adc1a-0501-0010-de8e-973e0fb4049b
    Reward if helps
    Regards
    Manohar

Maybe you are looking for