Hi
Here is the code being used to call a stored procedure named sp_update_status.
Stored procedure
PROCEDURE sp_update_status (
payment_id IN payment.PAYMENT_ID%TYPE,
payment_status_id IN payment.PAYMENT_STATUS_ID%TYPE,
user_modified IN payment.USER_MODIFIED%TYPE,
result OUT NUMBER) IS
BEGIN
UPDATE payment mp
SET MP.PAYMENT_STATUS_ID = payment_status_id,
MP.USER_MODIFIED = user_modified,
MP.DATE_MODIFIED = SYSDATE
WHERE MP.PAYMENT_ID = payment_id;
result := 1;
EXCEPTION
WHEN OTHERS THEN
result := 0;
END sp_update_status;
.Net Code
// Create a connection
OracleConnection objConTest = GetNewConnection();
objConTest.Open();
// Create a command
OracleCommand objCmdTest = new OracleCommand("sp_update_status", objConTest);
objCmdTest.CommandType = CommandType.StoredProcedure;
objCmdTest.Parameters.Add(new OracleParameter("payment_id", OracleDbType.Long));
objCmdTest.Parameters.Add(new OracleParameter("payment_status_id", OracleDbType.Long));
objCmdTest.Parameters.Add(new OracleParameter("user_modified", OracleDbType.VarChar));
objCmdTest.Parameters.Add(new OracleParameter("result", OracleDbType.Integer,ParameterDirection.Output));
objCmdTest.Parameters["payment_id"].Value = new long[] {58, 62};
objCmdTest.Parameters["payment_status_id"].Value = new long[] { 6, 6 };
objCmdTest.Parameters["user_modified"].Value = new string[] { "Test", "Test" };
objCmdTest.Parameters["result"].Value = new int[] { 0, 0 };
objCmdTest.ExecuteArray(2);
objConTest.Close();
objCmdTest.Dispose();
The error we get is:System.InvalidCastException: Unable to cast object of type 'Devart.Data.Oracle.ch[]' to type 'Devart.Data.Oracle.ch'.
Search found 3 matches
- Tue 06 Mar 2012 21:36
- Forum: dotConnect for Oracle
- Topic: Bulk Insert of VARRAYS
- Replies: 11
- Views: 5983
- Tue 14 Feb 2012 22:15
- Forum: dotConnect for Oracle
- Topic: Bulk Insert of VARRAYS
- Replies: 11
- Views: 5983
Bulk Insert error
Upgraded to the latest build 6.70.302 and getting the following message now
Unable to cast object of type 'Devart.Data.Oracle.ch[]' to type 'Devart.Data.Oracle.ch'
Unable to cast object of type 'Devart.Data.Oracle.ch[]' to type 'Devart.Data.Oracle.ch'
- Tue 14 Feb 2012 21:03
- Forum: dotConnect for Oracle
- Topic: Bulk Insert of VARRAYS
- Replies: 11
- Views: 5983
Bulk insert Error
Hello,
I am trying to do a bulk insert in to an oracle database using Devart's dotconnect for oracle component, version 6.60.283.0.
Upon running the ExecuteArray method I get an exception with the following message
Unable to cast object of type 'Devart.Data.Oracle.ce[]' to type 'Devart.Data.Oracle.ce'."
What does this error mean? and what should I do in order to successfully do a bulk insert?
Thanks
I am trying to do a bulk insert in to an oracle database using Devart's dotconnect for oracle component, version 6.60.283.0.
Upon running the ExecuteArray method I get an exception with the following message
Unable to cast object of type 'Devart.Data.Oracle.ce[]' to type 'Devart.Data.Oracle.ce'."
What does this error mean? and what should I do in order to successfully do a bulk insert?
Thanks