Persistent::mSQLPersistent::mSQL is a persistent class implemented using a mSQL database. | |
Download |
Persistent::mSQL Ranking & Summary
Advertisement
- License:
- Perl Artistic License
- Price:
- FREE
- Publisher Name:
- David Winters
- Publisher web site:
- http://search.cpan.org/~dwinters/Persistent-mSQL-0.50/lib/Persistent/mSQL.pm
Persistent::mSQL Tags
Persistent::mSQL Description
Persistent::mSQL is a persistent class implemented using a mSQL database. Persistent::mSQL is a persistent class implemented using a mSQL database.SYNOPSIS use Persistent::mSQL; use English; # import readable variable names like $EVAL_ERROR eval { ### in case an exception is thrown ### ### allocate a persistent object ### my $emp = new Persistent::mSQL($data_source, undef, undef, $table); ### define attributes of the object ### $emp->add_attribute('empno', 'ID', 'Number', undef, 4); $emp->add_attribute('ename', 'Persistent', 'VarChar', undef, 10); $emp->add_attribute('job', 'Persistent', 'VarChar', undef, 9); $emp->add_attribute('mgr', 'Persistent', 'Number', undef, 4); $emp->add_attribute('hiredate', 'Persistent', 'DateTime', undef); $emp->add_attribute('sal', 'Persistent', 'Number', undef, 7, 2); $emp->add_attribute('comm', 'Persistent', 'Number', undef, 7, 2); $emp->add_attribute('deptno', 'Persistent', 'Number', undef, 2); ### query the datastore for some objects ### $emp->restore_where(qq{ sal > 1000 and job = 'CLERK' and ename LIKE 'M%' }, "sal, ename"); while ($emp->restore_next()) { printf "ename = %s, emp# = %s, sal = %s, hiredate = %sn", $emp->ename, $emp->empno, $emp->sal, $emp->hiredate; } }; if ($EVAL_ERROR) { ### catch those exceptions! ### print "An error occurred: $EVAL_ERRORn"; }ABSTRACTThis is a Persistent class that uses a mSQL database table to store and retrieve objects. This class can be instantiated directly or subclassed. The methods described below are unique to this class, and all other methods that are provided by this class are documented in the Persistent documentation. The Persistent documentation has a very thorough introduction to using the Persistent framework of classes. Requirements: · Perl
Persistent::mSQL Related Software