home *** CD-ROM | disk | FTP | other *** search
/ Computer Shopper 139 / dpcs0999.iso / Web / CFserver / data1.cab / Examples / employee / InsertAction.cfm < prev    next >
Encoding:
Text File  |  1999-04-12  |  846 b   |  32 lines

  1. <!--- This INSERT statement does the actual adding
  2.     of the data to the database; notice that the
  3.     SQL statement contains Cold Fusion #variables# --->
  4. <CFQUERY DATASOURCE="CFexamples" NAME="InsertEmployee">
  5. INSERT INTO EmpEmployees
  6. (FirstName,
  7.     LastName,
  8.     Title,
  9.     DepartmentID,
  10.     Temporary,
  11.     Email,
  12.     <CFIF Form.StartDate NEQ "">StartDate,</CFIF>
  13.     Phone)
  14. VALUES ('#Form.FirstName#',
  15.     '#Form.LastName#',
  16.     '#Form.Title#',
  17.     #Val(Form.DepartmentID)#, 
  18.     <!--- "Temporary" was an input of type
  19.         CHECKBOX, which is either TRUE or
  20.         does not exist at all --->
  21.     <CFIF IsDefined("Form.Temporary")>
  22.         TRUE,
  23.     <CFELSE>
  24.         FALSE,
  25.     </CFIF>
  26.     '#Form.Email#',
  27.     <CFIF Form.StartDate NEQ "">#CreateODBCDate(Form.StartDate)#,</CFIF>
  28.     '#Form.Phone#')
  29. </CFQUERY>
  30.  
  31. <!--- Go back to the Add Employee page --->
  32. <CFLOCATION URL="InsertForm.cfm">