Win32::SqlServer::DTS::Application - a Perl class to emulate Microsoft SQL Server 2000 DTS Application object
use Win32::SqlServer::DTS::Application; my $app = Win32::SqlServer::DTS::Application->new( { server => $server, user => $user, password => $password, use_trusted_connection => 0 } ); # fetchs a list of packages my @list = qw( LoadData ChangeData ExportData); foreach my $name ( @list ) { my $package = $self->get_db_package( { name => $name } ) ); print $package->to_string; }
This Perl class represents the Application object from the MS SQL Server 2000 API. Before fetching any package from a server one must instantiate a Win32::SqlServer::DTS::Application object that will provide methods to fetch packages without having to provide autentication each time.
Win32::SqlServer::DTS::Application
None by default.
Instantiate a new object from Win32::SqlServer::DTS::Application class. The expected parameter is a hash reference with the following keys:
server: the name of a database server already configured in the Enterprise Manager.
user: a string of the user used to authenticate against the database server. Not necessary to specify if use_trusted_connection is true.
use_trusted_connection
password: a string of the password used to authenticate against the database server. Not necessary to specify if use_trusted_connection is true.
use_trusted_connection: a true/false value (1 or 0, respectivally) to specify if a Trusted Connection will be the authentication method to be used.
See SYNOPSIS for an example.
Fetchs a single package from a MS SQL server and returns a respective Win32::SqlServer::DTS::Package object. Expects a hash reference as a parameter, having the following keys defined:
Win32::SqlServer::DTS::Package
id: the uniq package ID. Obligatory if a package name is not provided.
name
version_id: the version ID of the package. If not provided, the last version of the package will be fetched.
name: the name of the package. Obligatory if a package id is not provided.
id
package_password: the password used to restrict access to the package. Not obligatory if no password is used.
Expect an regular expression as a parameter. The regular expression is case sensitive.
Returns a Win32::SqlServer::DTS::Package object which name matches the regular expression passed as an argument. Only one object is returned (the first one in a sorted list) even if there are more packages names that matches.
Expect an string, as regular expression, as a parameter. The parameter is case insensitive and the string is compiled internally in the method, so there is not need to use qr or something like that to increase performance.
Returns an array reference with all the packages names that matched the regular expression passed as an argument.
Returns an array reference with all the packages names available in the database of the MS SQL Server. The items in the array are sorted for convenience.
Several methods from MS SQL Server DTS Application class were not implemented, specially those available in PackageSQLServer and PackageRepository classes.
PackageSQLServer
PackageRepository
Win32::OLE at perldoc.
perldoc
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.
Alceu Rodrigues de Freitas Junior, <arfreitas@cpan.org>
Copyright (C) 2006 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.