UPDATE

UPDATE is used to modify an existing record. If you have a record in your database, with a person’s name, for instance, and that person’s name changes, you can use an UPDATE statement to modify the name in the table.

UPDATE table_name SET lastname=’Smith’ WHERE lastname=’Michalski’;

Note 

Obviously, this appendix doesn’t cover all the SQL statements and all their options, but we’ve covered the ones that make up the vast majority of actual SQL queries that you’d need to run. The statements discussed here are those you will come across most of the time when working with Perl on a MySQL database.

The documentation at http://www.mysql.com is an up-to-date, valuable resource for working with MySQL databases. The site contains exhaustive documentation on every aspect of MySQL, including a complete SQL reference.



Perl Database Programming
Perl Database Programming
ISBN: 0764549561
EAN: 2147483647
Year: 2001
Pages: 175

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net