From: Sam Sang Date: 2008-10-17T04:28:03+09:00 Subject: Re: Ruby with Oracle forward slash error ############# BEGINNING OF SQL FILE BEGIN EXECUTE IMMEDIATE 'DROP TYPE crosstab_report_tbl'; EXCEPTION WHEN OTHERS THEN NULL; END; / CREATE OR REPLACE TYPE agg_obj AS OBJECT ( state_sid NUMBER(22), state_code VARCHAR2(32), ); / CREATE OR REPLACE TYPE agg_tbl AS TABLE OF agg_obj; / # 2 empty lines at the end of the file ############ ENDOF SQL FILE ################# BEGINNING OF RUBY FILE class ArisGrowthReportObjectType < ActiveRecord::Migration def self.up type = File.open(File.join(File.dirname(__FILE__),'test.sql')).read type.each('/') {|s| execute( (s.gsub %r{^/}, '')) } end def self.down end end ################# END OF RUBY FILE This throws the error: -- execute("\n\nCREATE OR REPLACE TYPE agg_tbl AS TABLE OF agg_obj;\n") -> 0.0310s -> 0 rows -- execute("\n\n") rake aborted! OCIError: ORA-00900: invalid SQL statement: (See full trace by running task with --trace) Thanks! Rob Biedenharn wrote: > show an example of what type might contain and you'll get more help. > > -Rob -- Posted via http://www.ruby-forum.com/.