hello,
I'm trying to use Date from Sybase table.
When running i have the error :
disconnected
Exception in component tSybaseInput_1
java.sql.SQLException: JZ009: L'erreur suivante a été détectée pendant la conversion : java.lang.IllegalArgumentException: Timestamp format must be yyyy-mm-dd hh:mm:ss.fffffffff
at com.sybase.jdbc3.jdbc.ErrorMessage.raiseError(Unknown Source)
at com.sybase.jdbc3.jdbc.Convert.objectToTimestamp(Unknown Source)
at com.sybase.jdbc3.jdbc.Convert.objectToDateObject(Unknown Source)
at com.sybase.jdbc3.tds.TdsJdbcInputStream.getDateObject(Unknown Source)
at com.sybase.jdbc3.jdbc.SybResultSet.getTimestamp(Unknown Source)
at defi2_bis.alimentation_defi_001.Alimentation_Defi_001.tSybaseInput_1Process(Alimentation_Defi_001.java:2264)
at defi2_bis.alimentation_defi_001.Alimentation_Defi_001.tSybaseInput_2Process(Alimentation_Defi_001.java:436)
at defi2_bis.alimentation_defi_001.Alimentation_Defi_001.main(Alimentation_Defi_001.java:2441)
the code is :
if (rs_tSybaseInput_1.getTimestamp(4) != null) {
row5.DateDebutValidite = new java.util.Date(
rs_tSybaseInput_1.getTimestamp(4).getTime());
} else {
row5.DateDebutValidite = null;
}
this append on a lookup table ( row5 ), and ( for instance ) i don(t use the date column for any test..
is it a specific problem with SYBASE ?
How is possible to convert the data ?
thank you for your help.
Hi,
Do you need Nano seconds precision ?
Because you can modify your timestamp format : "yyyy-mm-dd hh:mm:ss"
Normally it works.
I'm trying some tests and i am searching a bug fix.
Maybe this is a
java bug.
Regards.
Sybase and MS SQL Server have a silly way to store date/time. The precision is... 3 milliseconds!
Just try running "select getdate()" several times:
2007-07-18 19:44:48.330
2007-07-18 19:45:22.053
2007-07-18 19:45:27.880
2007-07-18 19:45:45.266
2007-07-18 19:45:52.236
...
You can notice that the timestamp always ends with 0, 3 or 6. Other values are illegal.
So the safe thing to do is to round up a date/time to 10 milliseconds, at least.
2007-07-18 19:45:52.237526 => illegal
2007-07-18 19:45:52.237 => illegal
2007-07-18 19:45:52.230 => OK
2007-07-18 19:45:52 => OK
Sorry to revive an old thread...but I'm facing the same issue.
I tried using CONVERT like Mouseman suggested in my MSSQLInput's SELECT Query, as well as cantoine's suggestion with removing microseconds. It isn't working.
Please someone help.
I'm using Talend Data Quality version: 4.0.1
Build id: r41260-20100427-0748
JDK and JRE 1.6. Release 22
Thank you.
Thank you Shong.
My data type in Talend Schema is Date. The corresponding column in MS SQL Server query is of DateTime type.
The exception I get is this like that of OP:
java.lang.IllegalArgumentException: Timestamp format must be yyyy-mm-dd hh:mm:ss.fffffffff
Since my goal is a CSV file, for now, I'm managing it by changing the schema's data type as String.
My job is very simple - the components I use are, a single tMSSQLInput with a SELECT query (without any joins) and it's output connected to tLogRow.
Hi,
I'm facing the same issue with talend Date type saying that :
java.lang.IllegalArgumentException: Timestamp format must be yyyy-mm-dd hh:mm:ss But when I put the said pattern i'm still getting the same exception
I'm using the tOracleInput component and connect to a tMap component.
My talend schema is Date and the corresponding column in Oracle is TIMESTAMP.
The job is pretty much simple, Select all valid record in table_1 then insert the current records onto table_1_history then update the current record STAT_CODE and TIMESTAMP column and save it to a CSV file.
TIS version : 4.1.2 r 53616
OS : Win XP SP3
Java Version : 1.6.0_22
Hi Shong,
Thanks for the reply.
Here's some of the record that's need to be updated.
Column Definition: ACTVTY_CD (Varchar : PK),
ENDT_EFF_DT (Timestamp: PK),
REF_GROUP_CD (Varchar : PK),
STAT_CD (Varchar),
TIMESTAMP (Timestamp)
Record(s): ACT00152 2011-03-16 12:42:03.065 001000 P 2011-03-16 12:42:03.065
ACT00153 2011-03-16 12:42:03.081 001000 P 2011-03-16 12:42:03.081
ACT00160 2011-02-24 17:11:20.463 001000 P 2011-02-24 17:11:20.525
Only the TIMESTAMP column throws an error.