on 08-05-2014 6:31 PM
Hi Colleagues,
I've created a xsodata service, and since I'm using a sequence to control the primary key, I've created a procedure to insert the information, calling the sequence.NEXTVAL when doing the insert.
In the header of the procedure I have two parameters (one IN and one OUT), The first parameter (IN) is the row itself, with the information that I need to insert, and the other parameter (OUT) is the error table, to get possible error messages.
Another remark is that, since when doing the post I need to inform all fields, I always perform the post setting ZERO in the ID.
The question is, can I somehow, receive the ID of the record inserted as the result/return of the post?
One idea was to set the ID in the row parameter, but since the row parameter is IN, I cannot modify it...
Thanks and regards,
Roberto Falk
If you want to update the ID and have it returned through the ODATA Response, you should use XSJS exits and not SQLScript Procedure exits.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Thomas,
in fact, we have INOUT parameters, but just scalar parameters are supported. Table types, which is the case here, is not allowed.
Funny, I'm a local HANA instructor here and I've always taught this (INOUT parameters) without really test it / use it. Now I had to test it, for the first time .
Thanks again for your help.
Roberto Falk
Hi Roberto and Thomas,
I face the same issue when using a stored procedure with hdbsequences to create new entries via my XSODATA service using a HTTP POST. I expect the new created ID in the result, but I only get the ID that I had to provide to make the input valid. I'm using the HCP Trial which is currently on HANA 1.00.85.00.397590. Any suggestions / solutions?
Best regards
Gregor
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Can you post the sample code of how you did this ?
I have the same situation.
- POST over XS ODATA and processing in stored procedure.
- IN & OUT defined but OUT is defined as error table.
How can I return the newly created ID to the XS ODATA return without setting it in the error tab (which generated a 400 return).
This post has tought me to use XSJS exit but i'm not sure how to use this.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.