I have a stored procedure which takes in an user defined Data type. Basically this Data type is a List of Department IDs which needs to be inserted to the DB after certain business validation.
The package declaration is:
PACKAGE BODY Data_Upload_Pkg
IS
PROCEDURE SP_EXCL_DEPT_UPLOAD(
Ad_From_Dttm VARCHAR2,
Department_List P_Excl_Dept_Array,
V_Messg OUT VARCHAR2)
I'm trying to use STRUCT while trying to call the Stored Procedure. But while instantiating the STRUCT instance variable, the stored procedure gets called and I'm getting an exception as that of wrong number of arguments are being passed.
My code goes as below:
SimpleJdbcCall procUploadDept = new SimpleJdbcCall(getDataSource())
.withCatalogName("DATA_UPLOAD_PKG").withProcedureName(
"SP_EXCL_DEPT_UPLOAD");
MapSqlParameterSource temp = new MapSqlParameterSource();
temp.addValue("AD_FROM_DTTM", "");
Object[] deptObjArray = new Object[2];
deptObjArray[0] = 800;
deptObjArray[1] = 900;
StructDescriptor deptStructDesc;
WebSphereNativeJdbcExtractor var = new WebSphereNativeJdbcExtractor();
oracle.jdbc.OracleConnection con = (oracle.jdbc.OracleConnection) var
.getNativeConnection(getConnection());
deptStructDesc = StructDescriptor.createDescriptor(
"P_EXCL_DEPT_ARRAY", con);
// deptStructDesc.
STRUCT empStruct = new STRUCT(deptStructDesc, con, deptObjArray);
temp.addValue("DEPARTMENT_LIST", empStruct);
// SqlParameterSource in = temp;
Map out = procUploadDept.execute(temp);
String message = out.get("V_MESSG").toString();
Please let me know where I'm going wrong?
Aucun commentaire:
Enregistrer un commentaire