Class: Sneaql::Core::Commands::SneaqlTest
- Inherits:
-
SneaqlCommand
- Object
- SneaqlCommand
- Sneaql::Core::Commands::SneaqlTest
- Defined in:
- lib/sneaql_lib/core.rb
Overview
compares the result of a sql statement against an argument raises error if the comparison does not evaluate to true the first field of the first record is used for the comparison
Instance Method Summary collapse
- #action(operator, value_to_test) ⇒ Object
-
#arg_definition ⇒ Object
argument types.
-
#sql_result ⇒ Object
returns value at first row/field in result set.
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(operator, value_to_test) ⇒ Object
148 149 150 151 152 153 154 155 156 157 158 |
# File 'lib/sneaql_lib/core.rb', line 148 def action(operator, value_to_test) unless @expression_handler.compare_expressions( operator, sql_result, value_to_test ) raise Sneaql::Exceptions::SQLTestExitCondition end rescue => e @exception_manager.pending_error = e end |
#arg_definition ⇒ Object
argument types
161 162 163 |
# File 'lib/sneaql_lib/core.rb', line 161 def arg_definition [:operator, :expression] end |
#sql_result ⇒ Object
returns value at first row/field in result set
166 167 168 169 170 171 172 |
# File 'lib/sneaql_lib/core.rb', line 166 def sql_result JDBCHelpers::SingleValueFromQuery.new( @jdbc_connection, @statement, @logger ).result end |