From: Robert Klemme Date: 2009-08-19T16:27:53+09:00 Subject: Re: CSV import to hash to compare with database 2009/8/18 John Mcleod : > Robert, > >>Two things come to mind: depending on the RDBMS you are using it may >> have similar tools (functions) for text processing and analysis. > > Currently, my development database is SQLite, but my supervisor's plan > is to have Oracle as a production database. > > Once again, I'll be in learning mode.  (knowledge of Oracle = 0)  I'm > experienced in mySQL mostly. > >> Second, you could extract the data from the database via any of Ruby's >> database interfaces, ... > > Are the "interfaces" easy to work with? DBI is pretty straightforward - once you have it installed IIRC. It's a while since I used it. But you can as easily export data as CSV with SQL Plus - example for the SCOTT demo schema that comes with the database (if it is installed): c:\Temp>sqlplus -S scott/PWD @emp 7369;"SMITH";"CLERK" 7499;"ALLEN";"SALESMAN" 7521;"WARD";"SALESMAN" 7566;"JONES";"MANAGER" 7654;"MARTIN";"SALESMAN" 7698;"BLAKE";"MANAGER" 7782;"CLARK";"MANAGER" 7788;"SCOTT";"ANALYST" 7839;"KING";"PRESIDENT" 7844;"TURNER";"SALESMAN" 7876;"ADAMS";"CLERK" 7900;"JAMES";"CLERK" 7902;"FORD";"ANALYST" 7934;"MILLER";"CLERK" c:\Temp> emp.sql: set pagesize 0 linesize 200 set feedback off select empno || ';"' || ename || '";"' || job || '"' from emp order by empno / exit You can find all the docs over at http://tahiti.oracle.com/ Kind regards robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/