Skip to Content

Create oData service using oracle Store procedure

Hello Experts,

I need to create oData service from oracle store procedure,

what are the steps to do it.

We are using SMP Integration gateway.

Please Suggest.

Regards

Manish

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Posted on Mar 12, 2015 at 06:26 AM


    l@Jitendra Kansal

    Any suggestion on this.


    Regards

    Manish

    Add a comment
    10|10000 characters needed characters exceeded

    • Hi Bjoern,

      Thanks for reply.

      I have 2 tables which are joined using association in oData modeling, I want to use $expand to show output of 2 tables in oData, i tried but it does not give desired output.

      Do I need to write custom script to join 2 tables if yes can you give one example.

      Regards

      Manish

  • Posted on Mar 25, 2015 at 10:43 PM

    Moved to SMP Developer Center from SAP for Mobile as more appropriate topic for that community.

    Regards, Mike (Moderator)

    Add a comment
    10|10000 characters needed characters exceeded

    • Hello Experts,

      Here is my code to join 2 tables , in debug it does not give error, but it gives on only one table output not merged output.

      Please suggest.

      function processRequestSQL(message) {
      
      
        //Import statements
        importPackage(com.sap.gateway.ip.core.customdev.util);
        importPackage(java.util);
        importPackage(org.apache.olingo.odata2.api.edm);
        importPackage(com.sap.gateway.core.ip.component.commons);
        importPackage(org.apache.olingo.odata2.api.uri);
        importPackage(com.sap.gateway.ip.core.customdev.logging);
      
      
        //Get the SQL statement contained in message body
        var sqlStatement = message.getBody();
        var uriInfo = message.getHeaders().get(ODataExchangeHeaderProperty.UriInfo.toString());
        var map = new HashMap();
        map = uriInfo.getCustomQueryOptions();
      
      
      
      
        //Create the query and sub query
        var JOIN_WO_WHERE = "INNER JOIN ZONE ON AREA.AREA_ID = ZONE.AREA_ID ";
        var WHERE = " WHERE ";
        var JOIN = " INNER JOIN ZONE ON AREA.AREA_ID = ZONE.AREA_ID ";
        //Modify the SQL statement
        var modifiedSqlStatement = "";
        var entitySet = uriInfo.getStartEntitySet();
      
        var odataMethod = message.getHeaders().get(ODataExchangeHeaderProperty.ODataMethod.toString());
        modifiedSqlStatement += sqlStatement;
        if (odataMethod.toString() == "GET_FEED") {
        entitySetName = entitySet.getName();
        if (entitySetName == "AREA") {
      
        if (sqlStatement.indexOf("WHERE") != -1
        || sqlStatement.indexOf("where") != -1) {
        modifiedSqlStatement += JOIN_WO_WHERE;
        } else {
        // modifiedSqlStatement += WHERE;
        modifiedSqlStatement += JOIN;
        }
      
        }
      
        }
        //Set the message body back with the modified SQL statement
        message.setBody(modifiedSqlStatement);
      
        //Logger
        log.logErrors(LogMessage.TechnicalError, "This is first log");
      
      
        //Set the message body back with the modified SQL statement
        message.setBody(modifiedSqlStatement);
      
        //Logger
        log.logErrors(LogMessage.TechnicalError, "This is first log");
      -------------------End Sample Implementation---------------------------------------
      */
        return message;
      }
      
      

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.