line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Win32::SqlServer::DTS::Task::DynamicProperty;
|
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
=head1 NAME
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
Win32::SqlServer::DTS::Task::DynamicProperty - a subclass of Win32::SqlServer::DTS::Task to represent a DTSDynamicPropertiesTask object
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
=head1 SYNOPSIS
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
use warnings;
|
10
|
|
|
|
|
|
|
use strict;
|
11
|
|
|
|
|
|
|
use Win32::SqlServer::DTS::Application;
|
12
|
|
|
|
|
|
|
use Test::More;
|
13
|
|
|
|
|
|
|
use XML::Simple;
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
my $xml = XML::Simple->new();
|
16
|
|
|
|
|
|
|
my $config = $xml->XMLin('test-config.xml');
|
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
my $app = Win32::SqlServer::DTS::Application->new($config->{credential});
|
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
my $package =
|
21
|
|
|
|
|
|
|
$app->get_db_package(
|
22
|
|
|
|
|
|
|
{ id => '', version_id => '', name => $config->{package}, package_password => '' } );
|
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
my $iterator = $package->get_dynamic_props();
|
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
while ( my $dyn_prop = $iterator->() ) {
|
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
print $dyn_prop->to_string(), "\n";
|
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
}
|
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
my $assign_iterator = $dyn_props->get_assignments;
|
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
while ( my $assignment = $assign_iterator->() ) {
|
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
print $assignment->to_string, "\n";
|
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
}
|
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
=head1 DESCRIPTION
|
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
C represents a DTS C task.
|
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
=head2 EXPORT
|
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
Nothing.
|
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=cut
|
50
|
|
|
|
|
|
|
|
51
|
1
|
|
|
1
|
|
13353
|
use strict;
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
31
|
|
52
|
1
|
|
|
1
|
|
3
|
use warnings;
|
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
21
|
|
53
|
1
|
|
|
1
|
|
3
|
use base qw(Win32::SqlServer::DTS::Task);
|
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
329
|
|
54
|
|
|
|
|
|
|
use Carp;
|
55
|
|
|
|
|
|
|
use Win32::OLE qw(in);
|
56
|
|
|
|
|
|
|
use Win32::SqlServer::DTS::AssignmentFactory;
|
57
|
|
|
|
|
|
|
use Hash::Util qw(lock_keys);
|
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
=head2 METHODS
|
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
C inherits all methods from C, overriding those that are necessary.
|
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=head3 count_assignments
|
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
Returns a integer with the number of assignments the DynamicPropertiesTask object has.
|
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=cut
|
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
sub count_assignments {
|
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
my $self = shift;
|
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
my $assignments = $self->get_sibling->Assignments;
|
74
|
|
|
|
|
|
|
my $counter;
|
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
foreach ( in($assignments) ) {
|
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
$counter++;
|
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
}
|
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
return $counter;
|
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
}
|
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
=head3 get_assignments
|
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
Returns a iterator, that, at each call, will return an C object until there are no more
|
89
|
|
|
|
|
|
|
assignments in the C.
|
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
See L to see an example of usage.
|
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
=cut
|
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
sub get_assignments {
|
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
my $self = shift;
|
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
my $assignments = $self->get_sibling->Assignments;
|
100
|
|
|
|
|
|
|
my $total = scalar( in($assignments) );
|
101
|
|
|
|
|
|
|
my $counter = 0;
|
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
return sub {
|
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
return unless ( $counter < $total );
|
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
my $assignment = ( in($assignments) )[$counter];
|
108
|
|
|
|
|
|
|
$counter++;
|
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
return Win32::SqlServer::DTS::AssignmentFactory->create($assignment);
|
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
}
|
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
}
|
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
=head3 to_string
|
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
Returns a string with all attributes of an C class. All attributes will have a
|
119
|
|
|
|
|
|
|
short description and will be separated by a new line character.
|
120
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
=cut
|
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
sub to_string {
|
124
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
my $self = shift;
|
126
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
my $properties_string;
|
128
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
foreach my $item ( @{ $self->get_properties } ) {
|
130
|
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
$properties_string = $properties_string . "\tType = $item->{type}\r\n";
|
132
|
|
|
|
|
|
|
$properties_string =
|
133
|
|
|
|
|
|
|
$properties_string . "\t\tSource = $item->{source}\r\n";
|
134
|
|
|
|
|
|
|
$properties_string =
|
135
|
|
|
|
|
|
|
$properties_string . "\t\tDestination = $item->{destination}\r\n";
|
136
|
|
|
|
|
|
|
|
137
|
|
|
|
|
|
|
}
|
138
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
return $properties_string;
|
140
|
|
|
|
|
|
|
|
141
|
|
|
|
|
|
|
}
|
142
|
|
|
|
|
|
|
|
143
|
|
|
|
|
|
|
1;
|
144
|
|
|
|
|
|
|
|
145
|
|
|
|
|
|
|
__END__
|