Skip to content

Instantly share code, notes, and snippets.

Created February 6, 2012 22:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/1755216 to your computer and use it in GitHub Desktop.
Save anonymous/1755216 to your computer and use it in GitHub Desktop.
$session->db->dbh->begin_work;
$session->db->dbh->do(qq{ CREATE TEMPORARY TABLE user_temp SELECT userId, username FROM users } );
$session->db->dbh->do(qq{ INSERT INTO user_temp SELECT 'foo', 'bar' } );
my $sth = $session->db->dbh->prepare( qq { SELECT * FROM user_temp } ) or die $DBI::errstr;
$sth->execute;
while( my $row = $sth->fetchrow_hashref ) {
warn Data::Dumper::Dumper $row;
}
$session->db->dbh->commit;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment