118 |
=cut |
=cut |
119 |
#: Return Type ; |
#: Return Type ; |
120 |
sub Put { |
sub Put { |
121 |
# Get the ERDBLoad instance. |
# Get the ERDBLoad instance and the field list. |
122 |
my $self = shift @_; |
my ($self, @rawFields) = @_; |
123 |
|
# Insure the field values are okay. |
124 |
|
my $truncates = $self->{dbh}->VerifyFields($self->{relName}, \@rawFields); |
125 |
# Run through the list of field values, escaping them. |
# Run through the list of field values, escaping them. |
126 |
my @fields = map { Tracer::Escape($_) } @_; |
my @fields = map { Tracer::Escape($_) } @rawFields; |
127 |
# If this is a primary relation, append the new-record field. |
# If this is a primary relation, append the new-record field. |
128 |
if ($self->{primary}) { |
if ($self->{primary}) { |
129 |
push @fields, '0'; |
push @fields, '0'; |
139 |
$self->{fileSize} += $lineLength; |
$self->{fileSize} += $lineLength; |
140 |
$self->{lineCount} ++; |
$self->{lineCount} ++; |
141 |
$self->Add("lineOut"); |
$self->Add("lineOut"); |
142 |
|
if ($truncates > 0) { |
143 |
|
$self->Add("truncated", $truncates); |
144 |
|
} |
145 |
} |
} |
146 |
|
|
147 |
=head3 Add |
=head3 Add |
148 |
|
|
149 |
C<< my = $stats->Add($statName); >> |
C<< my = $stats->Add($statName, $value); >> |
150 |
|
|
151 |
Increment the specified statistic. |
Increment the specified statistic. |
152 |
|
|
156 |
|
|
157 |
Name of the statistic to increment. |
Name of the statistic to increment. |
158 |
|
|
159 |
|
=item value (optional) |
160 |
|
|
161 |
|
Value by which to increment it. If omitted, C<1> is assumed. |
162 |
|
|
163 |
=back |
=back |
164 |
|
|
165 |
=cut |
=cut |
166 |
#: Return Type ; |
#: Return Type ; |
167 |
sub Add { |
sub Add { |
168 |
# Get the parameters. |
# Get the parameters. |
169 |
my ($self, $statName) = @_; |
my ($self, $statName, $value) = @_; |
170 |
|
# Fix the value. |
171 |
|
if (! defined $value) { |
172 |
|
$value = 1; |
173 |
|
} |
174 |
# Increment the statistic. |
# Increment the statistic. |
175 |
$self->{stats}->Add($statName); |
$self->{stats}->Add($statName, $value); |
176 |
} |
} |
177 |
|
|
178 |
=head3 Finish |
=head3 Finish |