Method: PLSQL::SQLStatements#select
- Defined in:
- lib/plsql/sql_statements.rb
#select(*args) ⇒ Object
Select :first or :all values. Examples:
plsql.select :first, "SELECT * FROM employees WHERE employee_id = :1", 1
plsql.select :all, "SELECT * FROM employees ORDER BY employee_id"
22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/plsql/sql_statements.rb', line 22 def select(*args) case args[0] when nil raise ArgumentError, "Not enough arguments" when :first args.shift @connection.select_hash_first(*args) when :all args.shift @connection.select_hash_all(*args) else @connection.select_hash_all(*args) end end |