with problems of casting timestamp to date

Hello

So here's what I have... I have a timestamp in my database and I need to return it as a date (because what used to work in WL8.1 now gives me a java.lang.IllegalArgumentException: could not convert this to java.sql.Date in WL10). If I change my query as follows:

I'm not running my old query to get a sample:
Select col_key, col_time, col_other
FROM table1 where col_key = "a".

... and I get to col_time * January 11, 2013 1:18:04.354261 PM'*... well.

So, I take this value and I proceed as follows to test my format:

Select CAST (to_timestamp (January 11, 2013 1:18:04.354261 PM', ' DD/MM/YYYY HH:MI:SS.ff PM') AS DATE) double;
works perfectly, returns the date: 11/01/2013 13:18:04


In view of the foregoing I apply to my old query:
Select col_key, CAST (to_timestamp (col_time, ' MM/DD/YYYY hh:mi:ss.ff PM' ") AS DATE), col_other
FROM table1 where col_key = "a".

and I get a "ORA-01858: a non-digit character was found here where was waiting for a digital".

... where am I wrong?

Thank you

Martel wrote:
Yes, it's a timestamp column...

So okay, this is how I read online that I could convert a timestamp into date of...

Well, what you are trying to convert a string to a timestamp and then convert the timestamp to date. That works, if you pass a string.

If this is not the case... then how to return a timestamp as a date column?

I already showed you in my sample code!

I tried to_date but there is no formatting for milliseconds so why everyone suggests to_timestamp... and if this does not work then what can I do? WL10 convert timestamps java.sql.Date, so I need the request to give him a Date instead of a timestamp.

Tags: Database

Similar Questions

  • Strange problem casting between the DATE and time STAMP

    Hello world

    I'm faced with a problem of strange casting between the DATE and time STAMP. Strange, because this happens in SQL-Developer and the Testdatabase, but not when called from inside SQL-Plus, even if all Session settings are set to the top completely equal.

    I work on the Oracle 11 g Enterprise Edition Release 11.2.0.1.0 Windows database and run the following script, taken from SQL-Developer script output:

    < pre >
    create table ts_test)
    time/date stamp,
    stamp_copy timestamp)
    table TS_TEST standing.

    create or replace view vw_test as
    Select cast (date stamp) buffer,
    Cast (stamp_copy as date) stamp_copy
    of ts_test
    view VW_TEST standing.

    insert into ts_test
    Select systimestamp, the double null
    1 eingefugt Zeilen.

    Commit
    festgeschrieben.

    create or replace trigger trg_ts_test_iu
    instead of update on vw_test
    Start
    Update ts_test
    Set stamp_copy =: new.stamp_copy;
    end;
    RELAXATION trg_ts_test_iu kompiliert

    Update vw_test
    Set stamp_copy = stamp
    1 Zeilen written on.

    Select the stamp, stamp_copy, dump (stamp_copy)
    of ts_test
    STAMP STAMP_COPY DUMP (STAMP_COPY)
    -----------------------------------------------------------------------------------------------------------------
    30.05.2012 19:08:49, 218000000 30.05.3192 20:09:50, 000000000 Typ = 180 Len = 7: 131,192,5,30,21,10,51

    Select *.
    of nls_session_parameters
    VALUE OF THE PARAMETER
    ----------------------------------------------------------------------
    NLS_LANGUAGE GERMAN
    NLS_TERRITORY GERMANY
    NLS_CURRENCY €
    NLS_ISO_CURRENCY GERMANY
    NLS_NUMERIC_CHARACTERS.
    NLS_CALENDAR GREGORIAN
    NLS_DATE_FORMAT exact hh24:mi:ss
    NLS_DATE_LANGUAGE GERMAN
    NLS_SORT GERMAN
    NLS_TIME_FORMAT HH24:MI:SSXFF
    NLS_TIMESTAMP_FORMAT JJ. MM YYYY HH24:MI:SSXFF
    NLS_TIME_TZ_FORMAT HH24:MI:SSXFF TZR
    NLS_TIMESTAMP_TZ_FORMAT JJ. MM YYYY HH24:MI:SSXFF TZR
    NLS_DUAL_CURRENCY €
    BINARY NLS_COMP
    NLS_LENGTH_SEMANTICS TANK
    NLS_NCHAR_CONV_EXCP FAKE

    17 Zeilen offiziell

    Rollback
    Rollback abgeschlossen.
    < / pre >

    Look at the strange data that stamp_copy was after the update.

    When run from SQL over, everything is fine. But when I run this code in our application, the same phenomenon occurs. I've even seen a data dating back to the year 11907 (!), giving an exception by selecting from the table.

    Someone at - it an idea on how to work around this bug?

    Best regards

    Jürgen

    Did you check metalink for bugs?

    There are a few listed in this blog, that may be useful for you.

    http://hoopercharles.WordPress.com/2011/02/17/strange-timestamp-behavior/

  • problem with the creation of my usb data card connect to a wifi hotspot network!

    Hello, I have g62005ax machine of hp pavilion and the use of windows 7 home basic service 1 since I bought it, I map of 3g data through which I use internet on my laptop, recently I had a phone android romaric mi3 and wanted to use the net to my data card 3 g on phone via my laptop by creating my cell phone as a wifi hotspot I tried connectify and virtual wifi router and mhotspot, enable me to create a hotspot wifi successfully, my phone can identify them and even be able to connect to the wifi network but I can not surf or download in the phone no matter what app or browser, phone says connected wifi network and phone receives the data as 0.15 0.58, 0.98 KB. My card data speeds work fine on pc on 1 MB/s with no problems, but what is wrong I am doing even after the connection is established?  As I said I tried different pc applications, given that my phone might have problem then I tried another star of the Galaxy samsund phone pro, it also connects to the wifi network but the same problem, IE. No surf, the so problem is not end of my phone, what am I doing wrong here?

    Hello IRON-MAN.

    Thanks for posting on the HP Forums!

    I understand the hotspot of data card USB that you create from your laptop is not working properly. I'll do what I can to help out you! Please follow this guide to make sure that you follow the correct procedures: How to create a WiFi HotSpot with your connection Internet/card USB Data...

    Please let me know your results. If you're still having problems, please provide some screen shots so I have something to look at. Thank you and have a great day!

    Mario

  • Im having a problem with your security software.  Your data bass must be bad, now I can't have spent my address question.  Ive answered all questions to the best of my knowledge and software has always said that my answers are incorrect

    Im having a problem with your security software.  Your data bass must be bad, now I can't have spent my address question.  Ive answered all questions to the best of my knowledge and software has always said that my answers are incorrect

    Hello Bernard,.

    You sign a document that has authentication based on knowledge, applied in it? If so, and if you can't go to questions, then you will need to contact the sender of the document because they can remove it and return you the document. You can respond directly to the e-mail received esign and happens directly from the sender.

    Kind regards

    -Usman

  • Trinidad Apache runs with control of activated timestamp.

    Experts,

    My web.xml file content
     <context-param>
        <description>If this parameter is true, there will be an automatic check of the modification date of your JSPs, and saved state will be discarded when JSP's change. It will also automatically check if your skinning css files have changed without you having to restart the server. This makes development easier, but adds overhead. For this reason this parameter should be set to false when your application is deployed.</description>
        <param-name>org.apache.myfaces.trinidad.CHECK_FILE_MODIFICATION</param-name>
        <param-value>false</param-value>
      </context-param>
    When my application is running I get the following on the weblogic console

    < ViewHandlerImpl > < _checkTimestamp > Apache Trinidad runs with control of activated timestamp. This should not be used in a production environment. See the org.apache.myfaces.trinidad.CHECK_FILE_MODIFICATION property in WEB-INF/web.xml
    < UIXEditableValue > < _isBeanValidationAvailable > Validation Bean A provider is not present, so bean validation is disabled

    is it not a bit strange? Please tell us what the problem is.

    thnks
    11.1.2.1 jdev

    If you speak the WLS integrated, timestamp control is automatically turned on anything so that changes you make in the IDE can be picked up. There is nothing to worry.

    John

  • Problem running windows 10 to date for windows 7 Home premium 64-bit reference error code 08C 1800103 - 089002

    Problem running windows 10 to date for windows 7 Home premium 64-bit reference error code 08C 1800103 - 089002

    Could not update windows 7 Home premium service pack 1 for windows 10.

    I tried windows update. all updates are installed except win 10 update that comes up with unexpected error

    Please be aware, even if you do not get the Windows 10 app, you can always download Windows 10 as one. ISO file, create a bootable copy and update your system.

    See the instructions: How to download official Windows 10 ISO files

    Task of pre-required

    When you make significant changes to your computer for example updated operating system, you must always back up. See the links to resources on the backup by clicking the link for each version of Windows you are using: Windows XP, Windows Vista, Windows 7, Windows 8/8.1

  • Since the installation of CD images appear with a green cast. also print with a green cast. Earlier versions of Reader were ok. Concerned images do not have an inherent green cast. How can I fix. Could always revert to a previous version which had no pro

    Since the installation of CD images appear with a green cast. also print with a green cast. Earlier versions of Reader were ok. Concerned images do not have an inherent green cast. How can I fix. Could always revert to a previous version which had no problem?  G.W.

    Hi Q8F7B,

    Please let us know the version of the dowry of DC and operating system installed on your system drive.

    Is - this problem with a PDF in particular?

    Could you please also share the screen shot for the same thing?

    Kind regards

    Meenakshi

  • Problem link DB between active Data Guard and reports application database

    My version of the 11.2.0.2.0 and OS database is Oracle Solaris 10 9/10.
    I am facing a problem in my custody of data Active data base for purposes of tax. Active Data guard information is as below.

    SQL > select name, database_role, open_mode from v$ database;

    NAME DATABASE_ROLE OPEN_MODE
    --------- ---------------- --------------------
    ORCL PHYSICS READ SHALL ONLY APPLY

    Detail of the problem is less than
    ------------------------------
    I have created a db link (name: DATADB_LINK) between active data guard and report of application of data base for purposes of tax.
    SQL > create database DATADB_LINK link to connect to HR identified by HR using 'DRFUNPD ';
    Database link created.

    But when I run a query using db link to my database of enforcement report I got this error below.

    ORA-01555: snapshot too old: rollback segment number 10 with the name ' _SYSSMU10_4261549777$ ' too small
    ORA-02063: preceding the line of DATADB_LINK

    Then I see logfile named database alart Active Data Guard and get below error

    ORA-01555 caused by the following SQL statement (SQL ID: 11yj3pucjguc8, time of request = 1 sec, SNA: 0x0000.07c708c3): SELECT "A2". "' BUSINESS_TRANSACTION_REFERENCE ', 'A2 '. "' BUSINESS_TRANSACTION_CODE ', MAX (CASE 'A1'. "TRANS_DATA_KEY"WHEN "feature' AND 'A1'." " END OF TRANS_DATA_VALUE"), MAX (CASE 'A1'. "TRANS_DATA_KEY" WHEN 'otherFeature' THEN 'A1' '. "" END OF TRANS_DATA_VALUE")

    But the interesting point if I run the query report directly in the Active Data Guard database, I got never error.

    So it's a problem of link DB between active Data Guard and other databases?

    Fazlul Kabir Mahfuz wrote:
    My version of the 11.2.0.2.0 and OS database is Oracle Solaris 10 9/10.
    I am facing a problem in my custody of data Active data base for purposes of tax. Active Data guard information is as below.

    SQL > select name, database_role, open_mode from v$ database;

    NAME DATABASE_ROLE OPEN_MODE
    --------- ---------------- --------------------
    ORCL PHYSICS READ SHALL ONLY APPLY

    Detail of the problem is less than
    ------------------------------
    I have created a db link (name: DATADB_LINK) between active data guard and report of application of data base for purposes of tax.
    SQL > create database DATADB_LINK link to connect to HR identified by HR using 'DRFUNPD ';
    Database link created.

    But when I run a query using db link to my database of enforcement report I got this error below.

    ORA-01555: snapshot too old: rollback segment number 10 with the name ' _SYSSMU10_4261549777$ ' too small
    ORA-02063: preceding the line of DATADB_LINK

    Then I see logfile named database alart Active Data Guard and get below error

    ORA-01555 caused by the following SQL statement (SQL ID: 11yj3pucjguc8, time of request = 1 sec, SNA: 0x0000.07c708c3): SELECT "A2". "' BUSINESS_TRANSACTION_REFERENCE ', 'A2 '. "' BUSINESS_TRANSACTION_CODE ', MAX (CASE 'A1'. "TRANS_DATA_KEY"WHEN "feature' AND 'A1'." " END OF TRANS_DATA_VALUE"), MAX (CASE 'A1'. "TRANS_DATA_KEY" WHEN 'otherFeature' THEN 'A1' '. "" END OF TRANS_DATA_VALUE")

    But the interesting point if I run the query report directly in the Active Data Guard database, I got never error.

    So it's a problem of link DB between active Data Guard and other databases?

    Check this statement that applies to your environment

    * ORA-01555 on Active Data Guard Standby Database [1273808.1 ID] *.

    also

    http://asktom.Oracle.com/pls/asktom/f?p=100:11:0:P11_QUESTION_ID:8908307196113

  • Re: Imagem om my Toshiba with problems

    Hello world

    When I start my laptop, the picture on the screen appears with problems, cannot read letters and some traces in the vertical. When windows start, displays a blue screen with a memory error but I can read because it disappears very quickly.

    I thing (I'm not sure) that may be a problem with the graphics card. I removed the ram cards and switch, but problems remain.

    Any ideas?

    Hello

    Yes, BSOD is the product of a software or hardware problem.
    Since you have a few vertical lines on the screen, the graphics chip could be affected.
    Seems only service technicians would be able to help by the way: what laptop do you have?

  • My Microsoft Wireless Mouse 5000 new scrolls only in one direction in Quicken. This seems to be the only program with problems. All the answers?

    My Microsoft Wireless Mouse 5000 new scrolls only in one direction in Quicken.  This seems to be the only program with problems. All the answers?

    Hi retiredinflorida,

    Welcome to Microsoft Vista answers Forum!
     
    It is a known issue using IntelliPoint from Microsoft and Quicken software drivers.  Both parties are aware of the problem and as soon as a hotfix or patch for this problem is available it will be displayed on the Quicken Web site so check with their website on a regular basis.
     
    However, if the Microsoft Wireless Mouse 5000 problems in other applications, you can check the links below.

    The Microsoft wireless mouse does not work as expected if:

    You may want to consider this link to fix the problem: http://support.microsoft.com/default.aspx?scid=kb; EN-US; 838398

    In the case want ot uninstall and reinstall the mouse drivrs use this link: http://www.microsoft.com/hardware/windows7/support.mspx

    Hope this information is useful.
    Let me know if it worked.

    Thank you, and in what concerns:
    Aziz Nadeem - Microsoft technical support.
    Visit our Microsoft answers feedback Forum
    http://social.answers.Microsoft.com/forums/en-us/answersfeedback/threads/ and let us know
    what you think

  • I need to replace a motherboard with a new another brand, what files or drivers that I need to delete not close up with problems starting in windows 7 pro oem

    I need to replace a motherboard with a new another brand, what files or drivers that I need to delete not close up with problems starting in windows 7 pro oem current motherboard works but is old and has problems with heat. Not worried about having to re-record software am just worried starting problems

    Friday, October 19, 2012 19:03:30 + 0000, * address email is removed from the privacy * wrote:

    I need to replace a motherboard with a new another brand, what files or drivers that I need to delete not close up with problems starting in windows 7 pro oem current motherboard works but is old and has problems with heat. Not worried about having to re-record software am just worried starting problems

    Two points:

    1. it is unlikely that your current installation would work if
    you have changed motherboards. You need to reinstall itself.

    2 but you cannot use your current copy of Windows if you change
    motherboards, not even if reinstall you it cleanly. The largest
    disadvantage of an OEM version, is that its license it binds permanently
    the first computer, it is installed on and Microsoft believes that
    If you change the motherboards, another computer. It can never
    legally be moved to another computer, sold or transferred (except with)
    the original computer). If the computer dies or is stolen, your
    license dies with him.

    Ken Blake, Microsoft MVP

  • SQL Loader issue - CSV with commas and quotes IN the data

    Hello, I have a dataset for a simple table of 2 columns like this:

    Column 1, "it is given for"Column 2", with commas and quotes."

    Data are delimited by commas and may be surrounded by double quotes.  In ADDITION, it may include commas and quotation marks in the data fields.  I CANNOT manipulate data before sending it to SQL Loader.

    I set my file of control like this:

    DOWNLOAD THE DATA

    INFILE '. / TEST.dat'

    BADFILE '. / TEST. BAD'

    DISCARDFILE '. / TEST. DSC"

    REPLACE IN THE TEST TABLE

    Fields ended by ',' POSSIBLY BOX BY ' "' TRAILING NULLCOLS"

    (

    Col1 char (50),

    Col2 char (500)

    )


    Now when I run the present via SQLLDR, I get the following error in the log file:


    Sheet 1: Rejected - error on table TEST, column COL2.

    no terminator found after CLOSE and CLOSED field

    What are my options to get the loaded data as presented above?  I'm working on Oracle 11 g (11.2.0.3.0) 64-bit on AIX 6.1.0.0.

    Thank you!

    In this case, there is no way she can tell who's a delimiter or pregnant and which is part of the data.  As far as I know, there is no way that you can load it into the appropriate columns.

  • I am creating a stamp of Certification of drawing dynamic shop with fields of text 'Name' and 'Date '. I tried different ways within Javascript, but I can't seem to make it work. The Date and time remains static on the stamp when it is inserted and

    I am creating a stamp of Certification of drawing dynamic shop with fields of text 'Name' and 'Date '. I tried different ways within Javascript, but I can't seem to make it work. The Date and time remains static on the stamp when inserted and always reflect when the stamp was created and the name is always my name. I try to have the user name or the username inserted so that he who is the insertion of the postmark of the stamp automatically inserts their name and what day and time the stap is inserted. I can't get this dynamic stamp works like the default Adobe Acrobat Dynamic stamps. Can anyone help with this one. Thank you

    Have you created a page template for your stamp? Did name the template of the page correctly? It's the right format:

    #InternalStampName = display name of stamp

  • Dynamics Processor Calc does not reach more than [100] ESM blocks during the calculation, please increase the CalcLockBlock setting, and then try again (a small data cache setting can also cause this problem, check the size of data cache setting).

    Hello

    Our environment is Essbase 11.1.2.2 and work on Essbase EAS and components of Shared Services. One of our user tried to execute the Script of Cal of a single application and in the face of this error.

    Dynamics Processor Calc does not reach more than [100] ESM blocks during the calculation, please increase the CalcLockBlock setting, and then try again (a small data cache setting can also cause this problem, check the size of data cache setting).


    I did a few Google and found that we need to add something in the Essbase.cfg file as below.

    Dynamics Processor Calc 1012704 fails to more blocks ESM number for the calculation, please increase the CalcLockBlock setting, and then try again (a small data cache setting can also cause this problem, check the size of data cache setting).

    Possible problems

    Analytical services cannot lock enough blocks to perform the calculation.

    Possible solutions

    Increase the number of blocks of analytical Services can allocate to a calculation:

    1. Set the maximum number of blocks of analytical Services can allocate at least 500.
      1. If you are not a $ARBORPATH/bin/essbase.cfg on the file server computer, create one using a text editor.
      2. In the essbase.cfg folder on the server computer, set CALCLOCKBLOCKHIGH to 500.
      3. Stopping and restarting Analysis server.
    2. Add the command SET LOCKBLOCK STUDENT at the beginning of the calculation script.
    3. Set the cache of data large enough to hold all the blocks specified in the CALCLOCKBLOCKHIGH parameter.

    In fact in our queue (essbase.cfg) Config Server we have given below added.

    CalcLockBlockHigh 2000

    CalcLockBlockDefault 200

    CalcLockBlocklow 50


    So my question is if edit us the file Essbase.cfg and add the above settings restart services will work?  and if yes, why should change us the configuration file of server if the problem concerns a Cal Script application. Please guide me how to do this.


    Kind regards

    Naveen

    Yes it must *.

    Make sure that you have "migrated settings cache of database as well. If the cache is too small, you will have similar problems.

  • Cast operator: a date can be cast into a number? Can anyone provide an eg

    Hi guys,.

    Can someone tell me if a date can be cast to type data number? I happen to fall on a few lines of code which suggested that it could be done. But when I tried out it gives me an error
    "ORA-00932: inconsistent data types: expected DATE got the NUMBER.

    Would be useful if someone gave an example...


    Thank you.

    >
    CREATE THE SUB MATERIALIZED VIEW
    AS
    SELECT mount SCT (SCT as char (3)).
    Mount EFFECTIVE_DATE (EFFECTIVE_DATE under the number (9)),
    Mount CANCEL_DATE (CANCEL_DATE under the number (9)),
    ..................
    where EFFECTIVE_DATE and CANCEL_DATE are of DATE data type...

    but I still would like to know how that is EXPRESSED above stmts work whereas when I try them they do not.
    >
    This code does not work if EFFECTIVE_DATE and CANCEL_DATE are of the DATE data type.

    What makes you think that?

Maybe you are looking for