I have to extract data from an odbc connection to another database and put
into a MySQL database so that my rails app can manipulate it. What would be
the best way to set that up? Would I put the connection info in a
controller, so that the controller method with open and close the
connection? Any thought?
--
Best Regards,
-Larry
"Work, work, work...there is no satisfactory alternative."
--- E.Taft Benson
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://wrath.rubyonrails.org/pipermail/rails/attachments/20060127/fdd0c012/attachment-0001.html
Seems like there are a lot of people trying multiple database
connections all the sudden. i have the read part down and not knowing
more about what you are trying to do but I put the connection info in
the model that is associated to the table that I want to read from. I
have a users table in one database and in the app I have the
following in the user.rb (model file)
establish_connection(:adapter => "mysql",
:host => "localhost",
:port => 3306,
:database =>
"GlobalUser_development",
:username => "root",
:password => "root")
set_table_name "users"
This allows me to read all day long from the table and associate to
the object from that table however I can''t get any of my actions to
write to the table. and rails does not complain about it. When i
click submit it goes through and acts like it made the change to the
table however it doesn''t actually do it and the log file is not
throwing any sort of exception.
hope this helps.
Andrew
On Jan 27, 2006, at 2:14 PM, Larry Kelly wrote:
> I have to extract data from an odbc connection to another database
> and put into a MySQL database so that my rails app can manipulate
> it. What would be the best way to set that up? Would I put the
> connection info in a controller, so that the controller method with
> open and close the connection? Any thought?
>
> --
> Best Regards,
> -Larry
> "Work, work, work...there is no satisfactory alternative."
> --- E.Taft Benson
> _______________________________________________
> Rails mailing list
> Rails@lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
Yes, this does help. I don''t need to right to the other database. Would you happen to know where to look for odbc adapter setting info? -Larry On 1/27/06, Andrew Filipowski <a.filipowski@mac.com> wrote:> > Seems like there are a lot of people trying multiple database > connections all the sudden. i have the read part down and not knowing > more about what you are trying to do but I put the connection info in > the model that is associated to the table that I want to read from. I > have a users table in one database and in the app I have the > following in the user.rb (model file) > > establish_connection(:adapter => "mysql", > :host => "localhost", > :port => 3306, > :database => "GlobalUser_development", > :username => "root", > :password => "root") > set_table_name "users" > > This allows me to read all day long from the table and associate to > the object from that table however I can''t get any of my actions to > write to the table. and rails does not complain about it. When i > click submit it goes through and acts like it made the change to the > table however it doesn''t actually do it and the log file is not > throwing any sort of exception. > > hope this helps. > > Andrew > > > > On Jan 27, 2006, at 2:14 PM, Larry Kelly wrote: > > > I have to extract data from an odbc connection to another database > > and put into a MySQL database so that my rails app can manipulate > > it. What would be the best way to set that up? Would I put the > > connection info in a controller, so that the controller method with > > open and close the connection? Any thought? > > > > -- > > Best Regards, > > -Larry > > "Work, work, work...there is no satisfactory alternative." > > --- E.Taft Benson > > _______________________________________________ > > Rails mailing list > > Rails@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- Best Regards, -Larry "Work, work, work...there is no satisfactory alternative." --- E.Taft Benson -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060128/8c257950/attachment.html