An Introduction to Class::DBI - Comparing DBI and Class::DBI 10

SQL tasks and their Class::DBI equivalents

Updating Records

  • SQL

        UPDATE nomination
            SET type  = 'Best Visual Effects',
                year  = '1999'
             film_id  = 45
          WHERE   id  = 1
    
  • Class::DBI

        $nomination = Nomination->retrieve(1);
        $nomination->type('Best Visual Effects');
        $nomination->year(1999);
    
        $nomination->update;
    

continued...

 

YAPC::Canada << Previous | Index | Next >>
Copyright © 2003 Michael Graham