The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Win32::SqlServer::DTS::Task::ExecutePackage - a subclass of Win32::SqlServer::DTS::Task to represent a DTSExecutePackageTask object

SYNOPSIS

    use warnings;
    use strict;
    use Win32::SqlServer::DTS::Application;
    use Test::More;
    use XML::Simple;

    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 $total_exec_pkgs = $package->count_execute_pkgs;

    plan tests => $total_exec_pkgs;

    SKIP: {

        skip 'The package has no Execute Package task', 1
          unless ( $total_exec_pkgs > 0 );

        my $package_name;

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

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

            $package_name = 'Execute Package task "' . $execute_pkg->get_name() . '"';

            is( $execute_pkg->get_package_id(),
                '', "$package_name must have Package ID empty" );

            $package_name = '';

        }

    }

DESCRIPTION

Win32::SqlServer::DTS::Task::ExecutePackage class represents a DTS ExecutePackage task.

EXPORT

Nothing.

METHODS

All methods from Win32::SqlServer::DTS::Task are also available.

new

Overrides the superclass Win32::SqlServer::DTS::Task new method by defining the following attributes:

  • package_id

  • package_name

  • package_password

  • repository_database_name

  • server_name

  • server_password

  • server_username

  • use_repository

  • use_trusted_connection

  • file_name

  • input_global_variable_names

get_input_vars

Returns the InputGlobalVariableNames property from a Win32::SqlServer::DTS::Task::ExecutePackage task, which is a string containing each global variable name separated by a semicolon character (;), optionally double-quoted or single-quoted list. Quoting is required only when the name contains an embedded delimiter

get_ref_input_vars

Same as get_input_vars, but returns an array reference instead of a string. Single or double quotes are removed too (but only those ones at the start and end of the global variable name).

uses_repository

Returns true or false depending if the Win32::SqlServer::DTS::Task::ExecutePackage object uses MS SQL Server 2000 Meta Data Services. Same thing as UseRepository property of DTS ExecutePackage task.

use_trusted

Returns true or false whether the Win32::SqlServer::DTS::Task::ExecutePackage object uses a trusted connection to authenticate against a SQL Server.

to_string

Overrides superclass Win32::SqlServer::DTS::Task method to_string to return strings for all defined attributes of the object.

get_package_id

Returns the PackageID property as a string from a Win32::SqlServer::DTS::Task::ExecutePackage task.

get_package_name

Returns the PackageName property as a string from a Win32::SqlServer::DTS::Task::ExecutePackage task.

get_package_password

Returns the PackagePassword property as a string from a Win32::SqlServer::DTS::Task::ExecutePackage task.

get_repository_database_name

Returns the RepositoryDatabaseName property as a string from a Win32::SqlServer::DTS::Task::ExecutePackage task.

get_server_name

Returns the ServerName property as a string from a Win32::SqlServer::DTS::Task::ExecutePackage task.

get_server_password

Returns the ServerName property as a string from a Win32::SqlServer::DTS::Task::ExecutePackage task.

get_server_username

Returns the ServerUserName property as a string from a Win32::SqlServer::DTS::Task::ExecutePackage task.

get_file_name

Returns the FileName property as a string from a Win32::SqlServer::DTS::Task::ExecutePackage task.

SEE ALSO

  • Win32::SqlServer::DTS::Task superclass from where Win32::SqlServer::DTS::Task::ExecutePackage inherits.

  • Win32::OLE at Active Perl 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

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

COPYRIGHT AND LICENSE

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.