49 |
|
|
50 |
=cut |
=cut |
51 |
|
|
52 |
sub valdate_sql_query { |
sub validate_sql_query { |
53 |
my $self = shift; |
my $self = shift; |
54 |
my $value = shift || return $self->validation_error( sql_query => 'You need to type in SQL query' ); |
my $value = shift; |
55 |
return $self->validation_ok('sql_query'); |
|
56 |
|
if ( $value =~ m/^\s+;*\s*$/s ) { |
57 |
|
return $self->validation_error( sql_query => 'You need to type in SQL query' ); |
58 |
|
} else { |
59 |
|
return $self->validation_ok('sql_query'); |
60 |
|
} |
61 |
} |
} |
62 |
|
|
63 |
=head2 take_action |
=head2 take_action |
97 |
$sth->rows . ' rows' |
$sth->rows . ' rows' |
98 |
)) if ($sth->rows >= 0); |
)) if ($sth->rows >= 0); |
99 |
|
|
100 |
|
$self->result->content( sth => $sth ); |
101 |
|
|
102 |
return 1; |
return 1; |
103 |
} |
} |
104 |
|
|