Problem with 9.7.26
Posted: Fri 28 Oct 2016 09:06
We would like to switch our development to your latest version of Oracle Data Access Components but we have massive problemes with this version. We investigated our problems and it seems that there is a diffence in the parameter handling between 9.7.25 and 9.7.26.
Using the following example we would like to show the problem:
We have a table with two string columns - VALUE1 and VALUE2 - and we want to insert a new entry. VALUE1 is empty so we do not set this value explicitly. Everything works fine - there is no error and the dbMonitor shows the correct SQL-Statement and the correct parameter values:
* VALUE1 - NULL
* VALUE2 - Test1
But in the database VALUE1 is filled with "Test1" and VALUE2 is empty.
It seems that the value for the second parameter is used for the first one because this one is not explicitly set.
When we execute this example with ODAC 9.7.25 everything works fine and correctly. The value "Test1" is filled in column VALUE2 and column VALUE1 is empty.
Is it now necessary to explicitly set the values for empty columns? Or are we doing anything else wrong? Or is there an error in the version 9.7.26?=
Using the following example we would like to show the problem:
Code: Select all
sql.SQL.Add('INSERT INTO DISPO2.TB_TEST (ID, VALUE1, VALUE2) VALUES (:ID, :VALUE1, :VALUE2)');
sql.ParamByName('ID').ParamType := ptInput;
sql.ParamByName('ID').DataType := ftFloat;
sql.ParamByName('VALUE1').ParamType := ptInput;
sql.ParamByName('VALUE1').DataType := ftString;
sql.ParamByName('VALUE2').ParamType := ptInput;
sql.ParamByName('VALUE2').DataType := ftString;
sql.ParamByName('ID').AsFloat := 1;
sql.ParamByName('VALUE2').asstring := 'Test1';
sql.execute;
* VALUE1 - NULL
* VALUE2 - Test1
But in the database VALUE1 is filled with "Test1" and VALUE2 is empty.
It seems that the value for the second parameter is used for the first one because this one is not explicitly set.
When we execute this example with ODAC 9.7.25 everything works fine and correctly. The value "Test1" is filled in column VALUE2 and column VALUE1 is empty.
Is it now necessary to explicitly set the values for empty columns? Or are we doing anything else wrong? Or is there an error in the version 9.7.26?=