I am using IBM .NET Provider with .NET 4.0. The version of DB2 is V6R1 on iSeries.

I'm trying to insert multiple rows with an identity column with Entity Framework 4.1. When I try to insert multiple rows, it fails on the second insert statement with the following error:

IBM.Data.DB2.DB2Exception: ERROR 07003 IBMAS SQL0518N L'instruction désignée dans l'instruction EXECUTE n'est pas préparée ou il s'agit d'une instruction SELECT ou VALUES.
Entity Framework generate the following SQL statements in the same transaction :
select ID_IDENT as ID_IDENT from new table ( insert into DEV.N_IDENTITY( LABEL) values ( 'Label1' ) )
select ID_IDENT as ID_IDENT from new table ( insert into DEV.N_IDENTITY( LABEL) values ( 'Label2' ) )

I did a test with DBCommand and I get the same result. However, when I execute these statements with iNavigator, it works. What can I do to resolve this issue?

有帮助吗?

解决方案

Après multiple recherche et test avec le support IBM. Voici la solution qui a débloqué la situation. Installer la ptf SI48310. Ensuite, l'insertion dans les colonnes à auto-incrément fonctionne parfaitement avec Entity Framework.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top