1 create 2 subroutines 2 use these subroutines to generate sql 3 connect to the database 4 obtain database and statement handles 5 commit the record to database.