... | ... |
@@ -269,12 +269,11 @@ sub delete { |
269 | 269 |
if $where_clause eq '' && !$allow_delete_all; |
270 | 270 |
|
271 | 271 |
# Delete statement |
272 |
- my @sql; |
|
273 |
- push @sql, "delete"; |
|
274 |
- push @sql, $prefix if defined $prefix; |
|
275 |
- push @sql, "from " . $self->_q($table) . " $where_clause"; |
|
276 |
- push @sql, $append if defined $append; |
|
277 |
- my $sql = join(' ', @sql); |
|
272 |
+ my $sql; |
|
273 |
+ $sql .= "delete "; |
|
274 |
+ $sql .= "$prefix " if defined $prefix; |
|
275 |
+ $sql .= "from " . $self->_q($table) . " $where_clause "; |
|
276 |
+ $sql .= $append if defined $append; |
|
278 | 277 |
|
279 | 278 |
# Execute query |
280 | 279 |
return $self->execute($sql, $where_param, table => $table, %args); |
... | ... |
@@ -633,13 +632,12 @@ sub insert { |
633 | 632 |
} |
634 | 633 |
|
635 | 634 |
# Insert statement |
636 |
- my @sql; |
|
637 |
- push @sql, "insert"; |
|
638 |
- push @sql, $prefix if defined $prefix; |
|
639 |
- push @sql, "into " . $self->_q($table) . " " |
|
640 |
- . $self->insert_param($param, {wrap => $wrap}); |
|
641 |
- push @sql, $append if defined $append; |
|
642 |
- my $sql = join (' ', @sql); |
|
635 |
+ my $sql; |
|
636 |
+ $sql .= "insert "; |
|
637 |
+ $sql .= "$prefix " if defined $prefix; |
|
638 |
+ $sql .= "into " . $self->_q($table) . " " |
|
639 |
+ . $self->insert_param($param, {wrap => $wrap}) . " "; |
|
640 |
+ $sql .= $append if defined $append; |
|
643 | 641 |
|
644 | 642 |
# Execute query |
645 | 643 |
return $self->execute($sql, $param, table => $table, %args); |
... | ... |
@@ -1169,14 +1167,11 @@ sub update { |
1169 | 1167 |
$param = $self->merge_param($param, $where_param) if keys %$where_param; |
1170 | 1168 |
|
1171 | 1169 |
# Update statement |
1172 |
- my @sql; |
|
1173 |
- push @sql, "update"; |
|
1174 |
- push @sql, $prefix if defined $prefix; |
|
1175 |
- push @sql, $self->_q($table) . " $update_clause $where_clause"; |
|
1176 |
- push @sql, $append if defined $append; |
|
1177 |
- |
|
1178 |
- # SQL |
|
1179 |
- my $sql = join(' ', @sql); |
|
1170 |
+ my $sql; |
|
1171 |
+ $sql .= "update "; |
|
1172 |
+ $sql .= "$prefix " if defined $prefix; |
|
1173 |
+ $sql .= $self->_q($table) . " $update_clause $where_clause "; |
|
1174 |
+ $sql .= $append if defined $append; |
|
1180 | 1175 |
|
1181 | 1176 |
# Execute query |
1182 | 1177 |
return $self->execute($sql, $param, table => $table, %args); |