Quantcast
Channel: SCN : All Content - All Communities
Viewing all articles
Browse latest Browse all 3280

SMP 3.0 SP08 PL04 Integration Gateway - Create fails on SQL server with Identity Column as PK

$
0
0

Hello Experts,

 

I am running SMP 3.0 Server SP08 PL04. I have a Integration Gateway service deployed which talks to a SQL table in MS SQL Server 2008 R2 via JDBC. This table has a primary key set as an IDENTITY column (autoincremented INT32 type), similar to the one used in the blog by Marvin Hoffmann here: How to use Integration Gateway with SMP 3.0 (Part 3).

I am able to perform GET requests on my SQL table without any problems. On Step 10, Marvin talks about a Create operation. This is done by omitting the IDENTITY column from the request body as shown in the screenshot (No ID property/value specified). I tried the same thing with my table - but I received an error.

I see this error in my Odata Services -> Troubleshooting tab:

 

Cannot insert the value NULL into column 'custSiteDetailTypeId', table 'Routebook.dbo.tblCustomerSiteDetailAttributesInfo'; column does not allow nulls. INSERT fails.

 

If I do send a value for the ID field, I get the common SQL error :

Cannot insert explicit value for identity column in table 'tblCustomerSiteDetailAttributesInfo' when IDENTITY_INSERT is set to OFF.

This error ^ basically means that I need to modify my SQL to be able to successfully INSERT the value I am sending - but this isn't my goal as I am filtering the table to bring down only a subset of the records.

 

I need to be able to perform a GET (Read), POST (Create) and PUT (Update) operations on this table. 

Any idea how to solve this one?

 

Thanks,

Aditya


Viewing all articles
Browse latest Browse all 3280

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>