Win32::SqlServer::DTS::Package::Step - a Perl class to access Microsoft SQL Server 2000 DTS Package's steps
use Win32::SqlServer::DTS::Package::Step; # previously Win32::SqlServer::DTS::Package recovered my $steps = $package->get_sibling()->Steps; foreach my $step ( in( $steps ) ) { my $new_step = Win32::SqlServer::DTS::Package::Step->new($step); print $new_step->get_exec_status(), "\n"; }
Win32::SqlServer::DTS::Package::Step implements the DTS Package Step class in Perl. It implements all features of the original class, offering pure Perl interface with some additional methods to easy of use.
Win32::SqlServer::DTS::Package::Step
You probably will want to deal with this class internals only if you need to extended it or fix a bug. Otherwise, keep to fetching Win32::SqlServer::DTS::Package::Step objects directly from a Win32::SqlServer::DTS::Package object.
Win32::SqlServer::DTS::Package
Nothing.
Instantiates a new Win32::SqlServer::DTS::Package::Step object. Expects as a parameter the original DTS Package Step.
Almost all attributes from the original objects (Step and Step2) were implement, except the Parent attribute. This class has a hash that defines the convertion from the original attributes names to those implements in Win32::SqlServer::DTS::Package::Step. It's possible to check them out by looking at the %attrib_convertion hash.
%attrib_convertion
Win32::SqlServer::DTS::Package::Step inherits all methods defined in the DTS class.
DTS
The following attributes have their get_/set_ methods available (for example, name attribute will have a get_name and set_name methods):
get_
set_
name
get_name
set_name
task_name
script_lang
activex
description
func_name
The following attributes are read only, so they will have only get_ attributes:
exec_status_code
start_time
exec_time
finish_time
exec_result
Returns true if the step is disabled or false otherwise.
Disables the step.
Abort program execution if the _sibling attribute is not defined.
_sibling
Enables the step. This changes the Win32::SqlServer::DTS::Package object, that must have it's appropriate methods to save it's state back to the server (or file).
"Private" method. It expects a attribute name as a parameter (string) and returns a default error message when trying to update the original Step object when the _sibling attribute is not defined.
Overriding Class::Accessor method to check for _sibling attribute. This is used internally by the module and should not be used unless the behaviour of the class must be changed.
Same as GetExecutionErrorInfo method from the original DTS Step object.
Returns a Win32::SqlServer::DTS::Package::Step::Result object. It will fail if the sibling object is not available.
Win32::SqlServer::DTS::Package::Step::Result
Returns a string telling the execution status instead of a numeric code as get_exec_status_code does.
get_exec_status_code
Convertion table was fetched from MSDN documentation and reproduced in the package @exec_status array.
@exec_status
Returns true if the property AddGlobalVariables is enabled, false otherwise.
Enable the property AddGlobalVariables.
Disable the property AddGlobalVariables.
Returns true if the CloseConnection attribute is active, false otherwise.
Enables the CloseConnection attribute.
Disables the CloseConnection attribute.
Returns true if the FailPackageOnError attribute is active, false otherwise.
Enables the FailPackageOnError attribute.
Any change to Win32::SqlServer::DTS::Package::Step must be saved by using the proper methods in the Win32::SqlServer::DTS::Package object or they will be lost as soons as the Step object is eliminated by the garbage collector.
All methods that changes object state and needs to sincronize with the original DTS Package Step object will abort program execution if the _sibling attribute does not exists or does not have a valid value.
Win32::OLE at perldoc.
perldoc
Win32::SqlServer::DTS::Package at perldoc to see how to fetch Win32::SqlServer::DTS::Package::Step objects.
MSDN on Microsoft website and MS SQL Server 2000 Books Online are a reference about using DTS' object hierarchy, but one will need to convert examples written in VBScript to Perl code. Specially, there is all attributes description there.
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.
To install Win32::SqlServer::DTS, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Win32::SqlServer::DTS
CPAN shell
perl -MCPAN -e shell install Win32::SqlServer::DTS
For more information on module installation, please visit the detailed CPAN module installation guide.