Avatar of LelloLello
LelloLello
 asked on

ODBC Error Code = 23000 (Integrity constraint violation)

My code is working fine but the insert is not going into the table why?
i'm having the following ODBC Error Code 230000

My ID is unique...

<!--- Insert a record of the Transaction in the Database --->
 						<cfquery name="InsertUserInfo" datasource="#application.datasource#" username="#application.username#" password="#application.password#" maxrows=25>
						INSERT INTO 
						tblC(dteDate, Name, Amount, Confirmation_Num, Invoice, CardNum, Data, Event)   
						Values('#DateFormat(NOW())#','#strBadgeName#','#intTotal#',
						<cfif CreditCard EQ "Yes"> 
						'#RESULT#',
						'#intReceiptID#',
						'#Mid(Form.intCardNo, 1, Len(Form.intCardNo)-4)#',				
						<cfelse>
						'','','',
						</cfif>
						'#text_to_insert#', 'CIA Network Subscription 2012') 
						
						</cfquery> 

Open in new window


My SQL Table

id  int  not allow nulls
dteDate datetime allownulls
name varchar 255 allow nulls
amount
Confirmation_num
Invoice
CardNum
Data
Event
Twelvedigits varchar50
ColdFusion Language

Avatar of undefined
Last Comment
LelloLello

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
gdemaria

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
SOLUTION
SidFishes

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
SOLUTION
Log in to continue reading
Log In
Sign up - Free for 7 days
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
SidFishes

ha yes you're right bad suggestion (slaps self on wrist) possible do do safely but you do have to know what you're doing. Far easier to simply change the ID to autoInc.

A note about autoincrement. If you are using an autoincrement ID for a userid or something similiar it's important to not rely on that exclusively for things like displaying information via url variable or hidden form variables.

If you have sequential numbers and no other checks (such as against a session id set at login, it is simple to change a user id in a url or hidden form value to view another users information.

And in case you don't think this is a problem, it affects a major US govt website that we use on a regular basis. I've reported it twice but they still (last time I checked) haven't fixed it. The information disclosure isn't very sensitive but it should never happen.
LelloLello

ASKER
You are the experts !! Thank you i saw the error on the increment in SQL. ... but i have a question on this form.

http://209.217.127.200/jp/registration_13_e_.cfm 

Right now i have two option.
Fellows, Affiliates or Correspondents of an actuarial organization or CFA members   100.00*
 
Associates of an actuarial organization   $525*

If i take out this line 'Associates of an actuarial organization   $525* ' my form tax calculations will not work and no one is able to know the problem so i will post the question pls help me.
http://209.217.127.200/jp/registration_14_e_.cfm 


Associates of an actuarial organization   $525*  


Please help me on that question... thank you.
https://www.experts-exchange.com/Web_Development/Web_Languages-Standards/Cold_Fusion_Markup_Language/Q_27729200.html
LelloLello

ASKER
Looking forward for your advice on my other question.
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck