Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8644

Calculation view exposed on OData with CUD operations

$
0
0

Hello,

 

I have a Calculation view, 'schema::calcview1' which selects data from table1 with some logic. This view is exposed in OData as below,

 

OData:


service {    "schema::calcview1" as "calcview1" keys generate local "AutoGeneratedId"
create using "schema::insert_test";
}


table1:

 

CREATE COLUMN TABLE "schema"."Test"
(
ID INTEGER PRIMARY KEY
);


schema::insert_test:


PROCEDURE "schema"."schema::insert_test"
(IN row "schema"."table1",
out error "schema"."TT_ERROR")       LANGUAGE SQLSCRIPT       SQL SECURITY INVOKER       -- READS SQL DATA       AS
BEGIN
declare ID string;
select "ID"
into ID
from :row;
if :ID= '' then    error = select 400 as http_status_code,            'empty field' as error_message,            'ID must be provided' as detail from dummy;
else    insert into "schema"."table1" (ID) values (:ID);
end if;
END;

 

GET operation on OData works fine. But when I use POST, I get the below error:

 


501 Not Implemented
<?xml version="1.0" encoding="utf-8" standalone="yes" ?><errorxmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"><code/>

 

<messagexml:lang="en-US">Feature not supported.</message></error>

If I use "schema::table1" directly in OData instead of calcview1, both GET & POST works fine and record is inserted using the SP insert_test.

 

Does this means that OData doesn't support CUD for Calculation View? Or am I missing some steps?

 

Thanks,

Ramees


Viewing all articles
Browse latest Browse all 8644

Trending Articles



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