We have a ColdFusion 8 (Linux) application that uses an Oracle timestamp. We just converted to Oracle 11g from 10g and we're now using Oracle's thin client on the data sources. We're getting an error in the application where a timestamp column is selected.
It seems as though an object of class oracle.sql.TIMESTAMP
is being returned. I verified this by dumping the contents of the column. Sure enough, it gives me a break down of the object's methods and their return types. But, I can't seem to be able to interface with this object directly:
<cfquery name="getstuff" ...>
SELECT timestampfld ...
FROM myTable
</cfquery>
getstuff.timestampfld
contains an object. But, doing this:
<cfoutput query="getstuff">
#timestampfld.stringValue()#
#timestampfld.dateValue()#
</cfoutput>
produces the error that says those methods can't be found. How can I get at the data held in that object?
Update from comments:
When I take column value and apply the DateFormat( timestampfld, "dd.mm.yyyy" )
function to it. The CF error is
"The value class oracle.sql.timestamp cannot be converted to a date".
When I perform <cfoutput>
, I get the class definition.
In the retrieved column, I seem to be getting an object instead of a string. When I cfdump the column, I get OBJECT OF oracle.sql.TIMESTAMP. The dump lays out the methods and fields available. When I cfoutput that same variable, a string is displayed. When I try to perform a DataFormat()
on the variable, it complains that its not a date.
<cfoutput>#timestampfld#</cfoutput>
? – RetiredDateFormat()
function can parse. Please add the output that is returned to your question so that we can help you further - edit – NamelessyourCol.toString()
, then parse it as a date? Or perhaps look for settings against the driver to not return objects, but return just values? – Retireddate
in your query? I do not use Oracle, but their docs says it is an extension of date, so their must be some conversion function available, liketo_date
. As a last resort, the java API suggeststheTimeStampCol.dateValue()
might work. – HeteropolardateValue()
already and said that did not work. IF that is the case, we are back to checking the driver API to see what methods are available. Speaking of which, when you dump the column ... what are the methods available? Because the API suggestsdateValue()
is one of them. – Heteropolar