Note that there are some explanatory texts on larger screens.

plurals
  1. PODatabase attempts to insert NULL values when a POST request is sent to webservice via RestKit
    primarykey
    data
    text
    <p>When I make a POST request to my webservice, the following error is generated:</p> <blockquote> <p>TinyTds::Error: Cannot insert the value NULL into column 'BankCD', table 'SlotsMasterData.Master.Bank'; column does not allow nulls.</p> </blockquote> <p>The server console displays the following:</p> <p><img src="https://i.stack.imgur.com/ipyve.png" alt="enter image description here"></p> <p>From the above you can see that values exist for all attributes of my Bank object, but suddenly the reference to each is NULL when 'SELECT CAST(SCOPE IDENTITY() ... ' is performed.</p> <p>This is my app code:</p> <pre><code> RKObjectManager *objectManager = [RKObjectManager managerWithBaseURL:[NSURL URLWithString:basePathToWebService]]; RKObjectMapping *bankMapping = [RKObjectMapping mappingForClass:[Banks class]]; NSDictionary *attributeMappingDictionary = [NSDictionary dictionaryWithObjectsAndKeys: @"BankID", @"bankID", @"BankCD", @"bankCD", @"BankName", @"bankName", @"InsertSourceKey", @"insertSourceKey", @"UpdateSourceKey", @"updateSourceKey", @"Active", @"active", nil]; [bankMapping addAttributeMappingsFromDictionary:attributeMappingDictionary]; RKObjectMapping *bankRequestMapping = [RKObjectMapping requestMapping]; [bankRequestMapping addAttributeMappingsFromDictionary:attributeMappingDictionary]; RKResponseDescriptor *responseDescriptor = [RKResponseDescriptor responseDescriptorWithMapping:bankMapping method:RKRequestMethodAny pathPattern:@"/banks" keyPath:nil statusCodes:RKStatusCodeIndexSetForClass(RKStatusCodeClassSuccessful)]; RKRequestDescriptor *requestDescriptor = [RKRequestDescriptor requestDescriptorWithMapping:bankRequestMapping objectClass:[Banks class] rootKeyPath:nil method:RKRequestMethodAny]; [objectManager addResponseDescriptor:responseDescriptor]; [objectManager addRequestDescriptor:requestDescriptor]; [RKMIMETypeSerialization registerClass:[RKNSJSONSerialization class] forMIMEType:@"text/plain"]; //Post [objectManager postObject:bank path:@"/banks" parameters:nil success:nil failure:nil]; </code></pre> <p>Why is an attempt made to insert NULL values? How do I fix this? Thanks for your help!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload