"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "lib/DBIx/dbMan/Extension/SQLOutputInsert.pm" between
dbMan-0.45.tar.gz and dbMan-0.46.tar.gz

About: dbMAN provides some functionality in database managing (SQL shell/console).

SQLOutputInsert.pm  (dbMan-0.45):SQLOutputInsert.pm  (dbMan-0.46)
package DBIx::dbMan::Extension::SQLOutputInsert; package DBIx::dbMan::Extension::SQLOutputInsert;
use strict; use strict;
use base 'DBIx::dbMan::Extension'; use base 'DBIx::dbMan::Extension';
our $VERSION = '0.05'; our $VERSION = '0.06';
1; 1;
sub IDENTIFICATION { return "000001-000070-000005"; } sub IDENTIFICATION { return "000001-000070-000006"; }
sub preference { return 0; } sub preference { return 0; }
sub known_actions { return [ qw/SQL_OUTPUT/ ]; } sub known_actions { return [ qw/SQL_OUTPUT/ ]; }
sub init { sub init {
my $obj = shift; my $obj = shift;
$obj->{-mempool}->register('output_format','insert'); $obj->{-mempool}->register('output_format','insert');
} }
sub done { sub done {
my $obj = shift; my $obj = shift;
$obj->{-mempool}->deregister('output_format','insert'); $obj->{-mempool}->deregister('output_format','insert');
if ($obj->{-mempool}->get('output_format') eq 'insert') { if ($obj->{-mempool}->get('output_format') eq 'insert') {
my @all_formats = $obj->{-mempool}->get_register('output_format') ; my @all_formats = $obj->{-mempool}->get_register('output_format') ;
$obj->{-mempool}->set('output_format',$all_formats ? $all_formats [0] : ''); $obj->{-mempool}->set('output_format', @all_formats ? $all_format s[0] : '');
} }
} }
sub handle_action { sub handle_action {
my ($obj,%action) = @_; my ($obj,%action) = @_;
$action{processed} = 1; $action{processed} = 1;
if ($action{action} eq 'SQL_OUTPUT') { if ($action{action} eq 'SQL_OUTPUT') {
if ($obj->{-mempool}->get('output_format') eq 'insert') { if ($obj->{-mempool}->get('output_format') eq 'insert') {
my $begin = 'INSERT INTO new_table ('.join(',',@{$action{ fieldnames}}).') VALUES ('; my $begin = 'INSERT INTO new_table ('.join(',',@{$action{ fieldnames}}).') VALUES (';
 End of changes. 3 change blocks. 
3 lines changed or deleted 3 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)