Tie::DBITie::DBI is a Perl module with tie hashes to DBI relational databases. | |
Download |
Tie::DBI Ranking & Summary
Advertisement
- License:
- Perl Artistic License
- Price:
- FREE
- Publisher Name:
- Lincoln Stein
- Publisher web site:
- http://search.cpan.org/~lds/Crypt-CBC-2.29/CBC.pm
Tie::DBI Tags
Tie::DBI Description
Tie::DBI is a Perl module with tie hashes to DBI relational databases. Tie::DBI is a Perl module with tie hashes to DBI relational databases.SYNOPSIS use Tie::DBI; tie %h,'Tie::DBI','mysql:test','test','id',{CLOBBER=>1}; tie %h,'Tie::DBI',{db => 'mysql:test', table => 'test', key => 'id', user => 'nobody', password => 'ghost', CLOBBER => 1}; # fetching keys and values @keys = keys %h; @fields = keys %{$h{$keys}}; print $h{'id1'}->{'field1'}; while (($key,$value) = each %h) { print "Key = $key:n"; foreach (sort keys %$value) { print "t$_ => $value->{$_}n"; } } # changing data $h{'id1'}->{'field1'} = 'new value'; $h{'id1'} = { field1 => 'newer value', field2 => 'even newer value', field3 => "so new it's squeaky clean" }; # other functions tied(%h)->commit; tied(%h)->rollback; tied(%h)->select_where('price > 1.20'); @fieldnames = tied(%h)->fields; $dbh = tied(%h)->dbh;This module allows you to tie Perl associative arrays (hashes) to SQL databases using the DBI interface. The tied hash is associated with a table in a local or networked database. One column becomes the hash key. Each row of the table becomes an associative array, from which individual fields can be set or retrieved. Requirements: · Perl
Tie::DBI Related Software