Quantcast
Channel: SCN : All Content - SAP Gateway
Viewing all articles
Browse latest Browse all 2823

How to call a SQL getdate function in an OData URL?

$
0
0

Hi Experts,

 

I just wanted to know if there is a way to call a function in an OData service URL?

 

e.g.

 

I have a table in the SQL backend system and to access a set of information, customer has provided a SQL statement like below:

 

select * from testTable where code='123' and pricedate>=getdate()-365 order by pricedate

 

Now, i have done with OData modeling for the given SQL table and generated one service document URL (using IGW in SMP 3.0).

 

 

 

http://localhost:8080/gateway/odata/SAP/testTable;v=1

 

 

If i had to convert this SQL statement select * from testTable where code='123'  into OData URL then it would be like:

 

http://localhost:8080/gateway/odata/SAP/testTable;v=1?$filter=code eq '123'

 

 

But how to pass a function in the OData URL as mentioned in the given SQL statement? s

 

select * from testTable where code='123' and pricedate>=getdate()-365 order by pricedate

 

 

CC: SMP Developer Center

 

Bjoern Woppmann Can you please guide?

 

Rgrds

JK


Viewing all articles
Browse latest Browse all 2823

Trending Articles



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