Win32::SqlServer::DTS::Assignment::Destination::Connection - a subclass of Win32::SqlServer::DTS::Assignment::Destination for connections


Win32-SqlServer-DTS documentation Contained in the Win32-SqlServer-DTS distribution.

Index


Code Index:

NAME

Top

Win32::SqlServer::DTS::Assignment::Destination::Connection - a subclass of Win32::SqlServer::DTS::Assignment::Destination for connections

SYNOPSIS

Top

    use warnings;
    use strict;
    use Win32::SqlServer::DTS::Application;
    my $xml = XML::Simple->new();
    my $config = $xml->XMLin('test-config.xml');

    my $app = Win32::SqlServer::DTS::Application->new($config->{credential});

    my $package =
      $app->get_db_package(
        { id => '', version_id => '', name => $config->{package}, package_password => '' } );

	my $iterator = $package->get_dynamic_props();

    while ( my $dyn_prop = $iterator->() ) {

        my $iterator = $dyn_props->get_assignments();

        while ( my $assignment = $iterator->() ) {

            my $dest = $assignment->get_destination();

            if ( $dest->changes('Connection') ) {

                print $dest->get_string(), "\n";

            }

        }

    }




DESCRIPTION

Top

Win32::SqlServer::DTS::Assignment::Destination::Connection is a subclass of Win32::SqlServer::DTS::Assignment::Destination and represents the global variables as the assignments destinations of a DTS package.

The string returned by the get_string method has this format:

'Connections';name of the connection;'Properties';name of the property.

EXPORT

Nothing.

METHODS

initialize

initialize method sets the destination attribute as a DTS Package connection property. It also sets the attribute conn_name with the connection name.

SEE ALSO

Top

* Win32::SqlServer::DTS::Assignment at perldoc.
* Win32::SqlServer::DTS::Assignment::Destination 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.

AUTHOR

Top

Alceu Rodrigues de Freitas Junior, <arfreitas@cpan.org>

COPYRIGHT AND LICENSE

Top


Win32-SqlServer-DTS documentation Contained in the Win32-SqlServer-DTS distribution.
package Win32::SqlServer::DTS::Assignment::Destination::Connection;

use 5.008008;
use strict;
use warnings;
use Carp qw(confess);
use base qw(Win32::SqlServer::DTS::Assignment::Destination);

our $VERSION = '0.01';

__PACKAGE__->follow_best_practice;
__PACKAGE__->mk_ro_accessors(qw(conn_name));

sub initialize {

    my $self = shift;

    my @values = split( /;/, $self->get_string() );

	$self->{destination} = $values[3];
	$self->{conn_name} = $values[1];

    confess "'destination' attribute cannot be undefined\n"
      unless ( defined( $self->{destination} ) );

    confess "'conn_name' attribute cannot be undefined\n"
      unless ( defined( $self->{conn_name} ) );

}

1;
__END__