Understanding INSERT

Now that you’ve successfully inserted a row using the SQL INSERT statement, take a minute to look at the statement’s syntax.

The first line of your statement reads:

INSERT INTO Directors(FirstName, LastName)

The text immediately following the INTO keyword is the name of the table into which the new row is being inserted—in this case, the Directors table.

Next, the columns being added are specified. The columns are listed within parentheses, and since multiple columns are specified, they are separated by a comma. A row in the Directors table requires both a FirstName and a LastName, so the INSERT statement specifies both columns.

Note

When you insert a row into a table, you can provide values for as few or as many columns ...

Get Adobe ColdFusion 8 Web Application Construction Kit, Volume 1: Getting Started now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.