JohnLucania
asked on
cfqueryparam: Incorrect syntax near '@P3'.
What is wrong with this?
<cfquery name="ClientNewInsert" datasource="VanProgram">
Insert into Clients (ClientID,
Title,
FirstName,
LastName,
MI,
Address,
Apt,
City,
State,
Zip,
Phone,
DOB,
Lift,
Limits,
Comments,
Directions,
EmerContact,
EmerPhone,
EmerPhone1)
values
(#TheNextClientID#,
'#form.Title#',
'#form.FirstName#',
'#form.LastName#',
'#form.MI#',
'#form.Address#',
'#form.Apt#',
'#form.City#',
'OH',
'#form.Zip#',
<cfqueryparam value="#REReplace(form.Pho ne,'[^0-9] ','','all' )#" cfsqltype="CF_SQL_VARCHAR" />,
'#form.DOB#',
'#form.Lift#',
'#form.Limits#',
'#form.Comments#',
'#form.Directions#',
'#form.EmerContact#',
<cfqueryparam value="#REReplace(form.Eme rPhone,'[^ 0-9]','',' all')#" cfsqltype="CF_SQL_VARCHAR" />,
<cfqueryparam value="#REReplace(form.Eme rPhone1,'[ ^0-9]','', 'all')#" cfsqltype="CF_SQL_VARCHAR" />
</cfquery>
Error Executing Database Query.
[Macromedia][SQLServer JDBC Driver][SQLServer]Line 39: Incorrect syntax near '@P3'.
The error occurred in D:\Inetpub\wwwroot\VanProg ram\NewCli entInsert. cfm: line 54
52 : '#form.EmerContact#',
53 : <cfqueryparam value="#REReplace(form.Eme rPhone,'[^ 0-9]','',' all')#" cfsqltype="CF_SQL_VARCHAR" />,
54 : <cfqueryparam value="#REReplace(form.Eme rPhone1,'[ ^0-9]','', 'all')#" cfsqltype="CF_SQL_VARCHAR" />
55 : </cfquery>
56 :
-------------------------- ---------- ---------- ---------- ---------- ---------- ----
SQL Insert into Clients (ClientID, Title, FirstName, LastName, MI, Address, Apt, City, State, Zip, Phone, DOB, Lift, Limits, Comments, Directions, EmerContact, EmerPhone, EmerPhone1) values (3915, 'DR', 'Test1', 'Test1', 'T', '1234 Test way', '', 'BEREA', 'OH', '41032', (param 1) , '01/01/1950', 'Yes', 'BRING WHEELCHAIR WITH', 'Test', 'test', 'Father', (param 2) , (param 3)
<cfquery name="ClientNewInsert" datasource="VanProgram">
Insert into Clients (ClientID,
Title,
FirstName,
LastName,
MI,
Address,
Apt,
City,
State,
Zip,
Phone,
DOB,
Lift,
Limits,
Comments,
Directions,
EmerContact,
EmerPhone,
EmerPhone1)
values
(#TheNextClientID#,
'#form.Title#',
'#form.FirstName#',
'#form.LastName#',
'#form.MI#',
'#form.Address#',
'#form.Apt#',
'#form.City#',
'OH',
'#form.Zip#',
<cfqueryparam value="#REReplace(form.Pho
'#form.DOB#',
'#form.Lift#',
'#form.Limits#',
'#form.Comments#',
'#form.Directions#',
'#form.EmerContact#',
<cfqueryparam value="#REReplace(form.Eme
<cfqueryparam value="#REReplace(form.Eme
</cfquery>
Error Executing Database Query.
[Macromedia][SQLServer JDBC Driver][SQLServer]Line 39: Incorrect syntax near '@P3'.
The error occurred in D:\Inetpub\wwwroot\VanProg
52 : '#form.EmerContact#',
53 : <cfqueryparam value="#REReplace(form.Eme
54 : <cfqueryparam value="#REReplace(form.Eme
55 : </cfquery>
56 :
--------------------------
SQL Insert into Clients (ClientID, Title, FirstName, LastName, MI, Address, Apt, City, State, Zip, Phone, DOB, Lift, Limits, Comments, Directions, EmerContact, EmerPhone, EmerPhone1) values (3915, 'DR', 'Test1', 'Test1', 'T', '1234 Test way', '', 'BEREA', 'OH', '41032', (param 1) , '01/01/1950', 'Yes', 'BRING WHEELCHAIR WITH', 'Test', 'test', 'Father', (param 2) , (param 3)
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER