I didn't know this and actually didn't believe it myself but this works in Adobe ColdFusion 9
However it seams it has issues with timestamps
Which errord with:
This all started with me thinking that it would be a good enhancement for Railo and when I logged the ticket https://jira.jboss.org/browse/RAILO-1079. Todd replied with this already works in ACF 9.
I think cf_csql_ really isn't needed and I hope both ACF and Railo implement this fully.
Playing with this some more, I think ACF just doesn't validate the cfsqltype argument and treats it as untyped. When I tried this code, it worked fine too:
ReplyDeletecfqueryparam cfsqltype="bollox" value="1"
(not sure if your blog eats angle brackets so I'm just posting the code without)
This would explain why cfsqltype="timestamp" gave an error about converting from character string. If I change the value above to "one", the query simply returns no results - without erroring out.
Curiouser and curiouser!
I may be wrong here but I think I came across this issue and now() != valid timestamp format for MYSQL. Does createodbcdatetime(now()) work? I can't remember but I think I had to create a function to create a vaild timestamp that MYSQL liked i.e. yyyy-mm-dd hh:mm:ss.
ReplyDeleteThing is cf_sql_timestamp worked perfectly. So ACF is broken and is just setting everything as varchar ( I think ). Integer worked because it was 1 ( ie an integer ).
ReplyDeleteNow() works fine as a timestamp example: http://pastebin.com/fQYGu98R
and demo: http://kukiel.net/demos/dbmysql.cfm