-
1. Re: Odata query to call a stored procedure
shawkins Mar 26, 2014 8:55 AM (in response to madhurika_sharma)What is your error, what version are you using, and does your procedure have arguments?
-
2. Re: Odata query to call a stored procedure
rareddy Mar 26, 2014 10:55 AM (in response to madhurika_sharma)Procedure invocation is similar to Entity invocation, try http://localhost:8080/odata/abcViewVDB/abc.abcView
if you have parameters
http://localhost:8080/odata/abcViewVDB/abc.abcView?param=value
Ramesh..
-
3. Re: Odata query to call a stored procedure
madhurika_sharma Mar 28, 2014 8:01 AM (in response to madhurika_sharma)I am querying through OData like this:
http://localhost:8080/odata/vdbname/Procedures?$filter=para1 eq '123' and para2 eq 'ABC'
TEIID31118 Element "para1" is not defined by any relevant group.
I am using Teiid 8.4.0
I am passing two arguments in my procedure.
-
4. Re: Odata query to call a stored procedure
rareddy Mar 28, 2014 8:38 AM (in response to madhurika_sharma)Use of $filter during the procedure invocation is not part of the OData specification, although it mentions that some providers may have extensions like that, however Teiid does not provide it extension currently. If you think that is very useful feature, then you can log an enhancement request in Teiid JIRA.
Ramesh..
-
5. Re: Odata query to call a stored procedure
madhurika_sharma Mar 28, 2014 9:58 AM (in response to madhurika_sharma)Hello Ramesh,
I am able to get the data through the way you told me only if i change my view as a table.
Meaning Database(Stored Procedure) > Source (Stored Procedure in Teiid)>View(Table in Teiid)>odata.This is working .
But if View is a Procedure then because i am not able to tag any column as primary key , i am not getting any data there.
-
6. Re: Odata query to call a stored procedure
shawkins Mar 28, 2014 10:03 AM (in response to madhurika_sharma)> But if View is a Procedure then because i am not able to tag any column as primary key , i am not getting any data there.
Procedures do not have a concept of a primary key.
Did you try calling it without using the filter argument as Ramesh suggested?
http://localhost:8080/odata/abcViewVDB/abc.abcView?param=value
-
7. Re: Odata query to call a stored procedure
madhurika_sharma Mar 28, 2014 11:57 AM (in response to madhurika_sharma)Hello Steven,
ya i have tried that but it's not working.
I guess because usually when i create VDB for table after hitting http://localhost:8080/odata/vdbname
It shows my view table like this:
<collection href="viewtablename">
<atom:title>viewtablename</atom:title></collection>
but in case of procedure , i am not getting any data collection like this.
-
8. Re: Odata query to call a stored procedure
shawkins Mar 28, 2014 4:14 PM (in response to madhurika_sharma)> ya i have tried that but it's not working.
What's not working about it?
> but in case of procedure , i am not getting any data collection like this.
I see that locally as well. I'll have to check whether it's expected for a procedure with a resultset to report that result set as a collection. My guess is that it's not as that would be something like our procedureal relational feature that automagically treats procedures like they are tables.
If you issue a metadata query:
http://localhost:8080/odata/vdbname?$metadata
You should see the procedure in that output:
<FunctionImport Name="abcView" ...>