RE: Can anyone spot a problem with this query?

2006-01-25 Thread Adkins, Randy
Constraint Violation beans that there would be more than one records
with the same
Set of values. Check your Primary Keys and Indexes.
 

-Original Message-
From: Rick Faircloth [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, January 25, 2006 4:17 PM
To: CF-Talk
Subject: Can anyone spot a problem with this query?

MySQL is giving me an ODBC Error Code = 23000 (Integrity contraint
violation) and says I have an error in my SQL syntax...I can't find
it...data being sent from form fields has been tested an appear to be in
proper form...I can't figure out why it's getting heartburn over this
query...  ???

Thanks,

Rick

CFQUERY Name=InsertCampWeek Datasource=#DSN#

 Insert
   into campweeks

(
 CampWeekName,

CFIF IsDate(Trim(Form.StartDate))
 StartDate,
/CFIF

CFIF IsDate(Trim(Form.EndDate))
 EndDate,
/CFIF

 DeanName,
 DeanBio,
 DeanPhoto,
 WeekDescription,
 Cost,
 Grades,

CFIF IsDate(Trim(Form.RegistrationStartTime))
 RegistrationStartTime,
/CFIF

CFIF IsDate(Trim(Form.DismissalTime))
 DismissalTime,
/CFIF

 SpacesAvailable
)

 Values (
 cfqueryparam cfsqltype=CF_SQL_VARCHAR
Value=#Form.CampWeekName#,

 CFIF IsDate(Trim(Form.StartDate))
 cfqueryparam cfsqltype=CF_SQL_DATE
Value=#DateFormat(CreateODBCDate(ParseDateTime(Form.StartDa
te)), 'M/D/')#,
 /CFIF

 CFIF IsDate(Trim(Form.EndDate))
 cfqueryparam cfsqltype=CF_SQL_DATE
Value=#DateFormat(CreateODBCDate(ParseDateTime(Form.EndDate
)), 'M/D/')#,
 /CFIF

 cfqueryparam cfsqltype=CF_SQL_VARCHAR
Value=#Form.DeanName#,
 cfqueryparam cfsqltype=CF_SQL_LONGVARCHAR
Value=#Form.DeanBio#,
 cfqueryparam cfsqltype=CF_SQL_VARCHAR
Value=#Form.DeanPhoto#,
 cfqueryparam cfsqltype=CF_SQL_LONGVARCHAR
Value=#Form.WeekDescription#,
 cfqueryparam cfsqltype=CF_SQL_DOUBLE
Value=#LSParseCurrency(Form.Cost)#,
 cfqueryparam cfsqltype=CF_SQL_VARCHAR
Value=#Form.Grades#,

 CFIF IsDate(Form.RegistrationStartTime)
 cfqueryparam cfsqltype=CF_SQL_TIME
Value=#TimeFormat(CreateODBCTime(Form.RegistrationStartTime
), 'h:mm tt')#,
 /CFIF

 CFIF IsDate(Form.DismissalTime)
 cfqueryparam cfsqltype=CF_SQL_TIME
Value=#TimeFormat(CreateODBCTime(Form.DismissalTime), 'h:mm tt')#,
 /CFIF

 cfqueryparam cfsqltype=CF_SQL_INTEGER
Value=#Form.SpacesAvailable#

 /CFQUERY





~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:230446
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


RE: Can anyone spot a problem with this query?

2006-01-25 Thread Rick Faircloth
Thanks for the reply, Randy...

 there would be more than one records
 with the same
 Set of values.

The table is empty...I'm trying to add the first record.
The only key of any type is the CampWeekID, which
is the Primary Key...no Foreign Keys or Indexes...

