Module Sequel::DB2::DatasetMethods
In: lib/sequel/adapters/shared/db2.rb

Methods

Included Modules

EmulateOffsetWithRowNumber

Constants

PAREN_CLOSE = Dataset::PAREN_CLOSE
PAREN_OPEN = Dataset::PAREN_OPEN
BITWISE_METHOD_MAP = {:& =>:BITAND, :| => :BITOR, :^ => :BITXOR, :'B~'=>:BITNOT}
EMULATED_FUNCTION_MAP = {:char_length=>'length'.freeze}
BOOL_TRUE = '1'.freeze
BOOL_FALSE = '0'.freeze
CAST_STRING_OPEN = "RTRIM(CHAR(".freeze
CAST_STRING_CLOSE = "))".freeze
FETCH_FIRST_ROW_ONLY = " FETCH FIRST ROW ONLY".freeze
FETCH_FIRST = " FETCH FIRST ".freeze
ROWS_ONLY = " ROWS ONLY".freeze
EMPTY_FROM_TABLE = ' FROM "SYSIBM"."SYSDUMMY1"'.freeze
HSTAR = "H*".freeze
BLOB_OPEN = "BLOB(X'".freeze
BLOB_CLOSE = "')".freeze

Public Instance methods

DB2 casts strings using RTRIM and CHAR instead of VARCHAR.

[Source]

     # File lib/sequel/adapters/shared/db2.rb, line 256
256:       def cast_sql_append(sql, expr, type)
257:         if(type == String)
258:           sql << CAST_STRING_OPEN
259:           literal_append(sql, expr)
260:           sql << CAST_STRING_CLOSE
261:         else
262:           super
263:         end
264:       end

[Source]

     # File lib/sequel/adapters/shared/db2.rb, line 266
266:       def complex_expression_sql_append(sql, op, args)
267:         case op
268:         when :&, :|, :^, :%, :<<, :>>
269:           complex_expression_emulate_append(sql, op, args)
270:         when 'B~''B~'
271:           literal_append(sql, SQL::Function.new(:BITNOT, *args))
272:         when :extract
273:           sql << args.at(0).to_s
274:           sql << PAREN_OPEN
275:           literal_append(sql, args.at(1))
276:           sql << PAREN_CLOSE
277:         else
278:           super
279:         end
280:       end

[Source]

     # File lib/sequel/adapters/shared/db2.rb, line 282
282:       def supports_cte?(type=:select)
283:         type == :select
284:       end

DB2 supports GROUP BY CUBE

[Source]

     # File lib/sequel/adapters/shared/db2.rb, line 287
287:       def supports_group_cube?
288:         true
289:       end

DB2 supports GROUP BY ROLLUP

[Source]

     # File lib/sequel/adapters/shared/db2.rb, line 292
292:       def supports_group_rollup?
293:         true
294:       end

DB2 does not support IS TRUE.

[Source]

     # File lib/sequel/adapters/shared/db2.rb, line 297
297:       def supports_is_true?
298:         false
299:       end

DB2 supports lateral subqueries

[Source]

     # File lib/sequel/adapters/shared/db2.rb, line 302
302:       def supports_lateral_subqueries?
303:         true
304:       end

DB2 does not support multiple columns in IN.

[Source]

     # File lib/sequel/adapters/shared/db2.rb, line 307
307:       def supports_multiple_column_in?
308:         false
309:       end

DB2 only allows * in SELECT if it is the only thing being selected.

[Source]

     # File lib/sequel/adapters/shared/db2.rb, line 312
312:       def supports_select_all_and_column?
313:         false
314:       end

DB2 does not support fractional seconds in timestamps.

[Source]

     # File lib/sequel/adapters/shared/db2.rb, line 317
317:       def supports_timestamp_usecs?
318:         false
319:       end

DB2 does not support WHERE 1.

[Source]

     # File lib/sequel/adapters/shared/db2.rb, line 327
327:       def supports_where_true?
328:         false
329:       end

DB2 supports window functions

[Source]

     # File lib/sequel/adapters/shared/db2.rb, line 322
322:       def supports_window_functions?
323:         true
324:       end

[Validate]