/[SQLSession]/trunk/lib/SQLSession/Action/DoSQL.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/lib/SQLSession/Action/DoSQL.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 7 by dpavlin, Sat Dec 2 22:30:43 2006 UTC revision 9 by dpavlin, Sat Dec 2 23:53:00 2006 UTC
# Line 49  Can't be empty! Line 49  Can't be empty!
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
# Line 92  sub take_action { Line 97  sub 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    

Legend:
Removed from v.7  
changed lines
  Added in v.9

  ViewVC Help
Powered by ViewVC 1.1.26