From: Rob Biedenharn Date: 2008-10-17T03:49:40+09:00 Subject: Re: Ruby with Oracle forward slash error show an example of what type might contain and you'll get more help. -Rob On Oct 16, 2008, at 2:06 PM, Sam Sang wrote: > Ah -- of course! Ok, that one is resolved. More generically how do > we > handle chunks of code in Ruby? Like in this case I have a lot of sql > statements seperated by "/". After the last "/" there might be some > empty lines, or some text which I want to ignore. > > I tried using, > type.each('/') {|s| execute( ((s.gsub %r{^/}, '')).gsub %r{^\n}, '')} > but that gave me an error > > -- execute("") > rake aborted! > OCIError: ORA-24373: invalid length specified for statement: > > > I want to ensure that anything that doesn't end in a "/" should > never be > executed. > > Thanks much for your help again -- have been programming server side > Java and am new to this stuff. > >> Don't use gsub! in this case. You just want gsub (read about what >> gsub! returns if it makes no change in string). >> >> -Rob >> >>> >>>> Instead of submitting the whole file as a single statement (string) >>> Posted via http://www.ruby-forum.com/. >>> >> >> Rob Biedenharn http://agileconsultingllc.com >> Rob@AgileConsultingLLC.com