Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Discover how organizations are unlocking new revenue streams: Watch here
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Querry fails in cMessageEndpoint

Why does this querry fails with this error?

"sql:UPDATE TLD_VP_DIM_CONTRACTS SET TLD_INSERT_DATE = (CURRENT_TIMESTAMP) WHERE ID =:#CONTRACT_ID?dataSource=myDataSource"
, StackTrace: org.springframework.jdbc.BadSqlGrammarException: PreparedStatementCallback; bad SQL grammar []; nested exception is java.sql.SQLSyntaxErrorException: ORA-00904: "URRENT_TIMESTAMPHERE": invalid identifier

	at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.doTranslate(SQLErrorCodeSQLExceptionTranslator.java:231)
	at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:73)
	at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:645)
...

But this querry doesnt fail:

"sql:UPDATE TLD_VP_DIM_CONTRACTS SET TLD_INSERT_DATE = (CURRENT_TIMESTAMP) WHERE ID =261?dataSource=myDataSource"

And the header in both cases

Headers: {breadcrumbId=ID:<xxx>, CamelSqlRowCount=1, CONTRACT_ID=261,
Labels (5)
13 Replies
Anonymous
Not applicable
Author

Works

"sql:UPDATE TLD_VP_DIM_CONTRACTS SET TLD_INSERT_DATE = (CURRENT_TIMESTAMP) WHERE ID ='261'?dataSource=myDataSource"
"sql:UPDATE TLD_VP_DIM_CONTRACTS SET TLD_INSERT_DATE = (CURRENT_TIMESTAMP) WHERE ID =261?dataSource=myDataSource"

Doesn't work

"sql:UPDATE TLD_VP_DIM_CONTRACTS SET TLD_INSERT_DATE = (CURRENT_TIMESTAMP) WHERE ID =:#${header.CONTRACT_ID}?dataSource=myDataSource"
"sql:UPDATE TLD_VP_DIM_CONTRACTS SET TLD_INSERT_DATE = (CURRENT_TIMESTAMP) WHERE ID =:#CONTRACT_ID?dataSource=myDataSource"
Anonymous
Not applicable
Author

Is this a bug and something for Talend Support to solve ?
Anonymous
Not applicable
Author

A collegue pointed out the solution. The problem were the empty spaces around '='.
Anonymous
Not applicable
Author

Hello,

Thanks for posting your solution here.

We have accepted your solution which allows others to see what has worked.

Best regards

Sabrina