Win32::SqlServer::DTS::Connection - a Perl class to represent a Microsoft SQL Server 2000 DTS Connection object
use Win32::SqlServer::DTS::Application; my $app = Win32::SqlServer::DTS::Application->new( { server => $server, user => $user, password => $password, use_trusted_connection => 0 } ); my $package = $app->get_db_package( { id => '', version_id => '', name => 'some_package', package_password => '' } ); my $iterator = $package->get_connections(); while ( my $conn = $iterator->() ) { print $conn->get_name(), "\n"; } # or if you have $connection as a regular # MS SQL Server Connection object my $conn2 = Win32::SqlServer::DTS::Connection->new($connection); print $conn2->to_string(), "\n";
Win32::SqlServer::DTS::Connection class represent a DTS Connection object, serving as a layer to fetch properties from the DTS Connection stored in the _sibling attribute.
Win32::SqlServer::DTS::Connection
_sibling
Although it's possible to create an Win32::SqlServer::DTS::Connection object directly (once a DTS Connection object is available), one will probably fetch connections from a package using the get_connections method from the Win32::SqlServer::DTS::Package module.
get_connections
None by default.
Inherints all methods from DTS superclass.
The only expected parameter to the new method is an already available DTS Connection object. Returns a Win32::SqlServer::DTS::Connection object.
new
Fetchs the provider value of the connection. It is an alias for the get_provider method.
get_provider
Returns a string with all properties (but those returned by get_oledb method) from the a Win32::SqlServer::DTS::Connection object. Each property will have a short description before the value and will be separated by new line characters.
get_oledb
Fetchs the name of the connection.
Fetchs the description of the connection.
Fetchs the datasource value of the connection.
Fetchs the catalog value of the connection, if available.
Fetchs the connection ID. This ID is used as an connection reference by the tasks in a DTS package that needs a connection.
Fetchs the provider name of the connection. Althought DTS Connection object support various types of connections, at this version, Win32::SqlServer::DTS::Connection will work only with DTSFlatFile and SQLOLEDB providers.
Fetchs the user used in the authentication of the connection.
Fetchs the password used in the authentication of the connection.
Returns an hash reference with all OLEDB properties used by the connection, being each key (a property) value a hash reference itself.
Being a property a hash reference, it contaings by default the following keys: name, value, property_id and property_set. These keys correspond to the properties Name, Value, PropertyID and PropertySet from the original property defined in the DTS API.
name
value
property_id
property_set
Name
Value
PropertyID
PropertySet
Only for the property FileType, that is a convertion from numeric code to the proper string.
FileType
This class should be subclassed very soon to two new classes: Win32::SqlServer::DTS::Connection::FlatFile and Win32::SqlServer::DTS::Connection::OLEBD to enable polymorphic method calls.
Win32::SqlServer::DTS::Connection::FlatFile
Win32::SqlServer::DTS::Connection::OLEBD
DTS at perldoc.
perldoc
Win32::SqlServer::DTS::Application at perldoc.
Win32::SqlServer::DTS::Package at perldoc.
Win32::OLE at 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.
This API is incomplete. There are much more properties defined in the MS SQL Server 2000 DTS API.
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.