DBIx::Recordset

DBIx::Recordset is a Perl extension for DBI recordsets.
Download

DBIx::Recordset Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • G.Richter
  • Publisher web site:
  • http://search.cpan.org/~grichter/DBIx-Recordset-0.26/Recordset.pm

DBIx::Recordset Tags


DBIx::Recordset Description

DBIx::Recordset is a Perl extension for DBI recordsets. DBIx::Recordset is a Perl extension for DBI recordsets.SYNOPSIS use DBIx::Recordset; # Setup a new object and select some recods... *set = DBIx::Recordset -> Search ({'!DataSource' => 'dbi:Oracle:....', '!Table' => 'users', '$where' => 'name = ? and age > ?', '$values' => }) ; # Get the values of field foo ... print "First Records value of foo is $set{foo}n" ; print "Second Records value of foo is $set{foo}n" ; # Get the value of the field age of the current record ... print "Age is $set{age}n" ; # Do another select with the already created object... $set -> Search ({name => 'bar'}) ; # Show the result... print "All users with name bar:n" ; while ($rec = $set -> Next) { print $rec -> {age} ; } # Setup another object and insert a new record *set2 = DBIx::Recordset -> Insert ({'!DataSource' => 'dbi:Oracle:....', '!Table' => 'users', 'name' => 'foo', 'age' => 25 }) ; # Update this record (change age from 25 to 99)... $set -> Update ({age => 99}, {name => 'foo'}) ; DBIx::Recordset is a perl module for abstraction and simplification of database access.The goal is to make standard database access (select/insert/update/delete) easier to handle and independend of the underlying DBMS. Special attention is made on web applications to make it possible to handle the state-less access and to process the posted data of formfields, but DBIx::Recordset is not limited to web applications.DBIx::Recordset uses the DBI API to access the database, so it should work with every database for which a DBD driver is available (see also DBIx::Compat).Most public functions take a hash reference as parameter, which makes it simple to supply various different arguments to the same function. The parameter hash can also be taken from a hash containing posted formfields like those available with CGI.pm, mod_perl, HTML::Embperl and others.Before using a recordset it is necessary to setup an object. Of course the setup step can be made with the same function call as the first database access, but it can also be handled separately.Most functions which set up an object return a typglob. A typglob in Perl is an object which holds pointers to all datatypes with the same name. Therefore a typglob must always have a name and can't be declared with my. You can only use it as global variable or declare it with local. The trick for using a typglob is that setup functions can return a reference to an object, an array and a hash at the same time.The object is used to access the object's methods, the array is used to access the records currently selected in the recordset and the hash is used to access the current record.If you don't like the idea of using typglobs you can also set up the object, array and hash separately, or just set the ones you need. Requirements: · Perl


DBIx::Recordset Related Software