0

I have a procedure with parameter IN type BOOLEAN

create or replace procedure p(count_in in int, enabled_in in BOOLEAN) is
BEGIN   
 ...
END;

I tried to call this procedure from Java JPA with Entity Manager. Java code below

StoredProcedureQuery proc = em.createStoredProcedureQuery("p");
proc.registerStoredProcedureParameter(count_in, Integer.class, ParameterMode.IN)
    .registerStoredProcedureParameter(enabled_in, Boolean.class, ParameterMode.IN)
...

I got error message:

ORA-06550: line 1, column 7:\nPLS-00306: wrong number or types of arguments in call to 'p' ...

The problem is the second BOOLEAN parameter. The question is:

How to pass a boolean value to the stored procedure in java?

Thanks

Eric
  • 1,031
  • 4
  • 14
  • 29

0 Answers0