Basic HTML version of Foils prepared May 3 1998

Foil 42 Creating an Insert Page with CFQUERY

From Java Blend and Cold Fusion High Level Database Interfaces CPS616 Web Technologies -- Spring 98. by Chao Wei Ou


1 Basic SQL insert statement is:
2 INSERT INTO tablename (columnnames) VALUES (values)
3
4 The VALUES keyword specifies the values for the columns in the new row. You have to type the values you want to add in the same order as the columns in the columnnames section of the statement.
5 To insert the form data from the example above with a CFQUERY use this syntax:
6 <CFQUERY NAME="AddEmp" DATASOURCE="CF 3.0 Examples">
7 INSERT INTO Employees (FirstName, LastName, Phone)
8 VALUES ('#Form.FirstName#', '#Form.LastName#',
9 '#Form.Phone#')
10 </CFQUERY>

in Table To:


© Northeast Parallel Architectures Center, Syracuse University, npac@npac.syr.edu

If you have any comments about this server, send e-mail to webmaster@npac.syr.edu.

Page produced by wwwfoil on Sat Nov 28 1998