Forum: Ruby on Rails Rails + Firebird (legacy database)

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.
9df02f38cc7277468af00b4d6e849362?d=identicon&s=25 Edgar Gonzalez (eagoweb)
on 2013-08-01 08:07
i am trying to create some JSON services for a legacy database i have in
firebird.

I have installed firebird adapter and it seems it is working but is
always throwing an error:

Fb::Error: Undefined name Dynamic SQL Error SQL error code = -204 Table
unknown MSFCLIENTES At line 1, column 45 : SELECT "MSFCLIENTES".* FROM
"MSFCLIENTES" ORDER BY "MSFCLIENTES"."ID" ASC ROWS 1

the log shows like if it is quering the wrong table "RDB$DATABASE" (one
of the system tables), so if i change the table name to that table it
works but it isnt the table i need...

here is my model

class Client < ActiveRecord::Base

  establish_connection(
    :adapter  => "fb",
    :database => "localhost:/var/databases/MSFBASE.Ib",
    #:database => "sales",
    :username => "SYSDBA",
    :password => "masterkey",
    :charset  => "NONE")

  self.table_name   = "MSFCLIENTES"
  #self.primary_key  = 'RDB$RELATION_ID'
  #self.table_name   = "RDB$DATABASE"
  #self.primary_key  = 'RDB$RELATION_ID'
  # self.table_name = 'employee'

end
This topic is locked and can not be replied to.