-
1. Re: getTimestamp not implemented for class oracle.jdbc.driver.T4CVarcharAccessor
rareddy Mar 27, 2018 12:17 PM (in response to ihrisi)You can not cast direct from varchar2 to timestamp in your Teiid model, as there is no implicit conversion available. You would need to read as string in source model, then use parsetimestamp method see [1] and convert to timstamp in a view transformation.
In Source model
create foreign table Foo (strvalue varchar2);
In view model:
create view Bar AS select parsetimestamp(strvalue, 'YYYY-MM-DD HH24:MI:SS' ) as x From Source.Foo
-
2. Re: getTimestamp not implemented for class oracle.jdbc.driver.T4CVarcharAccessor
ihrisi Apr 2, 2018 1:14 AM (in response to rareddy)hi Ramesh,
the answer you provided is correct for the scenario where we do not have to populate any destination table . What will be case if i have a destination table and there i have defined a column as timestamp to populate the value m getting it from the query. More over if from that destination table if i want to read the data as timestamp will the Teiid support for that.
Thanks
-
3. Re: getTimestamp not implemented for class oracle.jdbc.driver.T4CVarcharAccessor
rareddy Apr 2, 2018 9:28 AM (in response to ihrisi)Yes, as long as you are using the View table (Bar from above) to populate your destination table then the column is of type "timestamp". When reading, you read as timestamp no conversion needed.
-
4. Re: getTimestamp not implemented for class oracle.jdbc.driver.T4CVarcharAccessor
ihrisi Apr 5, 2018 12:52 AM (in response to rareddy)Hi Ramesh,
i have tried the above it did not work. when i tried
createview Bar AS (select parsetimestamp(cast(strvalue as date), 'YYYY-MM-DD HH24:MI:SS' ) as x From Source.Foo )
then it worked.
Thanks for the suggestion.