Module: Db2Query::SqlStatement
- Included in:
- Query
- Defined in:
- lib/db2_query/sql_statement.rb
Instance Method Summary collapse
- #db2_spec_sql ⇒ Object
- #delete_sql? ⇒ Boolean
- #insert_sql? ⇒ Boolean
- #iud_sql? ⇒ Boolean
- #table_name ⇒ Object
Instance Method Details
#db2_spec_sql ⇒ Object
17 18 19 |
# File 'lib/db2_query/sql_statement.rb', line 17 def db2_spec_sql iud_sql? ? iud_spec_sql : sql end |
#delete_sql? ⇒ Boolean
5 6 7 |
# File 'lib/db2_query/sql_statement.rb', line 5 def delete_sql? sql.match?(/delete/i) end |
#insert_sql? ⇒ Boolean
9 10 11 |
# File 'lib/db2_query/sql_statement.rb', line 9 def insert_sql? sql.match?(/insert/i) end |
#iud_sql? ⇒ Boolean
13 14 15 |
# File 'lib/db2_query/sql_statement.rb', line 13 def iud_sql? sql.match?(/insert into|update|delete/i) end |
#table_name ⇒ Object
21 22 23 |
# File 'lib/db2_query/sql_statement.rb', line 21 def table_name insert_sql? ? sql.split("INTO ").last.split(" ").first : nil end |