What does this procedure return? If it returns a LOB or if you set the UpdateCount property on the Virtual Procedure to > 0 then it will be modelled as Action, which is executed with POST
The procedure returns an string: "ok" or "error xxx: bla bla bla". Do you have some suggestion?
Thank you. Regards.
Set the UpdateCount > 0 on the model then.
It doesn't work for me. Maybe I don't understad the complete change.
I defined the following. Do I need add some definition in other section? Do yo see something wrong?
CREATE VIRTUAL PROCEDURE update_estaciones (IN pactivo STRING,
IN jsonestaciones STRING)
RETURNS table(estacion_sk BIGDECIMAL,
MensError VARCHAR(200)) OPTIONS (UPDATECOUNT 4, "REST:METHOD" 'POST')
Thank you so much. Regards.
Does it show up as an "Action" or "Function" in your OData metadata? Action is executed with POST.
BTW, when working with OData none of "REST:" methods apply, those are only for when you want to expose custom REST API.
Oks, I understood wrong the use of the custom REST API.
Where can I see the "Action" or "Funcion". In he $metadata, for the procedure, I only see:
<FunctionImport Name="update_estaciones" ReturnType="Collection(TOW_CONS.update_estaciones_t)" m:HttpMethod="GET" dsds:elementType="TOW_CONS.update_estaciones_t" dsds:isCollection="true" dsds:procedureType="1">
<Parameter Name="pactivo" Type="Edm.String" Mode="In" Nullable="true" />
<Parameter Name="jsonestaciones" Type="Edm.String" Mode="In" Nullable="true" />
yes, above is showing as a Function, not an Action. A function by definition means an immutable request in OData. Also the above does not seem to be generated from Teiid VDB. Teiid does not put any "dsds:" namespaces in the metadata. Which service created the metadata?
Oks. But Is it possible to change the "GET" to "POST"?
We have so customization in the Teiid, so it put the dsds.
BTW, the way you are adding the additional metadata to the OData elements is not specification compliant, you should look into 'Annotations' in OData to define the same data the right way. It is possible that external clients other than your own might fail with the metadata.
Since it looks like you already changed the original Teiid implementation not to honour the UPDATECOUNT > 0 to be ACTION, you need to come up your own semantics of making a Virtual Procedure execute as POST or debug to see why UPDATECOUNT is not working. In my local testing of the UPDATECOUNT I find it working correctly as expected.