B4J Question SQL Procedures / Oracle

XbNnX_507

Active Member
Licensed User
Longtime User
Hi, i have this procedure in a OracleDatabase just for testing..
B4X:
create or replace PROCEDURE PROCEDURE1(cursorParam OUT SYS_REFCURSOR)
 IS
  BEGIN
   OPEN cursorParam FOR
    SELECT * FROM TABLAPRUEBA;
END ;

I'm calling this Procedure from B4J with this:
B4X:
Dim ObjectCall As Object = sql.CreateCallStatement("{CALL PROCEDURE1}", Array() )
    Dim rs As ResultSet = sql.ExecCall( ObjectCall )

It throws me this error:
B4X:
java.sql.SQLException: ORA-06550: line 1, column 7:
PLS-00306: wrong number or types of arguments in call to 'PROCEDURE1'
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored

what am i doing wrong ?
 

XbNnX_507

Active Member
Licensed User
Longtime User
B4X:
CallableStatement cstmt = conn.prepareCall("{? = CALL PROCEDURE(?)}");   
cstmt.registerOutParameter(1, Types.FLOAT); ' <- how to set this ? outParameter ? 
cstmt.executeUpdate();
 
Upvote 0

OliverA

Expert
Licensed User
Longtime User
I don’t think you use AddOutputParameter. There is a FetchResultSet method. Look at the example posted
 
Upvote 0
Top