Thank you jyokum.It is inserting something like 2003-08-25 15:04:05.0.What is the last ".0" mean?I just want it to insert
"2003-08-25 15:04:05"?Could you please expalin me?
Thanks
Meghu
Main Topics
Browse All TopicsHi all,
I am trying insert a record in to oracle table from cold fusion mx.One of the fields is a date/time field.It gives me an error.Below is the code.Please help.
<cfset submitdate = DateFormat(Now(),"DD-MM-YY
Insert into table1(name,ssn,datesubmit
Thanks
Meghu
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Actually you can simply have it this way :
<cfset submitdate = DateFormat(Now(),"yyyy-mm-
Insert into table1(name,ssn,datesubmit
Values('xxx','xxx-xxx-xxxx
Another option is that you can also set a default value for your datesubmitted field as current datetime. So you don't need to pass a value for that field.
Goodluck!
eNTRANCE2002 :-)
Jyokum,
I works if i use cf_sql_timestamp as you said. But the problem is when i try to pull up the record again it displays wrong data.For example if datesbmitted(sys date in this case) is "08/26/2003 14:34:28" ,when i pull up the record it displays "08/26/2003 14:08:28" .That is it is displaying month in place of minutes.I did not do any date or time formatiing when displaying.
Could you explain please?
Aslo in some other place of the program the user enters a date and time and i should update the record with the entered date time value.Oracle doesnot allow me to update even though i tried to format it before updating.
Thanks
Meghu
Thank you jyokum.
Iam trying to update a record with the date user entered.Its giving me an error.Below is the code
<cfif isdate(form.txtdate)>
<cfset tmpdate = dateFormat(#form.txtdate# , "dd-mmm-yyyy HH:MM:ss")>
</cfif>
update table1
set rdate = '#tmpdate#'
where sno = '10000';
Any help is appreciated.thanks
and even in the above case its taking month in place of minutes.and the error is "date format picture ends before converting entire input string"
say for ex the date entered is 09/20/2003 13:35:20
the query in debug looks like
update table1
set rdate='20-sep-2003 13:09:20'
where sno='10000'
and i get the above error
I tired to use the <cfqueryparam value="#now()#" cfsqltype="cf_sql_timestam
<cfquery name="Site_Update" datasource="ManualEntry">
INSERT INTO
BY_SITE (SITE, MONTH_END_DT, DW_CREATE_DT, DW_UPDATE_DT, DM_PUSH_DT)
VALUES
('CD', '2003-08-25 15:04:05.0','2003-08-25 15:04:05.0',
<cfqueryparam value="#now()#" cfsqltype="cf_sql_timestam
</cfquery>
Thanks a million for any help!
Va. :-)
just fyi the Oracle function todate() used in jyokum's answer is actually TO_DATE. The underscore was left out and I think that is what problem meghu was having. The insert statement works just fine with the proper function name.
Just to clear up any issues with anyone reading this solution at a later date.
-Brice
Business Accounts
Answer for Membership
by: jyokumPosted on 2003-08-25 at 12:54:35ID: 9218874
cfqueryparam is the best thing to use when dealing with dates
ted,email) ', <cfqueryparam value="#now()#" cfsqltype="cf_sql_timestam p">, 'test@hotmail.com')
Insert into table1(name,ssn,datesubmit
values('xxx','xxx-xxx-xxxx