CF and date Time DB Problems

2009-08-18 Thread Ian Vaughan

Hi

I am trying to insert the current date and time into an Oracle db using
the following

cfqueryparam cfsqltype=cf_sql_varchar value=#LSDateFormat(Now(),
dd-mmm-)# #LSTimeFormat(Now())#


But  I am getting the following coldfusion error from the database?


Error Executing Database Query.  
[Macromedia][Oracle JDBC Driver][Oracle]ORA-01830: date format picture
ends before converting entire input string  

Any ideas on what's going wrong?


~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:325519
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: CF and date Time DB Problems

2009-08-18 Thread James Holmes

Is the column a date or a varchar - because you're using a varchar cfsqltype.

I usually use the Oracle to_date() function to insert a date/time.

mxAjax / CFAjax docs and other useful articles:
http://www.bifrost.com.au/blog/

2009/8/18 Ian Vaughan i.vaug...@neath-porttalbot.gov.uk:

 Hi

 I am trying to insert the current date and time into an Oracle db using
 the following

 cfqueryparam cfsqltype=cf_sql_varchar value=#LSDateFormat(Now(),
 dd-mmm-)# #LSTimeFormat(Now())#


 But  I am getting the following coldfusion error from the database?


 Error Executing Database Query.
 [Macromedia][Oracle JDBC Driver][Oracle]ORA-01830: date format picture
 ends before converting entire input string

 Any ideas on what's going wrong?


 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:325521
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: CF and date Time DB Problems

2009-08-18 Thread Stephen Weyrick

Is the column a date or a varchar - because you're using a varchar cfsqltype.

I usually use the Oracle to_date() function to insert a date/time.

mxAjax / CFAjax docs and other useful articles:
http://www.bifrost.com.au/blog/


I use MS SQL Server, but I think you could use something like this.  
cfqueryparam value=#now()# CFSQLType=cf_sql_timestamp /

If this doesn't work, try this...
cfqueryparam value=#CreateODBCTime(now())# CFSQLType=cf_sql_timestamp / 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:325522
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: CF and date Time DB Problems

2009-08-18 Thread James Holmes

Of course on Oracle the easiest way to insert the current time and
date is to insert SYSDATE (if the CF server and the Oracle server
agree on the current time, anyway).

mxAjax / CFAjax docs and other useful articles:
http://www.bifrost.com.au/blog/

2009/8/18 Stephen  Weyrick sweyr...@gmail.com:

Is the column a date or a varchar - because you're using a varchar cfsqltype.

I usually use the Oracle to_date() function to insert a date/time.

mxAjax / CFAjax docs and other useful articles:
http://www.bifrost.com.au/blog/


 I use MS SQL Server, but I think you could use something like this.
 cfqueryparam value=#now()# CFSQLType=cf_sql_timestamp /

 If this doesn't work, try this...
 cfqueryparam value=#CreateODBCTime(now())# CFSQLType=cf_sql_timestamp /

 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:325524
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: CF and date Time DB Problems

2009-08-18 Thread Rick Root

On Tue, Aug 18, 2009 at 11:42 AM, Stephen  Weyricksweyr...@gmail.com wrote:

 If this doesn't work, try this...
 cfqueryparam value=#CreateODBCTime(now())# CFSQLType=cf_sql_timestamp /

I'm pretty sure the createODBCDate() function (and like functions) are
only necessary when you're NOT using cfqueryparam.
-- 
Rick Root
New Brian Vander Ark Album, songs in the music player and cool behind
the scenes video at www.myspace.com/brianvanderark

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:325530
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4