Class | Sequel::JDBC::AS400::Dataset
In: | lib/sequel/adapters/jdbc/as400.rb
Parent: | JDBC::Dataset

Dataset class for AS400 datasets accessed via JDBC.

### Methods

select_sql supports_window_functions?

### Constants

WILDCARD | = | Sequel::LiteralString.new('*').freeze

### Public Instance methods

select_sql()

AS400 needs to use a couple of subselects for all limits and offsets.

[Source]

        # File lib/sequel/adapters/jdbc/as400.rb, line 28
    28:         def select_sql
    29:           return super unless l = @opts[:limit]
    30:           o = @opts[:offset] || 0
    31:           order = @opts[:order]
    32:           dsa1 = dataset_alias(1)
    33:           dsa2 = dataset_alias(2)
    34:           rn = row_number_column
    35:           irn = Sequel::SQL::Identifier.new(rn).qualify(dsa2)
    36:           subselect_sql(unlimited.
    37:             from_self(:alias=>dsa1).
    38:             select_more(Sequel::SQL::QualifiedIdentifier.new(dsa1, WILDCARD),
    39:               Sequel::SQL::WindowFunction.new(SQL::Function.new(:ROW_NUMBER), Sequel::SQL::Window.new(:order=>order)).as(rn)).
    40:             from_self(:alias=>dsa2).
    41:             select(Sequel::SQL::QualifiedIdentifier.new(dsa2, WILDCARD)).
    42:             where((irn > o) & (irn <= l + o)))
    43:         end

supports_window_functions?()

[Source]

        # File lib/sequel/adapters/jdbc/as400.rb, line 45
    45:         def supports_window_functions?
    46:           true
    47:         end

[Validate]