[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Querying an Oracle DB from Octave?

From: forkandwait
Subject: Re: Querying an Oracle DB from Octave?
Date: Mon, 25 Jul 2011 19:44:24 +0000 (UTC)
User-agent: Loom/3.14 (

markbn <anonymoususr <at>> writes:

> At any rate, for querying an oracle DB I guess I need the Oracle
> Client anyway (which is already installed there as far as I know),
> and I suppose sqlplus is part of it? I have never used that program.
> > You can also also run sqlplus with popen2 from octave to establish
> > a two way connection via pipes and send the commands one by one to
> > it and receive the output also that way.

> That sounds better than the pure command line approach. Thanks for
> pointing this out.

I have hacked together similar scripts using "psql" which is the
Postgres version of "sqlplus".  I wrote an octave function that takes
a SQL query and database info, executes it writing the output to a
file, and then reads that file in and returns the matrix created.
Unix text tools (sed, awk, tr) are your friends here, to make sure the
output is parseable as numbers.  A pipe would be slightly more
graceful, too.

I don't have that script handy, but if you care I could post it in a
couple of days.

BTW -- I am always glad to hear when people refuse to install Java ... 

reply via email to

[Prev in Thread] Current Thread [Next in Thread]