InsertCommand problem
Posted: Fri 30 Apr 2010 11:36
Hello,
I found an issue while inserting some datas, using the OracleDataAdapter.
I use Devart.Data.Oracle version 5.60.102.
This is the script for creating the table:
CREATE TABLE TESTTABLE
(
ID NUMBER NOT NULL,
NAME VARCHAR2(200 BYTE),
VAL NUMBER
);
I try to insert 3 rows having the following values:
- 1, 'Peter', '3,4'
- 2 , 'Paul', ''
- 3 , 'Marie', ''
Please follow the steps to reproduce the bug:
- the instanciation of the OracleDataAdapter is done by using the default constructor, OracleDataAdapter().
- create the SelectCommand: adapter.SelectCommand = new OracleCommand(selectCommandText, oracleConnection);
- OracleCommandBuilder ocb = new OracleCommandBuilder(adapter);
- then create the Insert/Update/Delete commands using the statement: (OracleCommand)ocb.GetUpdateCommand().Clone().
- call adapter.Update(ds, "TESTTABLE"); the dataSet 'ds' must contain the values specified above.
The result from DataTable should look like this:
- 1, 'Peter', '3,4'
- 2 , 'Paul', '3,4'
- 3 , 'Marie', '3,4'
As you can see, the row 1 is ok, but the other 2 rows have a wrong value for 'Val' column : '3,4' instead of null !
I analyzed the code and found out that if the instanciation of OracleDataAdapter is done by using the following constructor :
OracleDataAdapter(string selectCommandText, OracleConnection selectConnection), all is working as expected !
Seems that the only difference between the use of the 2 constructors is the value of UpdateBatchSize (1 - for default constructor and 0 for the other constructor).
Please investigate further, and if you need i will provided more information.
Thank you.
I found an issue while inserting some datas, using the OracleDataAdapter.
I use Devart.Data.Oracle version 5.60.102.
This is the script for creating the table:
CREATE TABLE TESTTABLE
(
ID NUMBER NOT NULL,
NAME VARCHAR2(200 BYTE),
VAL NUMBER
);
I try to insert 3 rows having the following values:
- 1, 'Peter', '3,4'
- 2 , 'Paul', ''
- 3 , 'Marie', ''
Please follow the steps to reproduce the bug:
- the instanciation of the OracleDataAdapter is done by using the default constructor, OracleDataAdapter().
- create the SelectCommand: adapter.SelectCommand = new OracleCommand(selectCommandText, oracleConnection);
- OracleCommandBuilder ocb = new OracleCommandBuilder(adapter);
- then create the Insert/Update/Delete commands using the statement: (OracleCommand)ocb.GetUpdateCommand().Clone().
- call adapter.Update(ds, "TESTTABLE"); the dataSet 'ds' must contain the values specified above.
The result from DataTable should look like this:
- 1, 'Peter', '3,4'
- 2 , 'Paul', '3,4'
- 3 , 'Marie', '3,4'
As you can see, the row 1 is ok, but the other 2 rows have a wrong value for 'Val' column : '3,4' instead of null !
I analyzed the code and found out that if the instanciation of OracleDataAdapter is done by using the following constructor :
OracleDataAdapter(string selectCommandText, OracleConnection selectConnection), all is working as expected !
Seems that the only difference between the use of the 2 constructors is the value of UpdateBatchSize (1 - for default constructor and 0 for the other constructor).
Please investigate further, and if you need i will provided more information.
Thank you.