]
Steven Hawkins resolved TEIID-5326.
-----------------------------------
Fix Version/s: 10.3
10.1.4
10.2.1
Resolution: Done
Correct the sybase iq (using the explicit convert format shown) and the sybase translator
(using a space) timestamp to string conversion logic. Also added a simpler timestamp
conversion for newer versions of sybase.
SAP IQ timestamp conversion to varchar wrong resulting format
-------------------------------------------------------------
Key: TEIID-5326
URL:
https://issues.jboss.org/browse/TEIID-5326
Project: Teiid
Issue Type: Bug
Affects Versions: 8.12.13.6_4
Reporter: Jan Stastny
Assignee: Steven Hawkins
Fix For: 10.3, 10.1.4, 10.2.1
Following Teiid query:
{code:sql}
SELECT TimeStampValue, LOWER(TimeStampValue) FROM BQT1.SmallA
{code}
is pushed as:
{code:sql}
SELECT g_0."timestampvalue" AS c_0, lcase(stuff(stuff(convert(varchar,
g_0."timestampvalue", 102), 5, 1, '-'), 8, 1,
'-')+convert(varchar, g_0."timestampvalue", 8)) AS c_1 FROM
"bqt-server"."dvqe"."SmallA" AS g_0
{code}
and returns the string representation of timestamp as:
2000-01-0100:00:00
2000-01-0100:00:01
...
Notice the missing space between date and time part.
SAP IQ is capable of converting the value implicitly, e.g. when I issue query
{code:sql}
SELECT TimeStampValue, LOWER(TimeStampValue) FROM SmallA
{code}
directly against SAP IQ instance, I get following string format:
2000-01-01 00:00:00.000
2000-01-01 00:00:01.000
....
The same results are returned if I use an explicit convert like:
{code:sql}
SELECT TimeStampValue, LOWER(CONVERT(varchar,TimeStampValue,121)) FROM SmallA
{code}
For more formatting options see [SyBooks
Online|http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.info...]