Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Calling Database Procedure in Matlab

13 views
Skip to first unread message

Somesh

unread,
Aug 5, 2009, 3:24:02 PM8/5/09
to
Hi,
I have a funtion in my database with the following signature:

create or replace function DBA.SOME_METRIC return number is

I has no input arguments and a numeric output

When I run from PL/SQL the function returns a valid metric, However when I run from matlab:

x = runstoredprocedure(c,'DBA.SOME_METRIC',{},{java.sql.Types.NUMERIC})

I get the following error:

??? Java exception occurred:
java.sql.SQLException: ORA-06550: line 1, column 7:
PLS-00306: wrong number or types of arguments in call to 'SOME_METRIC'
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored


at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:124)

at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:315)

at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:281)

at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:638)

at oracle.jdbc.driver.T4CCallableStatement.doOall8(T4CCallableStatement.java:183)

at oracle.jdbc.driver.T4CCallableStatement.execute_for_rows(T4CCallableStatement.java:872)

at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1085)

at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:2983)

at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:3056)

at oracle.jdbc.driver.OracleCallableStatement.executeUpdate(OracleCallableStatement.java:4295)


Error in ==> database.runstoredprocedure at 81
csmt.executeUpdate;

Any help is appreciated :)

Regards,
Somi

Sven

unread,
Apr 2, 2010, 1:48:08 PM4/2/10
to
I have exactly this same kind of error. If anyone has successfully run any kind of "Hello world" oracle stored procedure from matlab, it would be great to see an example that works (the one in the MATLAB docs doesn't include the creation of the procedure in oracle).

Thanks,
Sven.

"Somesh " <see...@gmail.com> wrote in message <h5cm8i$48o$1...@fred.mathworks.com>...

Sven

unread,
Apr 2, 2010, 5:26:04 PM4/2/10
to
Ok, let me amend my last post.

I actually have no problem running a stored *procedure*. The error that was occurring in my previous post was only on trying to "run" a function in an oracle package, rather than a procedure.

Perhaps the original poster had the same problem.

Cheers,
Sven

"Sven" <sven.h...@gmail.deleteme.com> wrote in message <hp5ako$sir$1...@fred.mathworks.com>...

0 new messages