Link to home
Create AccountLog in
Avatar of JohnLucania
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.Phone,'[^0-9]','','all')#" cfsqltype="CF_SQL_VARCHAR" />,
     '#form.DOB#',
     '#form.Lift#',  
     '#form.Limits#',  
     '#form.Comments#',
     '#form.Directions#',
     '#form.EmerContact#',  
     <cfqueryparam value="#REReplace(form.EmerPhone,'[^0-9]','','all')#" cfsqltype="CF_SQL_VARCHAR" />,
     <cfqueryparam value="#REReplace(form.EmerPhone1,'[^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\VanProgram\NewClientInsert.cfm: line 54
 
52 :      '#form.EmerContact#',  
53 :      <cfqueryparam value="#REReplace(form.EmerPhone,'[^0-9]','','all')#" cfsqltype="CF_SQL_VARCHAR" />,
54 :      <cfqueryparam value="#REReplace(form.EmerPhone1,'[^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)  
ASKER CERTIFIED SOLUTION
Avatar of RCorfman
RCorfman

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
Avatar of JohnLucania
JohnLucania

ASKER

yup :-)