I have a PLSQL FUNCTION. PKG_GAS_KT.GET_DEPTINFO('{UserID}') This function returns the name of the Department the user is in.
Now, I've a list of UserID in java. How can I pass all the UserId's and get the department of the respective user. Is there any way to do it without putting it inside a for loop and making unwanted calls to the database. Also:
CallableStatement callSt = con.prepareCall("{?= call PKG_GAS_KT.GET_DEPTINFO(?)}");`// Is this correct way to call my PLSQL function?
callSt.setInt(1,101);
callSt.registerOutParameter(2, Types.STRING);
callSt.execute();
Double output = callSt.getString(2);
Any guidance is appreciated. I cannot change anything in PLSQL function.