December 2002
Beginner
640 pages
16h 41m
English
Now that you've mastered creating a Perl script and connecting to and disconnecting from your database, you're ready to do some simple database queries.
DBI has a number of methods (shown in Table 12.1) that help you handle a query that returns a resultset.
Table 12.1 shows the methods for running queries, which you will learn how to use.
| DBI Method | Meaning |
|---|---|
| $sth = $dbh->prepare ($statement); | Prepare query |
| $rv = $sth->execute (); | Execute query |
| $rv = $dbh->do ($statement); | Prepare and execute query, and finish |
| $rv = $dbh->do ($statement, %attr); | Prepare and execute query, and finish (with extra attributes) |