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 292
292:       def cast_sql_append(sql, expr, type)
293:         if(type == String)
294:           sql << CAST_STRING_OPEN
295:           literal_append(sql, expr)
296:           sql << CAST_STRING_CLOSE
297:         else
298:           super
299:         end
300:       end

[Source]

     # File lib/sequel/adapters/shared/db2.rb, line 302
302:       def complex_expression_sql_append(sql, op, args)
303:         case op
304:         when :&, :|, :^, :%, :<<, :>>
305:           complex_expression_emulate_append(sql, op, args)
306:         when 'B~''B~'
307:           literal_append(sql, SQL::Function.new(:BITNOT, *args))
308:         when :extract
309:           sql << args.at(0).to_s
310:           sql << PAREN_OPEN
311:           literal_append(sql, args.at(1))
312:           sql << PAREN_CLOSE
313:         else
314:           super
315:         end
316:       end

[Source]

     # File lib/sequel/adapters/shared/db2.rb, line 318
318:       def supports_cte?(type=:select)
319:         type == :select
320:       end

DB2 supports GROUP BY CUBE

[Source]

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

DB2 supports GROUP BY ROLLUP

[Source]

     # File lib/sequel/adapters/shared/db2.rb, line 328
328:       def supports_group_rollup?
329:         true
330:       end

DB2 supports GROUPING SETS

[Source]

     # File lib/sequel/adapters/shared/db2.rb, line 333
333:       def supports_grouping_sets?
334:         true
335:       end

DB2 does not support IS TRUE.

[Source]

     # File lib/sequel/adapters/shared/db2.rb, line 338
338:       def supports_is_true?
339:         false
340:       end

DB2 supports lateral subqueries

[Source]

     # File lib/sequel/adapters/shared/db2.rb, line 343
343:       def supports_lateral_subqueries?
344:         true
345:       end

DB2 does not support multiple columns in IN.

[Source]

     # File lib/sequel/adapters/shared/db2.rb, line 348
348:       def supports_multiple_column_in?
349:         false
350:       end

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

[Source]

     # File lib/sequel/adapters/shared/db2.rb, line 353
353:       def supports_select_all_and_column?
354:         false
355:       end

DB2 does not support fractional seconds in timestamps.

[Source]

     # File lib/sequel/adapters/shared/db2.rb, line 358
358:       def supports_timestamp_usecs?
359:         false
360:       end

DB2 does not support WHERE 1.

[Source]

     # File lib/sequel/adapters/shared/db2.rb, line 368
368:       def supports_where_true?
369:         false
370:       end

DB2 supports window functions

[Source]

     # File lib/sequel/adapters/shared/db2.rb, line 363
363:       def supports_window_functions?
364:         true
365:       end

[Validate]