From: ara.t.howard@... Date: 2006-07-27T05:00:18+09:00 Subject: Re: Driving Oracle sqlplus with open3 On Thu, 27 Jul 2006, Daniel Berger wrote: > I tried session like so: > > # sessiontest.rb > require 'rubygems' > require 'session' > > cmd = 'sqlplus foo/xxx@mydb' > sql = 'select sysdate from dual;' > quit = 'quit' > > bash = Session::Bash.new > bash.execute(cmd) do |output, error| > if error > puts "ERROR: #{error}" > exit > end > puts output if output > end > > # Hangs here > bash.execute(:stdin=>sql) do |output, error| > if error > puts "ERROR: #{error}" > exit > end > puts output if output > end > > bash.execute(quit) do |output, error| > if error > puts "ERROR: #{error}" > exit > end > puts output if output > end > try something like bash.execute cmd, 0 => sql+quit, 1 => STDOUT, 2 => STDERR > Then it hangs. > > Am I doing something wrong? Maybe it just isn't possible to interact with > the sqlplus shell through the standard IO handles. :/ possible. you may have to use pty. -a -- suffering increases your inner strength. also, the wishing for suffering makes the suffering disappear. - h.h. the 14th dali lama