Forum: Ruby on Rails Using rails with stored procedures

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.
79e2d1b452bec05572510c64f12fae61?d=identicon&s=25 Gioachino Bartolotta (Guest)
on 2005-12-20 12:18
(Received via mailing list)
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
--
B9a732fc30c32098347a0177c75ee27b?d=identicon&s=25 Jeroen Houben (Guest)
on 2005-12-20 12:51
(Received via mailing list)
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
648805ae18e92b7c71e46f3caa23ddc8?d=identicon&s=25 Ed C. (Guest)
on 2005-12-20 20:44
(Received via mailing list)
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)
79e2d1b452bec05572510c64f12fae61?d=identicon&s=25 Gioachino Bartolotta (Guest)
on 2005-12-20 21:51
(Received via mailing list)
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. <defeated2k4@gmail.com>:
>
>
--
-------------------------------------------
Gioachino Bartolotta
Mobile: 320 6059371
ICQ #: 9103167
MSN Messenger: astraroth@email.it
Yahoo & Skype: gioachino_bartolotta
2073c7e0e7d2311727b680a887a375be?d=identicon&s=25 Leon Leslie (Guest)
on 2005-12-21 00:22
(Received via mailing list)
Stored Procedures is not the rails way............

All features that make our database, [business] smart we hate..........
B9f2cd54b3f85455af152162c2e5b1b2?d=identicon&s=25 Chris Hulbert (Guest)
on 2005-12-21 03:42
Leon Leslie 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 ...
This topic is locked and can not be replied to.