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?=