UPDATE Syntax

The WHERE Clause

Examples

What Happened

Example

$sth = $dbh->prepare( qq{ UPDATE title SET price = price * 0.8 WHERE price > 100 } );
$sth->execute or die "Failed to execute: $DBI::errstr\n";
$rows_updated = $sth->rows;
print "I just updated $rows_updated rows\n";

Review

Which columns in a table can be modified by the UPDATE statement?

 
Dan Keller Technical Services © 2000