on 02-26-2017 1:39 PM
Hi Experts,
I have written a exist procedure to delete data from the database table using XSODATA. On debugging, the procedure just runs fine and data is deleted from the table but while trying to delete a record through the service using POSTMAN i get an error
Service exception: [260] invalid column name.
PROCEDURE
PROCEDURE "XYZ"."ABC_PK.PROCEDURES::SocialDataDeleteCategory"
(
in ip "XYZ"."ABC_SOCIAL_DATA_CATEGORIES",
out op "XYZ"."ABC_PK.STRUCTURES::MESSAGE"
)
LANGUAGE SQLSCRIPT
SQL SECURITY INVOKER AS
--DEFAULT SCHEMA <default_schema_name>
--READS SQL DATA AS
ls_social_data_id_del INTEGER;
BEGIN
/*****************************
Write your procedure logic
*****************************/
SELECT TOP 1 "SOCIAL_DATA_ID"
INTO ls_social_data_id_del
FROM :ip;
IF ls_social_data_id_del IS NULL THEN
op = SELECT 430 as HTTP_STATUS_CODE,
'Provide social_data_id' as MESSAGE,
'' as DETAIL
FROM dummy;
ELSE
DELETE FROM "XYZ"."ABC_SOCIAL_DATA_CATEGORIES"
WHERE "SOCIAL_DATA_ID" = :ls_social_data_id_del;
COMMIT;
END IF;
END;
Service:
service {
"XYZ"."ABC_SOCIAL_DATA_CATEGORIES" as "CATEGORY" with ("SOCIAL_DATA_ID","CATEGORY_ID")
delete using "ABC_PK.PROCEDURES::SocialDataDeleteCategory"
;
}
Best Regards
Madhusudan
Looks strange. On which HANA version/SPS you are?
Have you tried to remove the "with" statement in the service definition for test purposes, so that the service is not restricted to the SOCIAL_DATA_ID and CATEGORY_ID field?
I could reproduce the error just in case I use the "with" statement in combination with an exit. Either removing the exit or the "with" statement solves that.
I would open a ticket for that, so that SAP can bring some light on that behavior. Maybe it is a bug, because also nothing is written about that in the documentation.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Florian,
Thanks for helping out .... tried removing the "with" clause & it worked like a charm but its more of a hit & trial here.
Great that you have reported the issue to SAP. It would be of great help if you point to any source for learning xsodata apart from HANA Developer guide.
Best Regards
Madhusudan
Thanks for your help..
Apologies posting late, my earlier reply some how did not appear here.
I am on AWS and the version reads as 1.00.110.001447753075.
Removing "with" did work for me as well.
Best Regards
Madhusudan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.