| Win32-SqlServer-DTS documentation | Contained in the Win32-SqlServer-DTS distribution. |
Win32::SqlServer::DTS::Assignment::Query - a class to represent a DTS DynamicPropertiesTaskAssignment object
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_dynamic_props();
while ( my $dyn_prop = $iterator->() ) {
foreach my $assignment_prop ( @{ $dyn_prop->get_properties() } ) {
if ( $assignment_prop->get_type() eq 'Query' ) {
print $assignment_prop->to_string(), "\n";
}
}
}
Win32::SqlServer::DTS::Assignment::Query is a subclass of Win32::SqlServer::DTS::Assignment superclass. It represents
a DTS DynamicPropertiesTaskAssignment object that has the properties SourceQueryConnectionID
and SourceQuerySQL defined.
Unless you want to extend the DTS API is quite probably that you're going to use Win32::SqlServer::DTS::Assignment::Query
returned by the get_properties method from Win32::SqlServer::DTS::Task::DynamicProperty class.
Nothing.
Inherits all methods from Win32::SqlServer::DTS::Assignment.
Extends superclass method new by modifying the source attribute.
Overrided method from Win32::SqlServer::DTS::Assignment class. It will returns a result depending on the context
the method was invoked. in a scalar context, it will return a string with the results of the methods get_connection_id
and get_query_sql respectivally, separated by points and quoted with square brackets. In a list context, it
will return a list with the values of the methods get_connection_id and get_query_sql, in this order.
See Win32::SqlServer::DTS::Assignment (get_destination in Win32::SqlServer::DTS::Assigment) method for more information about how a property is setup using a Dynamic Properties Task Assignment.
Returns a string with the ConnectionID property of a DTS Connection object.
Returns a string with the SQL query defined. The string will be returned exactly how it was created, so don't blame the API with the SQL is in a bad format.
perldoc.perldoc.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.
| Win32-SqlServer-DTS documentation | Contained in the Win32-SqlServer-DTS distribution. |
package Win32::SqlServer::DTS::Assignment::Query;
use 5.008008; use strict; use warnings; use base qw(Win32::SqlServer::DTS::Assignment Class::Accessor); use Hash::Util qw(lock_keys); our $VERSION = '0.03';
__PACKAGE__->follow_best_practice; __PACKAGE__->mk_ro_accessors(qw(connection_id query_sql)); sub new { my $class = shift; my $self = $class->SUPER::new(@_); my $sibling = $self->get_sibling; $self->{connection_id} = $sibling->SourceQueryConnectionID; $self->{query_sql} = $sibling->SourceQuerySQL; lock_keys( %{$self} ); return $self; }
sub get_source { my $self = shift; return wantarray ? ( $self->get_connection_id, $self->get_query_sql ) : '[' . $self->get_connection_id . '].[' . $self->get_query_sql . ']'; } 1; __END__