Forum: Ruby on Rails Sql Adapter reports out of memory

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
9f09476d4ff354dc7c8d7676e5974e1e?d=identicon&s=25 rroman81 (Guest)
on 2009-02-18 19:54
(Received via mailing list)
I've set up freeTDS, unixODBC and got sql_adapter gem for rails
2.2.2.  It's on x64 CentOS 5.
within the app a call to ActiveRecord object to inspect columns fails
like this:
ActiveRecord::StatementInvalid: NoMemoryError: failed to allocate
memory:
          SELECT
            cols.COLUMN_NAME as ColName,
            cols.COLUMN_DEFAULT as DefaultValue,
            cols.NUMERIC_SCALE as numeric_scale,
            cols.NUMERIC_PRECISION as numeric_precision,
            cols.DATA_TYPE as ColType,
            cols.IS_NULLABLE As IsNullable,
            COL_LENGTH(cols.TABLE_NAME, cols.COLUMN_NAME) as Length,
            COLUMNPROPERTY(OBJECT_ID(cols.TABLE_NAME),
cols.COLUMN_NAME, 'IsIdentity') as IsIdentity,
            cols.NUMERIC_SCALE as Scale
          FROM INFORMATION_SCHEMA.COLUMNS cols
          WHERE cols.TABLE_NAME = 'ams_Lookup'

        from /home/rroman/workspace/sfr-ams-trunk/vendor/rails/
activerecord/lib/active_record/connection_adapters/abstract_adapter.rb:
147:in `log'
        from /home/rroman/workspace/sfr-ams-trunk/vendor/gems/
activerecord-sqlserver-adapter-1.0.0.9216/lib/active_record/
connection_adapters/sqlserver_adapter.rb:288:in `columns'
        from /home/rroman/workspace/sfr-ams-trunk/vendor/rails/
activerecord/lib/active_record/base.rb:1145:in `columns'
        from /home/rroman/workspace/sfr-ams-trunk/vendor/rails/
activerecord/lib/active_record/base.rb:1219:in `inspect'

the config looks like this:
AMS_DB_CONFIG = {
  :adapter => "sqlserver",
  :mode => "odbc",
  :dsn => 'dsn',
  :user => 'username',
  :password=> 'pass'
}

as far as i can tell i can run the above query using tsql and get a
valid return statement
This topic is locked and can not be replied to.