UPDATE table SET column_name = expression [WHERE search_conditions]
UPDATE title SET price = price * 0.8 WHERE price > 100
UPDATE title SET edition = "1st", price = price * 1.05 WHERE edition = "1th"
$rows_updated = $sth->rows;
$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";
Which columns in a table can be modified by the UPDATE statement?
|
Dan Keller Technical Services 4500 19th St., San Francisco California, USA 94114 tel: 415 / 861-4500 |