Win32::SqlServer::DTS::Assignment::Constant - a class to represent a DynamicPropertiesTaskAssignment object


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

Index


Code Index:

NAME

Top

Win32::SqlServer::DTS::Assignment::Constant - a class to represent a DynamicPropertiesTaskAssignment object

SYNOPSIS

Top

    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 => '', namne => $config->{package}, package_password => '' } );

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

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

        foreach my $assignment_prop ( @{ $dyn_prop->get_properties() } ) {

            if ( $assignment_prop->get_type() eq 'Constant' ) {

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

            }

        }
    }

DESCRIPTION

Top

Win32::SqlServer::DTS::Assignment::Constant represents a Constant Assignment from a Dynamic Property Task of DTS API. Such element will add a constant value to a desired destination once the Dynamic Property task, which is associated with, is executed.

Unless you're developing a new API is quite probably that one is going to use Win32::SqlServer::DTS::Assignment::Constant returned by the get_properties method from Win32::SqlServer::DTS::Task::DynamicProperty class.

EXPORT

Nothing.

METHODS

Inherits all methods from Win32::SqlServer::DTS::Assignment.

new

Overrides new method from superclass by modifying the attribute source.

get_source

Overrided method from Win32::SqlServer::DTS::Assignment superclass.

Returns a string that represents the SourceConstantValue property, in other words, the value that will be assigned to the destination everytime the Win32::SqlServer::DTS::Task::DynamicProperty associated object is executed.

SEE ALSO

Top

* Win32::SqlServer::DTS::Assignment is the superclass of Win32::SqlServer::DTS::Assignment::Constant.
* Win32::OLE at perldoc.
* MSDN on Microsoft website and MS SQL Server 2000 Books Online are a reference about using DTS' object hierarchy, but the documentation 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::Constant;

use 5.008008;
use strict;
use warnings;
use base qw(Win32::SqlServer::DTS::Assignment);
use Hash::Util qw(lock_keys);

our $VERSION = '0.02';

sub new {

    my $class = shift;
    my $self  = $class->SUPER::new(@_);

    $self->{source} = $self->get_sibling()->SourceConstantValue();
    lock_keys( %{$self} );
    return $self;

}

sub get_source {

    my $self = shift;
    return $self->{source};

}

1;

__END__