Google グループは Usenet の新規の投稿と購読のサポートを終了しました。過去のコンテンツは引き続き閲覧できます。
Dismiss

setting timestamp field on database to now (sysdate)

閲覧: 42 回
最初の未読メッセージにスキップ

swee...@gmail.com

未読、
2008/10/01 11:28:112008/10/01
To:
Converting existing product to ITDI AL's (using 6.1.1)
I have a JDBC connector to an oracle db in Update mode

I need to update the "modified" field (which is of type DATE) to the
current date and time the AL runs. In the output map, I map the field
to javascript

var d = new java.util.Date();
task.logmsg(d);
ret.value = d;

but I get the error below. I have tried manipulating with parseDate
like when reading in modfiied dates from LDAP, but surely this should
be quite simple to say like Date() or Now() etc

Any help appreciated as I've searched quite extensively here, and they
just seem to cover converting LDAP string dates into date format

Cheers

CTGDIS810E handleException - cannot handle exception , update
java.sql.SQLException: ORA-01841: (full) year must be between -4713
and +9999, and not be 0

at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:289)
at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:589)
at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1957)
at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java:
1114)
at
oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.java:
2181)
at
oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.java:
2063)
at
oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:
2920)
at
oracle.jdbc.driver.OracleStatement.executeUpdate(OracleStatement.java:
884)
at com.ibm.di.connector.JDBCConnector.putEntry(Unknown Source)
at com.ibm.di.server.AssemblyLineComponent.add1(Unknown Source)
at com.ibm.di.server.AssemblyLineComponent.update(Unknown Source)
at com.ibm.di.server.AssemblyLine.msExecuteNextConnector(Unknown
Source)
at com.ibm.di.server.AssemblyLine.executeMainStep(Unknown Source)
at com.ibm.di.server.AssemblyLine.executeMainLoop(Unknown Source)
at com.ibm.di.server.AssemblyLine.executeMainLoop(Unknown Source)
at com.ibm.di.server.AssemblyLine.executeAL(Unknown Source)
at com.ibm.di.server.AssemblyLine.run(Unknown Source)
[16:23:36 BST] java.sql.SQLException: ORA-01841: (full) year must be
between -4713 and +9999, and not be 0

kolev.kg

未読、
2008/10/01 12:49:222008/10/01
To:
How about changing the script to this one:

var d = new java.util.Date();
task.logmsg(d);

ret.value = new java.sql.Timestamp(d.getTime());


Best Regards,
Kaloyan Kolev.

swee...@gmail.com

未読、
2008/10/01 16:44:592008/10/01
To:

Thanks. Will report back tomorrow, but I think I tried that one and
got some sort of pattern match, or string too short / not terminated
message.

Failing that, I will just have to build it up myself into "YYYY-DD-MM
HH:MM" format

kolev.kg

未読、
2008/10/01 16:57:222008/10/01
To:
Other option would be to use this:

ret.value = new
java.sql.Timestamp(java.lang.System.currentTimeMillis());

Which is pretty much the same but does not create an auxiliary Date
object.

Best Regards,
Kaloyan Kolev.

swee...@gmail.com

未読、
2008/10/02 10:22:252008/10/02
To:

Thank you. The trouble actually was the table structure in my POC
environment was wrong and I was trying to
insert a new row into a table and one of the fields was erroneously
set as not nullable

Only once I put "detailed" onto the connector itself did this become
clear

swee...@gmail.com

未読、
2008/10/02 11:33:072008/10/02
To:
Actually I told a lie - no indication of null into non-nullable
field. Only this in the log
[16:13:57 BST] java.sql.SQLException: ORA-01830: date format picture
ends before converting entire input string

Once I checked the structure was when I realised what the problem was

新着メール 0 件