1 | Deleting data in a database can be done with a single delete page. The delete page contains a CFQUERY tag with a SQL delete statement. |
2 | SQL delete statement is: |
3 | DELETE FROM tablename WHERE condition |
4 | |
5 | <!-- Page to delete single employee record --> |
6 | <CFQUERY NAME="DeleteEmployee" |
7 | DATASOURCE="CF 3.0 Examples"> |
8 | DELETE FROM Employees |
9 | WHERE Employee_ID = #URL.EmployeeID# |
10 | </CFQUERY> |
11 | |
12 | <HTML> |
13 | <HEAD><TITLE>Delete Employee Record</TITLE></HEAD> |
14 | <H3>The employee record has been deleted.</H3> |
15 | </HTML> |