Skip to Content
avatar image
Former Member

Datetime field error when inserting on proxy table using ODBC

Table in ASE 12.5.3 ESD#2

CREATE TABLE dbo.AdwProcess (

dpWID int IDENTITY NOT NULL,

dpWCT datetime NULL,

dpWUT datetime NULL,

dpWUU varchar(255) NULL,

dpProcessType varchar(50) NULL,

dpProcessName varchar(50) NULL,

dpFromDtm datetime NULL,

dpToDtm datetime NULL,

dpEarliestDtm datetime NULL,

dpRunDtm datetime NULL,

dpStartDtm datetime NULL,

dpStopDtm datetime NULL,

dpStatus smallint NULL,

dpAuditId int NULL,

dpRunId int NULL,

dpResolved bit NOT NULL,

dpResolution varchar(255) NULL,

dpComment1 varchar(255) NULL,

dpComment2 varchar(255) NULL,

dpComment3 varchar(255) NULL,

dpComment4 varchar(255) NULL,

dpComment5 varchar(255) NULL,

PRIMARY KEY CLUSTERED(dpWID)

WITH max_rows_per_page = 0, reservepagegap = 0

)

LOCK DATAROWS

GO

Remote Server Definition

create server Myetldev01

class 'aseodbc'

using 'driver=/IQ/Server/IQ-16/ODBC/DataAccess64/ODBC/lib/libsybdrvodb.so;dsn=ohdwetldev01'

Proxy Table Creation

create existing table AdwProcess_proxy

at 'Myetldev01.MyStageDb.dbo.AdwProcess'

Statement from IQ 16.0 SP3

declare @todayDtm datetime

select @todayDtm = getdate()

/* If process is starting, insert new row into Process tables and retrieve dpWID */

insert DBA.AdwProcess_proxy

(dpWCT,

dpWUT,

dpWUU,

dpProcessType,

dpProcessName,

dpRunDtm,

dpStartDtm,

dpStatus,

dpResolved)

values

(@todayDtm,

@todayDtm,

'Test',

'Test',

'Test',

@todayDtm,

@todayDtm,

0,

0)

Error

>[Error] Script lines: 1-26 -------------------------

SQL Anywhere Error -660: Server 'Myetldev01': [Sybase][ODBC Driver][Adaptive Server Enterprise]Syntax error during implicit conversion of VARCHAR value '2014-02-13 14:41:06.021295' to a DATETIME field. _

This use to work when the remote server was configure to use JDBC on IQ 15.2 ESD#2

Do I missing some configuration in the ODBC DSN?

Thanks a lot.

Uvernes

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • Best Answer
    Feb 14, 2014 at 08:55 PM

    ASE 12.5.3 datetime datatype doesn't support microsecond precision, you can either change your code in IQ or upgrade ASE to 15.7.x

    Add comment
    10|10000 characters needed characters exceeded