PROCEDURE InsertCustomerEvaluation( cef_cust_id IN VARCHAR, cef_ce_id out number)AS cef_c_e_id NUMBER; BEGIN BEGIN SELECT CEF_CUSTOMER_EVA_SEQ.NEXTVAL INTO cef_c_e_id FROM dual; cef_ce_id:=cef_c_e_id; INSERT INTO CEF_CUSTOMER_EVALUATION ( C_E_ID, CUST_ID, E_R_ID, SCORE, FILLED_DATE ) VALUES ( cef_ce_id, cef_cust_id, 1, '', sysdate ); END; END InsertCustomerEvaluation;
Below is my code in back end.
public int InsertCustomerEvaluation(string CUST_ID) { OracleParameter C_E_ID = new OracleParameter("C_E_ID", OracleDbType.Decimal); C_E_ID.Direction = ParameterDirection.Output; try { ce_id = _context.Database.ExecuteSqlRaw ("DECLARE C_E_ID NUMBER; BEGIN CEF_APP.InsertCustomerEvaluation(:CUST_ID,:C_E_ID);:C_E_ID:=C_E_ID; END;", new OracleParameter("CUST_ID", CUST_ID), C_E_ID); } catch (Exception e) {
} return ce_id; }
Have you any suggestions to correct above backend code? It gives me -1 return. Procedure works correctly in Oracle sql developer.