Trouble using proceedure "batch query "

CREATE OR REPLACE PROCEDURE procedure_name(batch query(ID int(11))RETURNS void .

using java how i can make call to this procedure.

Java code

StoredProcedureQuery spq = em.createStoredProcedureQuery(“sp_onhandrecon_get3pldata”);

		List<MemSqlData> arraylist = new ArrayList<>();
		//arraylist.add(memSqlDataList.get(0).getId());
		
		spq.registerStoredProcedureParameter(1,memSqlDataList.getClass(), ParameterMode.IN);
		spq.setParameter(1, memSqlDataList);

Exception

Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.springframework.orm.jpa.JpaSystemException: Error calling CallableStatement.getMoreResults; nested exception is org.hibernate.exception.GenericJDBCException: Error calling CallableStatement.getMoreResults] with root cause

java.sql.SQLException: It is not valid to create a value of type 'query(ID int(11) NULL

Any help will be appreciated

Looks like we’re missing the end of the error message MemSQL is providing.

Not 100% sure, but my guess is we’re feeding the value NULL for the SP parameter batch. That error message crops up when one tries to initialize a query type variable with NULL. Query type variables are non-nullable in MPSQL.

For instance,

drop database if exists db;
create database db;
use db;

delimiter //
create or replace procedure foo(q query(a int)) as
begin
end //
delimiter ;

-- ERROR 2211 (HY000) at line 12 in file: '/home/evan/yes.sql': It is not valid to create a value of type 'query(`a` int(11) NULL)' from 'NULL' because the types are incompatible
call foo(null);