[Top][All Lists]

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

Re: Querying an Oracle DB from Octave?

From: CdeMills
Subject: Re: Querying an Oracle DB from Octave?
Date: Mon, 25 Jul 2011 01:09:30 -0700 (PDT)

markbn wrote:
> Hi,
> I need to query data stored in Oracle databases. Is there any octave
> package that allows this? 
> I read about octave-swig, but it does not have direct Oracle support. At
> most I guess I would need to use ODBC but I running octave from Linux and
> I don't have an administrative account to install ODBC anyway

Enclosed you'll find a script using perl ODBC interface. In your octave
script, you have to follow this pattern:
perl_sql = strcat("perl ./octave_sql_pipe ",dbname," ",dbuser," ",dbpw);

command  = strcat(perl_sql," ","\"select Id from SomeTable where Date >='", 
                      some_date, "'\"");
    list_file = popen(command, "r");
    Id = fscanf(pd_list_file,"%d");

It's a bit rudimentary, you should better enclose it in try/catch blocks,
but it does the job. The only supplemental dependencies are perl with ODBC.



View this message in context:
Sent from the Octave - General mailing list archive at

reply via email to

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