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

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;

Similar Messages

  • Using Oracle Stored Procedure in Interactive Reporting

    Hello,
    i'm trying to use Oracle Store procedure in Interactive reporting but all i get are errors.
    My env:
    Interactive Reporting 9.3.1
    Oracle Database 10.2
    I created OCE as ODBC/OBDC. Tables are returned and Stored Procedure entry is enabled.
    If i use "microsoft ODBC for Oracle" i can see stored procedure list but i get this error:
    SQL API: [SQLExecDirectW], SQL RETURN: [-1], SQL STATE: [42000], SQL NATIVE ERROR: [6550], SQL MESSAGE: [[Microsoft][ODBC driver for Oracle][Oracle]ORA-06550: line 1, column 7:
    PLS-00306: wrong number or types of arguments in call to 'TEST_PDC_RECORDSET'
    If i use Oracle's odbc i get: "Error in function sequence".
    If i use Merants (5.2) odbc i cannot retreive stored procedure list. (list is empty)
    Note.
    My stored procedure works (tested via sqlplus).
    thank u daniele

    Returning (or sending in) multiple rows directly from (or to) a stored procedure is not currently possible. I have been in contact with SAP on this subject earlier, and they suggest using a web service to do the job. I used this as a work around, calling the stored procedure from a web service. I send in VC tables to this web service, and this in turn contacts my stored procedure.
    The problem is related to the connector framework in the J2EE environment.
    I am on 7.0 sps 17
    If you use stored procedure single value parameters of type varchar, number ... then VC has no problem communicating with your procedures.
    Good luck
    Henning Strand

  • Creating Web service for PL/SQL Procedure with Complex Data Types

    I need to created web service for PL/SQL Procedure with Complex Data types like table of records as parameters, how do we map the pl/sql table type parameters with web service, how to go about these?

    Hello,
    When you are creating a service from a Stored Procedure, the OracleAS WS tools will create necessary Java and PL wrapper code to handle the complex types (table of record) properly and make them compatible with XML format for SOAP messages.
    So what you should do is to use JDeveloper or WSA command line, to create a service from your store procedure and you will see that most of the work will be done for you.
    You can find more information in the:
    - Developing Web Services that Expose Database Resources
    chapter of the Web Service Developer's guide.
    Regards
    Tugdual Grall

  • How to Create and Deploy Web Services Using Oracle 9i JDeveloper

    Hi,
    My Question is how to create and deploy Web Services using Oracle 9i JDeveloper.Anybody please give me a detailed Reply.Please Reply to [email protected]
    Hopr to Hear From you,
    Regards,
    G Sreekumar

    You could use datasources. You should do this in your BC4J Configuration. Then when deploying your applicaiton use the command -installDataSource (from admin.jar) to create the right datasource.
    You could probably use the name of your connection + "DS" so you can also use it locally in JDeveloper as JDev seesm to create this automaticly for your Connections.

  • To  use cursor as an OUTPUT paramete in Oracle Store Procedure

    I want to return a ref cursor from an oracle store procedure. Is is possible? How? Syntax?

    yes I think it is possible its syntax is
    CREATE OR REPLACE
    PROCEDURE GetEmpRS1 (p_recordset1 OUT SYS_REFCURSOR,
                  p_recordset2 OUT SYS_REFCURSOR,
                  PARAM IN STRING) AS
    BEGIN
      OPEN p_recordset1 FOR
      SELECT RET1
        FROM MYTABLE
        WHERE LOOKUPVALUE > PARAM;
      OPEN p_recordset2 FOR
      SELECT RET2
       FROM MYTABLE
       WHERE LOOKUPVALUE >= PARAM;
    END GetEmpRS1;

  • How to create a counter using Oracle SQL Developer?

    Is there any way to create a counter using Oracle SQL Developer to create the below scenario. Meaning it will recorded down the name of user and ID and time and the date they login.
    Library portal home statistics shows how many users (outside and within the campus) visit the library portal.
    Page Access statistics is recorded on an hourly basis. Users may select the statistics by
    yearly (statistics displayed by all months in the selected year)
    monthly (statistics displayed by all days in the selected month)
    daily (statistics displayed by all hours in the selected day)

    I'm giving here one basic post - hope this will solve your problem --
    SQL>
    SQL>
    SQL> create table audit_info
      2   (
      3     usr        varchar2(50),
      4     log_time   timestamp(6)
      5    );
    Table created.
    SQL>
    SQL>
    SQL>  create table err_log
      2     (
      3       log_cd      varchar2(20),
      4       log_desc    varchar2(500)
      5     );
    Table created.
    SQL>
    SQL>
    SQL>   create or replace procedure ins_err(errcd   in  varchar2,
      2                                        errnm   in  varchar2)
      3    is
      4      pragma autonomous_transaction;
      5    begin
      6      insert into err_log values(errcd,errnm);
      7      commit;
      8    end;
      9  /
    Procedure created.
    SQL>
    SQL>
    SQL>   create or replace procedure ins_aud(ud   in varchar2,
      2                                        unm  in varchar2)
      3    is
      4      pragma autonomous_transaction;
      5    begin
      6      insert into audit_info values(ud,unm);
      7      commit;
      8    exception
      9      when others then
    10        ins_err(sqlcode,sqlerrm);
    11    end;
    12  /
    Procedure created.
    SQL>
    SQL>
    SQL>
    SQL> create or replace trigger log_odsuser1
      2   after logon on odsuser1.schema
      3   begin
      4     ins_aud('ODSUSER1',sysdate);
      5   exception
      6     when others then
      7       ins_err(sqlcode,sqlerrm);
      8   end;
      9  /
    Trigger created.
    SQL>
    SQL*Plus: Release 9.2.0.1.0 - Production on Tue Jun 12 12:21:09 2007
    Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.
    Connected to:
    Oracle9i Enterprise Edition Release 9.2.0.6.0 - 64bit Production
    With the Partitioning, OLAP and Oracle Data Mining options
    JServer Release 9.2.0.6.0 - Production
    SQL>
    SQL>
    SQL>
    SQL> set serveroutput on
    SQL>
    SQL>
    SQL> select * from audit_info;
    USR
    LOG_TIME
    ODSUSER1
    12-JUN-07 12.00.00.00000000 AMHope this will solve your purpose.
    Regards.
    Satyaki De.

  • Deski report which is using a Store Procedure - Redirecting connection

    I have a DeskI report which is using a Store Procedure as its data provider.
    This is an Oracle based Store Procedure.
    Where can i see wich connection (connections listed in CMC) is used in DeskI report ?
    How can i redirect one connection to point to another on report?
    Thanks
    Georg

    Marina,
    The strategy for displaying LOV via Infoview needs to be different than what you've set up via DeskI.  The main difference is that when using a client/server program like DeskI, the LOV is cached to the client, thus producing a list more quickly, however, over the web, the web client does not cache LOV as readily.  To "solve" this "problem" you need to go back to your universe and trace what is happening.  If the LOV is getting generated through an essential "select distinct" on the fact/dimension table, and that table has over a million rows, then it will take some time to generate the list (and thus will timeout).  A different strategy to take is to maintain a "backend lookup" table that the LOV will point to instead.  The backend lookup table will contain the unique instances of the column getting scanned and thus when the LOV points to the new lookup table the response will be quicker versus the old method.  Care must be taken each time new data is loaded to WH to ensure that any new unique values from the "home" table/column are also placed in the backend lookup table.
    thanks,
    John

  • Creating new services using ORADIM utility

    Hi,
    i have Oracle 11g R1 on windows XP service pack 3 platform.
    i am having some issue while creating new services using ORADIM utility.
    The Errors are:
    18:13:28 SYS@vik 24-MAY-11> host oradim -delete -sid vik
    Instance deleted.
    18:13:52 SYS@vik 24-MAY-11> host oradim -new -sid vik -intpwd oracle -startmode A -maxusers 100 -pfile D:\app\vikash.chauradia\product\11.1.0\db_1\database\initvik.ora -timeout 60
    OPW-00005: File with same name exists - please delete or rename
    Instance created.
    Error while deleting value, OS Error = 2
    Can anyone please help me to fiinf the solution?
    Thanks and regards,
    Vikash Chauradia(DBA Trainee)

    Vikash Chauradia(Junior DBA) wrote:
    Hi,
    i have Oracle 11g R1 on windows XP service pack 3 platform.
    i am having some issue while creating new services using ORADIM utility.
    The Errors are:
    18:13:28 SYS@vik 24-MAY-11> host oradim -delete -sid vik
    Instance deleted.
    18:13:52 SYS@vik 24-MAY-11> host oradim -new -sid vik -intpwd oracle -startmode A -maxusers 100 -pfile D:\app\vikash.chauradia\product\11.1.0\db_1\database\initvik.ora -timeout 60
    OPW-00005: File with same name exists - please delete or rename
    Instance created.
    Error while deleting value, OS Error = 2
    check for the files in ORACLE_HOME/database. You have dropped existing instance and creating service again, move all the files to other folder then create using ORADIM

  • Example of Asynchronous Web Service Using Oracle APIs

    Greetings,
    Is there any tutorial, section or example of Oracle, that explains clearly, how to create an Asynchronous Web Service using Oracle APIs.
    Thakns in advance for your help.-

    Does this help:
    http://niallcblogs.blogspot.com/2009/03/calling-async-bpel-process-from-jdev.html

  • What is the use of creating proxy services using WSDL.

    Hi
    Am a beginner in ALSB and i have a basic question. Business services are created using WSDL,thats sounds logical as we need to invoke the actual backend services .
    Proxy services are connected to business services and what is the need that it can be e created using WSDL.
    What is the use of creating proxy services using WSDL.

    Hi,
    I beleive you are confused because of the apparent inclusion of transport information in WSDL (that is the host:port/endpoint where the service is hosted). However, if you refer to the w3c specification of WSDL1.0 ([url http://www.w3.org/TR/wsdl]www.w3.org/TR/wsdl), you will find that WSDL has three separate sections:
    1. The schema information that describes data element(s): specified in types
    2. The message information ie message and port sections that specify the parameters and the operations
    3. The service section that specify the actual protocol and endpoint binding.
    Ideally, a WSDL can be broken down into these three separate components. Any WSDL containing the first two is called an abstract WSDL and is used for a top-down approcah for web services, and if the third part is used, then you get a concrete WSDL, containing invocation end-point also.
    Comming back to your question one can typically use an Abstract WSDL for creating proxy service. This way, the service requester and integration can go on two separate threads where the common denominator or agreement between these two parties in terms of operation name and data element are imposed using the WSDL.
    Thanks and Regards
    Vivek Nandey
    BEA Certified Developer for Integration Solutions

  • Integrating Oracle eBusiness Suite with banking services using Oracle SOA

    Hi ,
    I am working on a project for integrating Oracle eBusiness Suite with banking services using Oracle SOA. We have implemented Oracle SOA and trying to call bank's services using SOA.
    The bank has provided its web services over http which accepts XML data as string through HTTPS post invocation and provides response accordingly in string XML Data.
    For each service, specific format of request and response message has been provided.
    I am trying to call their web services using HTTP binding adapter.
    I would like to know whether my approach of calling bank's web service using HTTP binding adapter is correct or not.
    Looking ahead for your valuable insight and advice.
    Thanks

    Hi,
    Thank you for your reply.
    Is the usage of B2B not applicable for this project ?
    Thanks

  • Calling Oracle store procedure from Crystal 11 command

    I need to call Oracle store procedure from Crystal Command. The Store proc has ref cursor. Is it possible. Can you post few examples?
    Also, is it possible to have multiple sql statements in a Crystal Command, when working with Oracle 10g?
    It is working for SQL server.

    Please re-post if this is still an issue to the Data Connectivity - Crystal Reports Forum or purchase a case and have a dedicated support engineer work with you directly.

  • Getting error while trying to create a document using oracle web ADI resp.

    Hi All,
    When I am trying to create a document using Oracle Web ADI Responsibility and using "Ben Ri Process Bnf" integrator, it is showing me error
    "The following error has occurred
    Exception Name: oracle.apps.bne.exception.BneParameterException - No parameter list definition at parameter list id 800:PER_RI_JPG_PARAM_LIS
    Log File Bookmark: 868035"
    Can anybody tell me the cause of this error?
    Thanks.

    Please see the solution in (The Descriptive Flexfield With Application Name Receivables (AR) and Name Party Site Information (HZ_PARTY_SITES) Is Not Frozen [ID 743262.1]).
    Thanks,
    Hussein

  • How to pass values to Oracle store procedure in Crystal Report

    Hi all,
    I am newbie on passing values to stored procedure parameters. I created a Crystal Report using the Crystal Report wiward with PULL method and data come from Oracle stored procedure. In an ASP.NET page, I have stored two values in Session and need to pass them as input parameters to Oracle stored procedure to print the report. In Crystal reports 2010 once you connect to a stored-procedure as data source, it automatically creates the parameter fields with Crytal Report Viewer. Please show me how I pass values to store procedure at runtime automatically.
            'Set the parametter value
            myReport.SetParameterValue("@P_COURSE", "CoursetNo")
            myReport.SetParameterValue("@P_CLASS", "ClassNo")
        End Sub
    I tried to apply above codes from Brian Bischof book but display the error from the following lines:
            myReport.SetParameterValue("@P_COURSE", "CoursetNo")
            myReport.SetParameterValue("@P_CLASS", "ClassNo")
    I also enclosed my code. Any experts, please let me know anything wrongs on my code . I tried several methods that searching via google, but did not solve my issues. Thanks.
    Edited by: avt2K7 on Mar 15, 2011 7:02 AM

    Hi,
    Thank you for your response. Here are the detailed code and error as following:
    Please show what I am missing in my below VB.NET codes:
    ===========================================================================================
        Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
            LogonToTables("username", "password", "servername", "")
        End Sub
        Private Sub LogonToTables(ByVal myUserId As String, ByVal myPassword As String, ByVal myServerName As String, ByVal myDataBaseName As String)
            Dim Course, Class As String
            Course = Session.Item("CourseNumber"))
            Class = Session.Item("ClassNumber"))
            Dim myReport As New CrystalDecisions.CrystalReports.Engine.ReportDocument
            myReport.Load(Server.MapPath("CrystalReport1.rpt"))
            Dim myTableLogonInfo As CrystalDecisions.Shared.TableLogOnInfo
            'Set the database properties and security credentials
            Dim myConnectionInfo As New CrystalDecisions.Shared.ConnectionInfo
            myConnectionInfo.ServerName = "servername"
            myConnectionInfo.DatabaseName = ""
            myConnectionInfo.UserID = "username"
            myConnectionInfo.Password = "password"
            'Apply the ConnectionInfo to the report tables
            Dim myTables = myReport.Database.Tables
            For Each myTable As CrystalDecisions.CrystalReports.Engine.Table In myTables
                myTableLogonInfo = myTable.LogOnInfo
                myTableLogonInfo.ConnectionInfo = myConnectionInfo
                myTable.ApplyLogOnInfo(myTableLogonInfo)
            Next
            'Set the parametter value to Crystal Report parameter named P_COURSE and P_CLASS
            myReport.SetParameterValue("@P_COURSE", "Course")
            myReport.SetParameterValue("@P_CLASS", "Class")
        End Sub
    =================================================================================
    I put a break point to debug but display the error at the following lines:
            myReport.SetParameterValue("@P_COURSE", "Course")
            myReport.SetParameterValue("@P_CLASS", "Class")
    Eventhough, if I set a specific value to Course=1000 and Class = math and still receive the error:
    Invalid index. (Exception from HRESULT: 0x8002000B (DISP_E_BADINDEX))
    I tried several sources from Google search but it is not working. I really appreciate any detailed code either in C# or VB.NET to solve my issues. Thanks in advance.

  • Queries regarding creating Web Services in Oracle EBS 11i[Workaround found]

    Hi,
    We have an E-Business Suite 11i installation(11.5.10.2). In our implementation we are using some of the public APIs to insert & update data in EBS tables. Earlier this was done by calling the required PL/SQL procedures through dblinks.
    Now, we need to do the same by using Web Services. That is we need a Web Service which can be invoked from a different application(SAP) and the Web Service in turn will call the APIs.
    I am new to Web Services/SOA and as far as I could understand from reading the documentation, we need the following:
    1. Install Oracle 10g Application Server with BPEL Process Manager ONLY(Oracle AS Adapter will be installed as part of BPEL PM. The Oracle AS Adapter will connect 10gAS to EBS)
    2. JDeveloper to create and deploy the BPEL process.
    I have a few questions here:
    1. Are the above two points the only prerequisites for what I want to achieve? Do I need to install anything else?
    2. How do I expose the created Web Service? I mean how will the 3rd party application invoke this Web Service?
    Answers and/or links to helpful documents awaited.
    Regards,
    -Sujoy
    Found an alternate and more cost-effective solution. Turns out that the SAP PI/XI engine can use JDBC to connect to the Oracle DB. SAP PI/XI will host the Web Service and will internally access the API through a JDBC connection.
    Edited by: Sujoy on Feb 3, 2011 7:41 PM
    Edited by: Sujoy on May 16, 2012 6:49 PM

    Hi Helios,
    I had checked the note that you are referring to before posting here. It did provide me with a start but otherwise it wasn't a great help (also some of the links are broken) . Since I am quite new to this...I am not sure whether I am proceeding in the right direction. An example/tutorial is what would be pretty useful.
    Thanks anyway!
    -Regards,
    Sujoy

Maybe you are looking for

  • How to find out the AI mode using traditiona​l NI driver and VC++ 6.0?

    Hello, the software I manage is written in VC++ 6.0 and utilizes the traditional NI driver. The board used is PCI6013/6014. The AI mode though may be either differential or nonreferenced single ended. By now we configure the board using Measurement a

  • Serial Number problem with DW CS3

    Hi all. I keep getting the pop up Your product trial period has expired. I enter my serial number from CS3 web standard and get a green check mark. I click next and quickly get the pop up there was an error while processing your serial number. I beli

  • Install DeskJet 720C in compatibility mode in Windows 8.1

    Hi I have a Deskjet 720C than work fine on my Window 7 64 bit system. Now I want to use it on a Windows 8.1 64 bit system. The driver installed with Windows Update does not work. Can I install it in compatibility mode? How do I do that? There is no d

  • Connected wi-fi freezes IMAC

    Hi, I recently had my 10.4.11 installed with more ram and a new hard drive.  The OS is now 10.5.8.  Prior to this work, the system froze up periodically, but the web sites still loaded and fairly quickly.  Now with the rebuild, it constantly freezes

  • Scenario: MATMAS request inside BPM

    HI, we are using the following scenario: BOMMAT IDOC -> XI BPM -> lot of MATMAS IDOCs. I have to check a materialnumber in the SAP R/3 Applikation System(Sender) for a special Item inside the BPM. Exampel: The BOMMAT IDoc is filled with materialnumbe