tags:

views:

40

answers:

1

Hi,

I am loading data for tests in tables using xml and ndbunit.But,for a table having computed column,I am having problem.I get this error

The column "xyz" cannot be modified because it is either a computed column or is the result of a UNION operator.

I have modified the INSERT and UPDATE commands(removed the computed column) of sqladapter in xsd file,but still face the issue.

thanks

A: 

NDbUnit pays no attention to the SQLAdapter(s) that may be within your dataset's XSD file. They play no role at all in how NDbUit operates. In fact you can (safely) remove them from the dataset XSD file and NDbUnit will not care either way.

Instead, NDbUnit uses the structure of the XSD for the dataset as its 'scope' re: what tables/columns to operate on. Because of this, the proper way to tell NDbUnit to 'ignore' dealing with one or more tables/columns is to remove the table/column from the dataset entirely.

In your case, if you remove the computed column from the XSD then NDbUnit will not be 'aware' of the computed column and will not perform any operations upon it (INSERT, UPDATE, etc.)

In short, you're close with your approach (editing the dataset XSD to ignore the computed column) but you're simply editing the wrong part of the dataset schema to inform NDbUnit to ignore your computed column.

sbohlen