Module: Db2Query::SqlStatement

Included in:
Query
Defined in:
lib/db2_query/sql_statement.rb

Instance Method Summary collapse

Instance Method Details

#db2_spec_sqlObject



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

Returns:

  • (Boolean)


5
6
7
# File 'lib/db2_query/sql_statement.rb', line 5

def delete_sql?
  sql.match?(/delete/i)
end

#insert_sql?Boolean

Returns:

  • (Boolean)


9
10
11
# File 'lib/db2_query/sql_statement.rb', line 9

def insert_sql?
  sql.match?(/insert/i)
end

#iud_sql?Boolean

Returns:

  • (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_nameObject



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