Class: Sneaql::Core::Commands::SneaqlExecuteIf
- Inherits:
-
SneaqlCommand
- Object
- SneaqlCommand
- Sneaql::Core::Commands::SneaqlExecuteIf
- Defined in:
- lib/sneaql_lib/core.rb
Overview
executes a sql statement if the condition evaluates to true
Instance Method Summary collapse
- #action(left_value, operator, right_value) ⇒ Object
-
#arg_definition ⇒ Object
argument types.
-
#rows_affected ⇒ Fixnum
Rows affected by SQL statement.
Methods inherited from SneaqlCommand
#initialize, #valid_expression?, #valid_operator?, #valid_recordset?, #valid_symbol?, #valid_variable?, #validate_args
Constructor Details
This class inherits a constructor from Sneaql::Core::SneaqlCommand
Instance Method Details
#action(left_value, operator, right_value) ⇒ Object
110 111 112 113 114 115 116 117 118 119 |
# File 'lib/sneaql_lib/core.rb', line 110 def action(left_value, operator, right_value) if @expression_handler.compare_expressions(operator, left_value, right_value) @expression_handler.set_session_variable( 'last_statement_rows_affected', rows_affected ) end rescue => e @exception_manager.pending_error = e end |
#arg_definition ⇒ Object
argument types
122 123 124 |
# File 'lib/sneaql_lib/core.rb', line 122 def arg_definition [:expression, :operator, :expression] end |
#rows_affected ⇒ Fixnum
Returns rows affected by SQL statement.
127 128 129 130 131 132 133 |
# File 'lib/sneaql_lib/core.rb', line 127 def rows_affected JDBCHelpers::Execute.new( @jdbc_connection, @statement, @logger ).rows_affected end |