Rick


 -Original Message-
 From: Adkins, Randy [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, January 25, 2006 4:27 PM
 To: CF-Talk
 Subject: RE: Can anyone spot a problem with this query?
 
 
 Constraint Violation beans that there would be more than one records
 with the same
 Set of values. Check your Primary Keys and Indexes.
  
 
 -Original Message-
 From: Rick Faircloth [mailto:[EMAIL PROTECTED] 
 Sent: Wednesday, January 25, 2006 4:17 PM
 To: CF-Talk
 Subject: Can anyone spot a problem with this query?
 
 MySQL is giving me an ODBC Error Code = 23000 (Integrity contraint
 violation) and says I have an error in my SQL syntax...I can't find
 it...data being sent from form fields has been tested an appear to be in
 proper form...I can't figure out why it's getting heartburn over this
 query...  ???
 
 Thanks,
 
 Rick
 
 CFQUERY Name=InsertCampWeek Datasource=#DSN#
 
  Insert
into campweeks
 
 (
  CampWeekName,
 
 CFIF IsDate(Trim(Form.StartDate))
  StartDate,
 /CFIF
 
 CFIF IsDate(Trim(Form.EndDate))
  EndDate,
 /CFIF
 
  DeanName,
  DeanBio,
  DeanPhoto,
  WeekDescription,
  Cost,
  Grades,
 
 CFIF IsDate(Trim(Form.RegistrationStartTime))
  RegistrationStartTime,
 /CFIF
 
 CFIF IsDate(Trim(Form.DismissalTime))
  DismissalTime,
 /CFIF
 
  SpacesAvailable
 )
 
  Values (
  cfqueryparam cfsqltype=CF_SQL_VARCHAR
 Value=#Form.CampWeekName#,
 
  CFIF IsDate(Trim(Form.StartDate))
  cfqueryparam cfsqltype=CF_SQL_DATE
 Value=#DateFormat(CreateODBCDate(ParseDateTime(Form.StartDa
 te)), 'M/D/')#,
  /CFIF
 
  CFIF IsDate(Trim(Form.EndDate))
  cfqueryparam cfsqltype=CF_SQL_DATE
 Value=#DateFormat(CreateODBCDate(ParseDateTime(Form.EndDate
 )), 'M/D/')#,
  /CFIF
 
  cfqueryparam cfsqltype=CF_SQL_VARCHAR
 Value=#Form.DeanName#,
  cfqueryparam cfsqltype=CF_SQL_LONGVARCHAR
 Value=#Form.DeanBio#,
  cfqueryparam cfsqltype=CF_SQL_VARCHAR
 Value=#Form.DeanPhoto#,
  cfqueryparam cfsqltype=CF_SQL_LONGVARCHAR
 Value=#Form.WeekDescription#,
  cfqueryparam cfsqltype=CF_SQL_DOUBLE
 Value=#LSParseCurrency(Form.Cost)#,
  cfqueryparam cfsqltype=CF_SQL_VARCHAR
 Value=#Form.Grades#,
 
  CFIF IsDate(Form.RegistrationStartTime)
  cfqueryparam cfsqltype=CF_SQL_TIME
 Value=#TimeFormat(CreateODBCTime(Form.RegistrationStartTime
 ), 'h:mm tt')#,
  /CFIF
 
  CFIF IsDate(Form.DismissalTime)
  cfqueryparam cfsqltype=CF_SQL_TIME
 Value=#TimeFormat(CreateODBCTime(Form.DismissalTime), 'h:mm tt')#,
  /CFIF
 
  cfqueryparam cfsqltype=CF_SQL_INTEGER
 Value=#Form.SpacesAvailable#
 
  /CFQUERY
 
 
 
 
 
 

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:230448
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


Re: Can anyone spot a problem with this query?

2006-01-25 Thread Rodney Enke
You're missing the closing parenthesis ')' after the last queryparam.

-
Rod


On 1/25/06, Rick Faircloth [EMAIL PROTECTED] wrote:

 MySQL is giving me an ODBC Error Code = 23000 (Integrity
 contraint violation)
 and says I have an error in my SQL syntax...I can't find
 it...data being sent
 from form fields has been tested an appear to be in proper
 form...I can't figure
 out why it's getting heartburn over this query...  ???

 Thanks,

 Rick

 CFQUERY Name=InsertCampWeek Datasource=#DSN#

  Insert
into campweeks

 (
  CampWeekName,

 CFIF IsDate(Trim(Form.StartDate))
  StartDate,
 /CFIF

 CFIF IsDate(Trim(Form.EndDate))
  EndDate,
 /CFIF

  DeanName,
  DeanBio,
  DeanPhoto,
  WeekDescription,
  Cost,
  Grades,

 CFIF IsDate(Trim(Form.RegistrationStartTime))
  RegistrationStartTime,
 /CFIF

 CFIF IsDate(Trim(Form.DismissalTime))
  DismissalTime,
 /CFIF

  SpacesAvailable
 )

  Values (
  cfqueryparam cfsqltype=CF_SQL_VARCHAR
 Value=#Form.CampWeekName#,

  CFIF IsDate(Trim(Form.StartDate))
  cfqueryparam cfsqltype=CF_SQL_DATE
 Value=#DateFormat(CreateODBCDate(ParseDateTime(Form.StartDa
 te)), 'M/D/')#,
  /CFIF

  CFIF IsDate(Trim(Form.EndDate))
  cfqueryparam cfsqltype=CF_SQL_DATE
 Value=#DateFormat(CreateODBCDate(ParseDateTime(Form.EndDate
 )), 'M/D/')#,
  /CFIF

  cfqueryparam cfsqltype=CF_SQL_VARCHAR
 Value=#Form.DeanName#,
  cfqueryparam cfsqltype=CF_SQL_LONGVARCHAR
 Value=#Form.DeanBio#,
  cfqueryparam cfsqltype=CF_SQL_VARCHAR
 Value=#Form.DeanPhoto#,
  cfqueryparam cfsqltype=CF_SQL_LONGVARCHAR
 Value=#Form.WeekDescription#,
  cfqueryparam cfsqltype=CF_SQL_DOUBLE
 Value=#LSParseCurrency(Form.Cost)#,
  cfqueryparam cfsqltype=CF_SQL_VARCHAR
 Value=#Form.Grades#,

  CFIF IsDate(Form.RegistrationStartTime)
  cfqueryparam cfsqltype=CF_SQL_TIME
 Value=#TimeFormat(CreateODBCTime(Form.RegistrationStartTime
 ), 'h:mm tt')#,
  /CFIF

  CFIF IsDate(Form.DismissalTime)
  cfqueryparam cfsqltype=CF_SQL_TIME
 Value=#TimeFormat(CreateODBCTime(Form.DismissalTime), 'h:mm
 tt')#,
  /CFIF

  cfqueryparam cfsqltype=CF_SQL_INTEGER
 Value=#Form.SpacesAvailable#

  /CFQUERY



 

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:230457
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


