SQL statement

Posted on 2006-03-30
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 *.
Question by:jsctechy
    LVL 12

    Accepted Solution

    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" />
    LVL 1

    Author Comment

    how can i do that after the click is done and the deletion is been done to route the user to this page:
    LVL 12

    Expert Comment

    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.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Top 6 Sources for Identifying Threat Actor TTPs

    Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

    Suggested Solutions

    Article by: kevp75
    Hey folks, 'bout time for me to come around with a little tip. Thanks to IIS 7.5 Extensions and Microsoft (well... really Windows 8, and IIS 8 I guess...), we can now prime our Application Pools, when IIS starts. Now, though it would be nice t…
    When it comes to showing a 404 error page to your visitors, you do not want that generic page to show, and you especially do not want your hosting provider’s ad error page to show either. In this article, I will show you how to enable the custom 40…
    This video discusses moving either the default database or any database to a new volume.
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now