Click here to get back home

Proposed Name Space DBIx::CopyRecords

 HomeNewsGroups | Search | About
 comp.lang.perl.modules    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
Proposed Name Space DBIx::CopyRecords jck000@gmail.com 12-31-2006
Posted by jck000@gmail.com on December 31, 2006, 2:18 pm
Please log in for more thread options



This is a request for comments and opinions concerning a module I have
recently developed.

The module is designed to copy a set of related records in as many
tables as you specify. It's useful if you have a system where you need
several generations of the same records. For example, in a company at
which I worked, we made copies of credit report data and allowed the
user to edit the newest copy. This module would be useful for that.

use CopyRecords;

# connect
my $dbh = DBI->connect('dbi:MySQL:','login','password');
my $CR = DBIx::CopyRecords->new($dbh);

$CR->copyrecords(
{ table_name => 'invoice',
primary_key => 'invoice_number',
primary_key_value => 'nextvalue',
child => [ { table_name => products,
primary_key => line_item_id,
primary_key_value => NULL,
foreign_key => invoice_number },
{ table_name => services,
primary_key => line_item_id,
primary_key_value => NULL,
foreign_key => invoice_number } ]
});

# disconnect database
$dbh->disconnect;


Thanks.

Jack


Similar ThreadsPosted
A question of name space October 31, 2004, 2:55 pm
RFC: DBIx::ETL or DBIx::replicate November 20, 2006, 4:41 pm
New module proposed: XML::FOP May 25, 2005, 2:26 pm
Proposed Module: Compress::AsciiFlate March 10, 2006, 6:37 am
Proposed module: Number::NaryPP March 10, 2006, 6:46 am
Proposed module: Music::ChordNamer March 14, 2006, 1:57 pm
Naming consultation request (proposed Geo::ReadGRIB) April 25, 2006, 2:35 pm
RFC: proposed CPAN module CGI::Carp::Throw August 22, 2008, 11:01 am
Request for feedback: proposed new modules to aid VHDL projects February 24, 2006, 9:49 am
DBIx::Hash2Table V 2.00 July 29, 2004, 7:16 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap