Update/Insert Syntax into an Oracle timestamp Field - datetime2

Unanswered Update/Insert Syntax into an Oracle timestamp Field - datetime2

  • 5. března 2012 14:50
     
     

    We have a pain-in-the-#@#%$^@!*( Oracle database ....that is linked to a SQL Server 2005 machine (not SQL 2008)

    Need to insert rows into an #&$*!% Oracle table that has a table with datetime2 (timestamp field)

    Inserting data to the entire row works fine, but cannot cover the darn datetime2 field.

    Any ideas why everything fails?

    Here is a sample query getting data from SQL Server and inserting into Oracle - via whatever the driver is in between
    insert into stupidOracleTable (update_time_field)
    SELECT top 1  convert(varchar(10),UPDATE_DATE,113) + 'T' + right(convert(varchar(19),UPDATE_DATE,126),8) + '.0000000' from DATE_SPAN

    which is trying to insert this:  2011-02-11T22:06:23.0000000

    Alternatively tried ....  2011-02-11 22:06:23.0000000 ; 2011-02-11 22:06:23.000 ; 2011-02-11T22:06:23.000
    and nothing works.

    Thanks a billion for your kind help

Všechny reakce

  • 7. března 2012 18:03
     
     

    try this

    you should try the to_date function

    to_date( string1, [ format_mask ], [ nls_language ] )

    where the strings are concatinated with a space between and the format_mask is 

    'YYYY-MM-DD HH24:MI:SS'