We use custom Oracle Stored procedure to insert/update tables, the Stored procedure returns 3 out parameters:
PROCEDURE SP_ADDR_PURPOSE ( I_APP_CD IN VARCHAR2, I_PURPOSE IN VARCHAR2, I_DESC IN VARCHAR2 I_MAX_NUM IN NUMBER I_UPDATABLE_BY_OTHER IN VARCHAR2 I_RETENTION_DT IN VARCHAR2 I_REC_STATUS IN VARCHAR2 I_UPD_USER IN VARCHAR2, O_PAP_PURPOSE_ID OUT NUMBER, O_RESULT OUT VARCHAR2, O_MSG OUT VARCHAR2 );
The nativeQuery is: @NamedNativeQuery(name="setUpPurpose", query="call PK_PERS_ADDRESS.SP_ADDR_PURPOSE( ?, " + " :I_APP_CD, :I_PURPOSE, :I_DESC, :I_MAX_NUM, :I_UPDATABLE_BY_OTHER, :I_RETENTION_DT, " + " :I_REC_STATUS, :I_UPD_USER)")
The question is: How should I register these out parameters O_PAP_PURPOSE_ID , O_RESULT, O_MSG?
In DAO:
Query query = getSession().getNamedQuery("setUpPurpose") .setParameter("I_APP_CD", applicationAddressPurpose.getApplication().getApplicationCode()) .setParameter("I_PURPOSE", applicationAddressPurpose.getPurpose().getPurposeType()) .setParameter("I_DESC", applicationAddressPurpose.getPurpose().getDescription()) .setParameter("I_MAX_NUM", applicationAddressPurpose.getPurpose().getMaxNumber()) .setParameter("I_UPDATABLE_BY_OTHER", applicationAddressPurpose.getPurpose().getIsUpdateble()) .setParameter("I_RETENTION_DT", applicationAddressPurpose.getPurpose().getRetentionDate()) .setParameter("I_REC_STATUS", "A") .setParameter("I_UPD_USER", applicationAddressPurpose.getAddUser());
Any help will be appreciated.
|