DBIx::Simple::ProcedureAn Alternative To SQL Stored Procedures using DBIx::Simple | |
Download |
DBIx::Simple::Procedure Ranking & Summary
Advertisement
- License:
- Perl Artistic License
- Price:
- FREE
- Publisher Name:
- Al Newkirk
- Publisher web site:
- http://search.cpan.org/~awncorp/
DBIx::Simple::Procedure Tags
DBIx::Simple::Procedure Description
An Alternative To SQL Stored Procedures using DBIx::Simple DBIx::Simple::Procedure is a Perl module that allows your program to process text files containing one or many commands that execute SQL statements sequentially. Please keep in mind that DBIx::Simple::Procedure is an alternative to database stored procedures and not a replacement or emulation of them. Essentially it is an interface to execute and return data from multiple queries.Here is an example of how to setup and process a (sql) text file. # DBIx::Simple::Procedure uses DBIx::Simple and provides an accessor through the DBIx::Simple::Procedure->{dbix} hash reference. use DBIx::Simple::Procedure; my $db = DBIx::Simple::Procedure->new($path_to_sqlfiles, 'dbi:SQLite:dbname=file.dat'); # Will error out using DBIx::Simple if a connection error occurs. # The queue function takes one parameter (a text file) that contains DBIx::Simple::Procedure # sql commands. # The process_queue function processes all queued sql statements using the parameters passed # to it, similar to the execute function of DBI. $db->queue($sql_file)->process_queue(@sql_parameters, {other_param_a => 'excepts_hashrefs_also'}); # The cache function returns an array of resultsets, or the resultset of the index passed, # return by the select statements encountered in the sql file. # Note! files included using the "include" command will not have there resultsets cached, # even if a "capture" command is encountered, only the select statement(s) found in the # initial sql file are cached in the order they are encountered. foreach my $result (@{$db->cache(0)}){ # do something with the records of the first resultset $result->{...}; } Requirements: · Perl
DBIx::Simple::Procedure Related Software