Hi all! I am quite new to rails, and I would like to know if there is a tutorial, or if someone can tell me how to use rails with stored procedures and views. Any help would be appreciated. Thanks to all --
on 2005-12-20 13:18
on 2005-12-20 13:51
Gioachino Bartolotta wrote: > Hi all! > I am quite new to rails, and I would like to know if there is a > tutorial, or if someone can tell me how to use rails with stored > procedures and views. > Any help would be appreciated. Views you can use as an ActiveRecord model, save, create and update won't work ofcourse, unless you setup your DB to support updatable views. I imagine you can run stores procedures with YourModel.connecion.select_value("SELECT myfunction()") or something similar. Triggers will ofcourse work transparently through ActiveRecord, but be sure to reload the model after a save operation as the trigger may have caused the object to go "out of sync", if you know what I mean. Jeroen
on 2005-12-20 21:44
Gioachino, Are you using Microsoft SQL Server? If so, I think you could run the following sql to return a recordset from a Stored Proc.: " EXEC yourStoredProcName @param='value' " (However, I believe this will not return any OUTPUT parameters or Return Codes)
on 2005-12-20 22:51
Hi Ed! I am using PostgreSQL ... I work only on *nix like system Right noe I am trying to see how rails work with views ... ;) Thanks guys for your help ... 2005/12/20, Ed C. <email@example.com>: > > -- ------------------------------------------- Gioachino Bartolotta Mobile: 320 6059371 ICQ #: 9103167 MSN Messenger: firstname.lastname@example.org Yahoo & Skype: gioachino_bartolotta
on 2005-12-21 01:22
Stored Procedures is not the rails way............ All features that make our database, [business] smart we hate..........
on 2005-12-21 04:42
Leon L. wrote: > Stored Procedures is not the rails way............ > > All features that make our database, [business] smart we hate.......... Agreed - even microsoft is heading that direction with LINQ. Stored procs are soooo 90's ...