Author: shawkins
Date: 2010-05-04 10:06:31 -0400 (Tue, 04 May 2010)
New Revision: 2096
Modified:
trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/oracle/OracleSQLTranslator.java
Log:
fixing ctc issues: date handling regression
Modified:
trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/oracle/OracleSQLTranslator.java
===================================================================
---
trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/oracle/OracleSQLTranslator.java 2010-05-03
21:30:20 UTC (rev 2095)
+++
trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/oracle/OracleSQLTranslator.java 2010-05-04
14:06:31 UTC (rev 2096)
@@ -150,10 +150,11 @@
if
("date".equals(((ColumnReference)ex).getMetadataObject().getNativeType())) {
//$NON-NLS-1$
format = "YYYY-MM-DD HH24:MI:SS"; //$NON-NLS-1$
}
- } else if (!(ex instanceof Function)) {
+ } else if (!(ex instanceof Function) && !(ex instanceof Literal)) {
+ //this isn't needed in every case, but it's simpler than inspecting the
expression more
ex = ConvertModifier.createConvertFunction(getLanguageFactory(),
function.getParameters().get(0), TypeFacility.RUNTIME_NAMES.TIMESTAMP);
}
- return Arrays.asList("to_char(", ex, ",
'"+format+"')"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ return Arrays.asList("to_char(", ex, ", '", format,
"')"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
});
convertModifier.addConvert(FunctionModifier.STRING, FunctionModifier.DATE, new
ConvertModifier.FormatModifier("to_date", "YYYY-MM-DD"));
//$NON-NLS-1$ //$NON-NLS-2$
Show replies by date