We help IT Professionals succeed at work.

SQL statement

jsctechy asked
Medium Priority
Last Modified: 2013-12-24
why am i getting an error on this page:
<title>Deleting Contact...</title>

<cfquery name = "DeleteContact" datasource = #application.dsn#>
FROM Contacts
WHERE ContactID = #url.ContactID#

<cflocation url = "deletedContact.cfm?alphaindex=#url.alphaindex#">

The error says that incorrect syntax is near *.
Watch Question

The DELETE statement in sql either does not need to specify the fields, it implicity deletes them all.

<cfquery name="DeleteContact" datasource="#application.dsn#">
  FROM Contacts
  WHERE ContactID = <cfqueryparam value="#URL.ContactID#" CFSQLType="CF_SQL_INTEGER" />

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
jsctechyInfrastructure Team Lead


how can i do that after the click is done and the deletion is been done to route the user to this page:
I'm not sure that I understand your question. It appears that to delete a person, a user would go to the page you've shown specifying an ID number in the URL, and then after the person has been deleted, they are redirected to the deletedContact.cfm page.
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.