EDITED FOR UPDATE - URGENT
Hi Folks
Guess this is a lack of understanding of the way Servoy saves data but… I have a form based on a table with 2 required columns, one a DB_Identity and another a user entered data.
I use foundset.newRecord(true) to add a record to the table on which the form is based. After user input for the second required column I do a databaseManager.saveData() and get the rerror:
save failed for 1 or more records
com.servoy.j2db.dataprocessing.DataException: Parameter #7 has not been set.
Looking at the log I have this query being created by Servoy and failing:
Error executing sql: SET IDENTITY_INSERT fabric_system_paint_header ON insert into fabric_system_paint_header (fph_id, fph_system_code, fph_long_description, fph_name, fph_changed_by, fph_date_changed, fph_edited_not_calced) values (?, ?, ?, ?, ?, ?, ?) SET IDENTITY_INSERT fabric_system_paint_header OFF select scope_identity() with params: [null, ‘1-1’ ,type: java.lang.String, ‘Test’ ,type: java.lang.String, ‘Test2’ ,type: java.lang.String, NullValue with type: 12 ,type: com.servoy.j2db.dataprocessing.ValueFactory$NullValue, NullValue with type: 93 ,type: com.servoy.j2db.dataprocessing.ValueFactory$NullValue, NullValue with type: 4 ,type: com.servoy.j2db.dataprocessing.ValueFactory$NullValue]
Only the two (fph_id, fph_system_code) columns are required, and db_identity is set to ‘on’, both in the Servoy sequence area and also in the MSSQL Db, so where does the failure on parameter #7 come from??? and why does the SET IDENTITY_INSERT fabric_system_paint_header change to OFF???
PS Both these columns are set as PK
Appreciate feedback.
EDIT: Using a test table and form - this works without the above error (though its not what I wanted to use):
Column: test_id; Type int; Identity; Allow Null=No;PK
Column: test_field; Type string; Allow Null=Yes
This fails with the above error:
Column: test_id; Type int; Identity; Allow Null=No;PK
Column: test_field; Type string; Allow Null=No;PK
And so does this fail with the above error:
Column: test_id; Type int; Identity; Allow Null=No;PK
Column: test_field; Type string; Allow Null=Yes;PK
The structure below was working in Servoy 5x but fails now?
Column: test_id; Type int; Identity; Allow Null=No;PK
Column: test_field; Type string; Allow Null=No;PK
We have several tables with these structures all of which (as far as I can tell) have been working fine to date - or at least until the upgrade to 6. It also looks completely acceptable in other tools such as Navicat and MSMMS (adding records works as anticipated). I’d appreciate it if you could point me i the direction of discovering if I have done something crazy in our system and caused this structure to now fail?
Ian