Legacy database with varchar2 primary key?


#1

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?


#2

Try this wiki entry:

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

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://read.saush.com
http://jaccal.sourceforge.net


#3

Sau,

Thanks.

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

William