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

NAME

Win32::SqlServer::DTS::Task::DataPump - a Perl subclass of Win32::SqlServer::DTS::Task to represent a DTSDataPumpTask 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 $iterator = $package->get_datapumps();

    foreach my $datapump ( $iterator->() ) {

        print $datapump->to_string(), "\n";

    }

DESCRIPTION

Win32::SqlServer::DTS::Task::DataPump implements a convenient way to fetch properties from a DTS DataPumpTask Task object of a DTS Package.

EXPORT

Nothing.

METHODS

A good amount of methods available in the original DTS API are available, including methods to access the properties. There are some methods that do not exists in the DTS API.

new

Overrided method from Win32::SqlServer::DTS::Task to define additional attributes during object creation. See Win32::SqlServer::DTS::Task::new method for more information.

get_dest_conn_id

Returns the value of DestinationConnectionID property.

get_dest_obj

Returns the value of DestinationObjectName property.

get_dest_sql

Returns the value of DestinationSQLStatement property.

get_source_obj

Returns the value of SourceObjectName property.

get_source_sql

Returns the value of SourceSQLStatement property.

get_source_conn_id

Returns the value of SourceConnectionID property.

get_progress_count

Returns the value of ProgressRowCount property.

get_rows_complete

Returns the value of RowsComplete property.

get_fetch_size

Returns the value of FetchBufferSize property.

get_first_row

Returns the value of FirstRow property.

get_exception_qualifier

Returns the value of ExceptionFileTextQualifier property.

get_input_global_vars

Returns the value of InputGlobalVariablesNames property.

get_exception_file

Returns the value of ExceptionFileName property.

get_commit_size

Returns the value of InsertCommitSize property.

get_max_errors

Returns the value of MaximumErrorCount property.

use_single_file_7

Returns true or false depending if errors, source, and destination exception rows are all written to a single ANSI file.

use_source_row_file

Returns true or false depending if source exception rows are written to the source exception file.

use_error_file

Returns true or false if error rows are written to a error file.

overwrite_log_file

Returns true or false if data is overwritten, rather than appended, to file.

abort_on_log_failure

Returns true or false if termination of the data pump if execution logging fails is enable.

use_destination_row_file

Returns true or false if destination exception rows are written to the destination exception file.

use_fast_load

Returns true or false if the use of the FastLoad option (where rows are processed in batches under a single transaction commit) is enabled.

log_is_ansi

Returns true or false if the encoding of the log file is ANSI ASCII.

log_is_OEM

Returns true or false if the encoding of the log file is OEM.

log_is_unicode

Returns true or false if the encoding of the log file is Unicode (UTF-16LE).

always_commit

Returns true or false if the DataPumpTask task will commit all successful batches including the final batch, even if the data pump terminates. Use this option to support restartability.

Strange as it may seen, this is called as Always commit final batch option in the DTS designer application, but receives the name DataPumpOptions property in the DTS API.

use_check_constraints

Returns true or false if the datapump will check for the constrainst of the table before inserting new rows.

use_keep_nulls

Returns true or false if the datapump will insert will insert NULL values from the data source into the destination.

use_lock_table

Returns true or false if the datapump will lock the entire table instead using lock by page.

use_identity_inserts

Returns true or false if Identity inserts will be used.

to_string

Returns a string with all attributes from the datapump object, separated by new line characters and with a short description of each attribute.

get_input_global_vars

Returns a string or a list of Data Transformation Services (DTS) global variable names that are to be used as parameters in a query or created in a subpackage, depending on the context that the method is invoked.

The returned string is made of the global variable names separated by semi-colons characters.

get_rows_complete

Returns the number of source rows, including rows for which errors occurred, processed by the task or transformation set.

get_exception_file

Returns the file name path where exception rows are written.

get_commit_size

Returns the number of rows that are inserted in a single transaction when the FastLoad option is being used.

get_max_errors

Returns the maximum number of error rows before the data pump terminates.

CAVEATS

This class is incomplete. There are several properties not defined here that exists in the DTS API.

SEE ALSO

  • Win32::SqlServer::DTS::Task, the superclass from where Win32::SqlServer::DTS::Task::DataPump inherits, 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.

AUTHOR

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

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.