RE: Can anyone spot a problem with this query?

2006-01-25 Thread Rick Faircloth
Unbelievable...

Thanks, Rodney!

Rick


 -Original Message-
 From: Rodney Enke [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, January 25, 2006 6:10 PM
 To: CF-Talk
 Subject: Re: Can anyone spot a problem with this query?
 
 
 You're missing the closing parenthesis ')' after the last queryparam.
 
 -
 Rod
 
 
 On 1/25/06, Rick Faircloth [EMAIL PROTECTED] wrote:
 
  MySQL is giving me an ODBC Error Code = 23000 (Integrity
  contraint violation)
  and says I have an error in my SQL syntax...I can't find
  it...data being sent
  from form fields has been tested an appear to be in proper
  form...I can't figure
  out why it's getting heartburn over this query...  ???
 
  Thanks,
 
  Rick
 
  CFQUERY Name=InsertCampWeek Datasource=#DSN#
 
   Insert
 into campweeks
 
  (
   CampWeekName,
 
  CFIF IsDate(Trim(Form.StartDate))
   StartDate,
  /CFIF
 
  CFIF IsDate(Trim(Form.EndDate))
   EndDate,
  /CFIF
 
   DeanName,
   DeanBio,
   DeanPhoto,
   WeekDescription,
   Cost,
   Grades,
 
  CFIF IsDate(Trim(Form.RegistrationStartTime))
   RegistrationStartTime,
  /CFIF
 
  CFIF IsDate(Trim(Form.DismissalTime))
   DismissalTime,
  /CFIF
 
   SpacesAvailable
  )
 
   Values (
   cfqueryparam cfsqltype=CF_SQL_VARCHAR
  Value=#Form.CampWeekName#,
 
   CFIF IsDate(Trim(Form.StartDate))
   cfqueryparam cfsqltype=CF_SQL_DATE
  Value=#DateFormat(CreateODBCDate(ParseDateTime(Form.StartDa
  te)), 'M/D/')#,
   /CFIF
 
   CFIF IsDate(Trim(Form.EndDate))
   cfqueryparam cfsqltype=CF_SQL_DATE
  Value=#DateFormat(CreateODBCDate(ParseDateTime(Form.EndDate
  )), 'M/D/')#,
   /CFIF
 
   cfqueryparam cfsqltype=CF_SQL_VARCHAR
  Value=#Form.DeanName#,
   cfqueryparam cfsqltype=CF_SQL_LONGVARCHAR
  Value=#Form.DeanBio#,
   cfqueryparam cfsqltype=CF_SQL_VARCHAR
  Value=#Form.DeanPhoto#,
   cfqueryparam cfsqltype=CF_SQL_LONGVARCHAR
  Value=#Form.WeekDescription#,
   cfqueryparam cfsqltype=CF_SQL_DOUBLE
  Value=#LSParseCurrency(Form.Cost)#,
   cfqueryparam cfsqltype=CF_SQL_VARCHAR
  Value=#Form.Grades#,
 
   CFIF IsDate(Form.RegistrationStartTime)
   cfqueryparam cfsqltype=CF_SQL_TIME
  Value=#TimeFormat(CreateODBCTime(Form.RegistrationStartTime
  ), 'h:mm tt')#,
   /CFIF
 
   CFIF IsDate(Form.DismissalTime)
   cfqueryparam cfsqltype=CF_SQL_TIME
  Value=#TimeFormat(CreateODBCTime(Form.DismissalTime), 'h:mm
  tt')#,
   /CFIF
 
   cfqueryparam cfsqltype=CF_SQL_INTEGER
  Value=#Form.SpacesAvailable#
 
   /CFQUERY
 
 
 
  
 
 

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:230459
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54