cancel
Showing results for 
Search instead for 
Did you mean: 

Adding batch records using DI API 6.7

Former Member
0 Kudos

I am trying to add multiple records to a UDT using the DI API. When I add the second and subsequent records and do not specify the values for certain of the fields, they contain the old values when I add the record to the table. I tried using "" as the value but this sets the char fields to empty strings and the numeric fields to 0's. I would like to have these values be null in the DB but the statement:

tbl.UserFields.Fields.Item(k).Value = System.DBNull.Value;

Does not work. Only the following seems to work but is not what I want.

tbl.UserFields.Fields.Item(k).Value = "";

Do I have to delete and recreate the tbl object for each record?

Accepted Solutions (1)

Accepted Solutions (1)

former_member185703
Active Contributor
0 Kudos

Hi Gary,

Unfortunately you are right and found a gap:

DI API does not support setting Value back to "empty"/"null"... - except for memo fields.

I.e. the only way to get this is currently to delete / recreate the tbl object for each record - or use a SQL statement in case this is not tolerable in terms of performance.

Regards,

Frank

Answers (0)