| Win32-SqlServer-DTS documentation | Contained in the Win32-SqlServer-DTS distribution. |
Win32::SqlServer::DTS::Package::Step::Result - a Perl class to represent a DTS Package Step execution result.
use Win32::SqlServer::DTS::Package::Step::Result;
Win32::SqlServer::DTS::Package::Step::Result does not exists in the regular MS SQL Server DTS 2000 API.
Nothing.
Instantiates a new Win32::SqlServer::DTS::Package::Step::Result. Expects as a parameter a hash reference with the following keys:
Returns the DTS:Package::Step::Result as a pure text content. Useful for simple reports.
Returns the DTS:Package::Step::Result as an XML content.
Returns true if the step was executed successfully.
Win32::SqlServer::DTS::Package::Step documentation.Alceu Rodrigues de Freitas Junior, <arfreitas@cpan.org>
Copyright (C) 2008 by Alceu Rodrigues de Freitas Junior
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.
| Win32-SqlServer-DTS documentation | Contained in the Win32-SqlServer-DTS distribution. |
package Win32::SqlServer::DTS::Package::Step::Result;
use 5.008008; use strict; use warnings; use base qw(Class::Accessor); use Carp qw(confess); use XML::Simple; use Params::Validate qw(validate :types); use Hash::Util qw(lock_keys); __PACKAGE__->follow_best_practice(); __PACKAGE__->mk_ro_accessors( qw(exec_status step_name error_code source description)); our $VERSION = '0.01';
sub new { my $class = shift; validate( @_, { error_code => { type => SCALAR }, source => { type => SCALAR }, description => { type => SCALAR }, step_name => { type => SCALAR }, is_success => { type => SCALAR, regex => qr/[10]{1}/ }, exec_status => { type => SCALAR } } ); my $self = shift; bless $self, $class; lock_keys( %{$self} ); return $self; }
sub to_string { my $self = shift; my @attrib_names = keys( %{$self} ); my $string; foreach my $attrib_name (@attrib_names) { $string .= "$attrib_name => $self->{$attrib_name}\n"; } return $string; }
sub to_xml { my $self = shift; my $xs = XML::Simple->new(); return $xs->XMLout($self); }
sub is_success { my $self = shift; return $self->{is_success}; } 1; __END__