ColdFusion Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreColdFusion Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old May 16th, 2005, 10:20 AM
samb1 samb1 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Posts: 67 samb1 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 1 h 42 m 42 sec
Reputation Power: 4
Problem updating duplicate records

guys, I have a CloseDate field in my database that gets populated with a parsed date from a website. When the database is empty and i insert my parsed data into the database, the CloseDate field is populated fine. However once the database is populated and i run the insert on duplicate update, the CloseDate field is populated with 0000-00-00. Why is the CloseDate field getting affected?

Here is my code:
<cfquery name="insJobRecord2" datasource="job">
insert into advertisements (ref, Website, Description, Title, Salary, Location, Contract, CloseDate, IntDate)
values
(<cfqueryparam value="#Links2[i]#" cfsqltype="CF_SQL_VARCHAR">,
<cfqueryparam value="#thisURL2#" cfsqltype="CF_SQL_VARCHAR">,
<cfqueryparam value="#thisJD2#" cfsqltype="CF_SQL_LONGTEXT">,
<cfqueryparam value="#thisTitle2#" cfsqltype="CF_SQL_VARCHAR">,
<cfqueryparam value="#thisSalary2#" cfsqltype="CF_SQL_VARCHAR">,
<cfqueryparam value="#thisLocation2#" cfsqltype="CF_SQL_VARCHAR">,
<cfqueryparam value="#thisContract2#" cfsqltype="CF_SQL_VARCHAR">,
<cfqueryparam value="#thisCloseDate2#" cfsqltype="CF_SQL_DATE">,
<cfqueryparam value="#thisIntDate2#" cfsqltype="CF_SQL_VARCHAR">)
on duplicate key update Description = '#thisJD2#', Title = '#thisTitle2#', Salary = '#thisSalary2#', Location = '#thisLocation2#', Contract = '#thisContract2#', CloseDate = '#thisCloseDate2#', IntDate = '#thisIntDate2#'
</cfquery

There are three of these queries, one for each parsed website. I have outputted the thisCloseDate variable for each and they all give me a closedate. However they are slightly different in there format . e.g. 23/05/2005 and 16 May 2005

Reply With Quote
  #2  
Old May 16th, 2005, 10:52 AM
kiteless kiteless is offline
Moderator
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,661 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 4 Days 14 h 23 m 22 sec
Reputation Power: 53
What database are you using? This might be a question to ask in a forum specific to that database, as I don't see any obvious reason why it would be resetting itself. As far as I know MySQL is the only DB that has "on duplicate key", so you might want to ask in the MySQL forum.
__________________
Ask if you have a question, but also help answer questions that you have knowledge of! Thanks, Brian.
How to Post a Question in the Forums

Reply With Quote
  #3  
Old May 16th, 2005, 11:01 AM
samb1 samb1 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Posts: 67 samb1 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 1 h 42 m 42 sec
Reputation Power: 4
Cheers Kiteless I already posted on MySQL, but I was just checking that it wasnt a CF problem.....thanks anyway

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreColdFusion Development > Problem updating duplicate records


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway