Forum: Ruby on Rails Legacy database with varchar2 primary key?

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.
William FISK (Guest)
on 2006-04-13 19:16
I rememeber seeing an article about how to cope with legacy databases
where the primary key is defined as VARCHAR2.  I only want read-access
to the data.

Does anyone have a link to such an article?  Or can give advice?
Chang Sau S. (Guest)
on 2006-04-13 19:47
(Received via mailing list)
Try this wiki entry:

http://wiki.rubyonrails.com/rails/pages/HowToUseLe...

If you're reading data only it doesn't really matter if your primary key
is varchar2 or int. If you need to find any records from mutiple tables
I'd suggest you use find_by_sql.

William FISK wrote:
> I rememeber seeing an article about how to cope with legacy databases
> where the primary key is defined as VARCHAR2.  I only want read-access
> to the data.
>
> Does anyone have a link to such an article?  Or can give advice?
>
>


--
Sau S.

http://blog.saush.com
http://read.saush.com
http://jaccal.sourceforge.net
William FISK (Guest)
on 2006-04-13 21:10
Sau,

Thanks.

Yes find_by_sql works fine and seems to be the answer for me.

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