필터 지우기
필터 지우기

Is it possible to access an Oracle 19 database from MATLAB 2012b using ODBC?

조회 수: 3 (최근 30일)
Marc Raventós Tato
Marc Raventós Tato 2023년 6월 19일
댓글: chrisw23 2023년 6월 20일
We have some old matlab code we still need to use compiled using matlab 2012b and it stopped working when we updated our database to Oracle 19.
Since then I have been trying to acess the database from matlab without success. I have tried both instantclient 11g and instantclient 19, but none seem to work.
Is this possible?
  댓글 수: 2
Rik
Rik 2023년 6월 19일
You might need to contact the person who (or organization which) created the mex interface. Otherwise you may have to try to make changes to the source code and compile it yourself.
chrisw23
chrisw23 2023년 6월 20일
try the .NET interface. Here are some example lines
NET.addAssembly(fullfile(pwd,'assembly','Oracle.ManagedDataAccess.dll'));
import Oracle.ManagedDataAccess.Client.*
% import Oracle.ManagedDataAccess.Types.*
NET.addAssembly('System.Data');
import System.Data.*
oradb = 'Data Source=ORCL;User Id=hr;Password=hr;';
myOraConnection = OracleConnection(oradb); % Oracle.ManagedDataAccess.Client.OracleConnection
myOraConnection.Open();
myOraCmd = OracleCommand(); % Oracle.ManagedDataAccess.Client.OracleCommand
myOraCmd.Connection = myOraConnection;
myOraCmd.Text = 'select ...';
myOraCmd.Type = CommandType.Text; % System.Data enum Text/StoredProcedure/TableDirect
myOraDataReader = myOraCmd.ExecuteReader();
if myOraDataReader.Read()
qString = myOraDataReader.GetString(0);
else
disp('...file not found');
end

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Database Toolbox에 대해 자세히 알아보기

제품


릴리스

R2012b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by