How to execute a HANA stored proc from Data Services

Hi
How do i execute a HANA stored procedure from Data Services.
in the HANA SQL editor , we run the stored procedure "name_of_sp" as
call name_of_sp ();
call name_of_sp ( 1 , 2 ) // suppose 1 and 2 are two integer input parameters.
so how do I call the above from Data Services .
SQL('name_of_datastore', 'call name_of_sp()') does not seem to work , ,
Rishi

I got the answer , we dont need to import sp .
i was just having a syntax error:
the statement below works
SQL('name_of_datastore', 'call name_of_sp()');

Similar Messages

  • How to call a remote stored proc from a local stored proc using DB Link

    Hi All,
    I am trying to call a stored procedure residing in another data base from the local procedure of my local data base using DB link,I am using the following syntax to call the procedure
    CREATE OR REPLACE PROCEDURE MYLOCALPROCEDURE(Input1 IN varchar2 ,Input2 IN varchar2) IS
    BEGIN
    RemoteStoredprocedurename(Input1,Input2)@DBLINK;
    END;
    END MYLOCALPROCEDURE;
    Its giving a compilation error as @ not expected
    If i try to execute this way
    CREATE OR REPLACE PROCEDURE MYLOCALPROCEDURE(Input1 IN varchar2 ,Input2 IN varchar2) IS
    BEGIN
    RemoteStoredprocedurename(Input1,Input2);
    END;
    END MYLOCALPROCEDURE;
    Its giving an error as stored procedure must be declared.
    A public synonym is created at the Remote database to which DB link is created.
    Can you please let me know on the exact syntax to call the procedure residing in other database through DB Link.
    Thanks in advance,
    Kumar

    Try:
    CREATE OR REPLACE PROCEDURE MYLOCALPROCEDURE(Input1 IN varchar2 ,Input2 IN varchar2) IS
    BEGIN
    RemoteStoredprocedurename@DBLINK(Input1,Input2);
    END;
    END MYLOCALPROCEDURE; Amiel

  • How to call pl/sql stored procs from AMImpl

    Hi I have worked with the regular procs which has input/output params as primitive types like Number, Varchar2 etc.
    But how to pass values to pl/sql procs which has custom data types like VARCHAR2_TABLE_100, please find the definition below.
    create or replace
    TYPE        "VARCHAR2_TABLE_100" is table of varchar2 ( 100 )
    How to pass values to the input param if type is of above type, any hint or thought is appreciated.
    Thanks.

    I tried using registeroutparameter(10,Types.ARRAY,"VARCHAR2_TABLE_100");
    But I am getting the wrong number of inputs or types exception. I thought it is because of not registering the output variable properly.
    Try with full qualified name ("YOURSCHEMA.VARCHAR2_TABLE_100")
    Also note that indexes in jdbc start from 1(not from 0) and that if you have plsql function first parameter is function return value.
    For example, if you have plsql function: "function some_func(p_param out varchar2_table_100) return somettype;"
    then to register p_param you need something like: stmt.registerOutParameter(2, OracleTypes.ARRAY, "SCHEMA.VARCHAR2_TABLE_100")
    Dario

  • Can we call a Java Stored Proc from a PL/SQL stored Proc?

    Hello!
    Do you know how to call a Java Stored Proc from a PL/SQL stored Proc? is it possible? Could you give me an exemple?
    If yes, in that java stored proc, can we do a call to an EJB running in a remote iAS ?
    Thank you!

    For the java stored proc called from pl/sql, the example above that uses dynamic sql should word :
    CREATE OR REPLACE PACKAGE MyPackage AS
    TYPE Ref_Cursor_t IS REF CURSOR;
    FUNCTION get_good_ids RETURN VARCHAR2 ;
    FUNCTION get_plsql_table_A RETURN Ref_Cursor_t;
    END MyPackage;
    CREATE OR REPLACE PACKAGE BODY MyPackage AS
    FUNCTION get_good_ids RETURN VARCHAR2
    AS LANGUAGE JAVA
    NAME 'MyServer.getGoodIds() return java.lang.String';
    FUNCTION get_plsql_table_A RETURN Ref_Cursor_t
    IS table_cursor Ref_Cursor_t;
    good_ids VARCHAR2(100);
    BEGIN
    good_ids := get_good_ids();
    OPEN table_cursor FOR 'SELECT id, name FROM TableA WHERE id IN ( ' | | good_ids | | ')';
    RETURN table_cursor;
    END;
    END MyPackage;
    public class MyServer{
    public static String getGoodIds() throws SQLException {
    return "1, 3, 6 ";
    null

  • Calling a COBOL stored proc from Java Servlet

    I am trying to call a COBOL stored proc from a Java Servlet. The stored proc is stored on a DB2 database. I need to send 6 inputs to the COBOL stored proc and the output will be the return code of the stored proc. I'm not sure if I'm going about this the right way. This is how my code looks...
    public int callStoredProc(CallableStatement cstmt,
    Connection con,
    String sYear,
    String sReportNbr,
    String sSystemCode,
    String sUserId,
    String sModuleNbr,
    String sFormId){
    int iParm1 = 0;
    try{
    Class.forName ("sun.jdbc.odbc.JdbcOdbcDriver");
    catch(ClassNotFoundException ex){
    System.out.println("Failed to locate database driver: "
    + ex.toString());
    return iParm1;
    try{
    cstmt = con.prepareCall("{? = CALL MKTPZ90C
    cstmt.registerOutParameter(1, Types.INTEGER);
    cstmt.setString(2, sYear);
    cstmt.setString(3, sReportNbr);
    cstmt.setString(4, sSystemCode);
    cstmt.setString(5, sUserId);
    cstmt.setString(6, sModuleNbr);
    cstmt.setString(7, sFormId);
    cstmt.execute();
    iParm1 = cstmt.getInt(1);
    CloseSQLStatement(cstmt);
    catch(SQLException ex) {
    CloseSQLStatement(cstmt);
    System.out.println("SQL exception occurred:" +
    ex.toString());
    return iParm1;
    return iParm1;
    Could someone tell me if this is the right way to go about doing this?
    Thanks!!!!!!

    I didn't see the code where you create the database connection (variable "con"). However, the answer to your question "Is this the right way...", for me, is "Anything that works is the right way." So try it. That's a first approximation, but once you have something that works you can start on improving it, if that becomes necessary.

  • How to publish a Java Stored proc....

    Hi,
    I wrote the following Java code and loaded it into Oracle 8i, as Java stored procs.
    public class EmployeeStruct
    public int EmployeeNum;
    public String EmployeeName;
    public String Designation;
    and
    import java.sql.*;
    import java.io.*;
    import oracle.jdbc.driver.*;
    public class InsertData
    public static InsertEmployee(EmployeeStruct eps) throws SQLException
    Connection conn =
    DriverManager.getConnection("jdbc:default:connection:");
    String sql = "INSERT INTO EMPLOYEE_TABLE VALUES (?, ?, ?)";
    try
    PreparedStatement pstmt = conn.prepareStatement(sql);
    pstmt.setInt(1, eps.EmployeeNum);
    pstmt.setString(2, eps.EmployeeName);
    pstmt.setString(3, eps.Designation);
    pstmt.executeUpdate();
    pstmt.close();
    catch (SQLException e)
    System.out.println(e.getMessage());
    My question is how do I publish the InsertData proc. I tried :
    CREATE OR REPLACE PROCEDURE insert_data (e EMPLOYEESTRUCT) AS LANGUAGE JAVA
    NAME 'INSERTDATA(EmployeeStruct)';
    but this gives me PLS-00201, identifier EmployeeStruct must be declared.
    COULD SOMEONE HELP ME/ SHOW ME HOW ?
    I wish to call the java stored proc from an external java program.
    rgds
    Jeevan S
    null

    You can't pass Java classes to Java Stored Procedures via the PL/SQL wrapper. You'll have to write your wrapper to take the int as a NUMBER and the two Strings separately as VARCHAR2s, e.g.:
    CREATE OR REPLACE PROCEDURE insert_data
    EmployeeNum IN NUMBER,
    EmployeeName IN VARCHAR2,
    Designation IN VARCHAR2
    AS LANGUAGE JAVA
    NAME 'InsertData.InsertEmployee(int, java.lang.String, java.lang.String)';
    John H.
    null

  • Can i call stored proc from VOImpl, not from AM?

    Hi,
    i know how to invoke proc from bb defined in AM...
    in VOImpl i have a method getSelectedRows()
    which gets me rows selected in table by user.
    how can i invoke stored proc from there?
    Edited by: grodno on Jan 31, 2013 3:35 AM

    Hi,
    its exactly the same code. The only missing link you have is the access to the transaction. In a Viewimpl file just call this.getApplicationModule() to get access to an application module.
    The method can also be exposed on a client interface (same as for AM)
    Frank

  • SOS..How to execute an Oracle Stored procedure

    Please help me.
    I need to execute an oracle stored procedure from a JSP.
    I'M using Jakarta Tomcat and I dont have the Oracle Jbo tags and no BC4j tags.
    Anyone have an example using standar tags or directives???.
    This an emergency call..!!!!!!

    To execute a stored procedure (Oracle or other), you must create a CallableStatement.
    Here is the link to the API description:
    http://java.sun.com/products/jdk/1.2/docs/api/java/sql/CallableStatement.html
    You use it like a query but the the syntax is:
    {call <procedure-name>[<arg1>,<arg2>, ...]}

  • How to execute the parametered stored procedure in sql *plus ?

    how to execute the parametered stored procedure in sql *plus ?
    my storedprocedure format
    CREATE OR REPLACE PROCEDURE SMS_SELECTMPLOYEE
    (empDOB out date, empEmpName out varchar2)
    thanks & regards
    mk_mur

    Oh, sorry... making many reading-too-fast mistakes today...
    You can't declare date variables in SQL*Plus (seel help var), but you can cast to varchar2:
    TEST> CREATE OR REPLACE PROCEDURE SMS_SELECTMPLOYEE (empDOB out date, empEmpName out varchar2) IS
      2  d date := sysdate;
      3  e varchar2(10) := 'bob';
      4  begin
      5  empdob := d;
      6  empempname := e;
      7  end;
      8  /
    Procedure created.
    TEST> var d varchar2(30)
    TEST> var n varchar2(30)
    TEST> call  SMS_SELECTMPLOYEE(:d,:n);
    Call completed.
    TEST> print d n
    D
    11/07/06
    N
    bobYoann.

  • Call stored proc from inside sp

    I am trying to call a stored proc from inside a stored proc and the stored proc needs to return a ref_cursor. I am trying to loop over the returned ref_cursor, but my problem is that when I compile the sp it says the ref_cursor is not a procedure or is undefined. Can anyone please tell me why I am getting this error? Refer to the code below!
    create or replace
    PROCEDURE TCS_GetPartReferenceData
    contracts IN VARCHAR2
    , showInWork IN INTEGER
    , userClock IN VARCHAR2
    , intMaxResults IN INTEGER
    , ret_cursor OUT SYS_REFCURSOR
    ) AS
    p_cursor SYS_REFCURSOR;
    BEGIN
    TCS_GETDRNSFORCONTRACTS(contracts
    , showinwork
    , userClock
    , intmaxresults
    , p_cursor);
    for r in p_cursor loop
    dbms_output.put_line(r.puid);
    end loop;
    END TCS_GetPartReferenceData;

    Probably you want sth. like
    CREATE OR REPLACE PROCEDURE tcs_getpartreferencedata (contracts       IN     VARCHAR2,
                                        showinwork      IN     INTEGER,
                                        userclock       IN     VARCHAR2,
                                        intmaxresults   IN     INTEGER,
                                        ret_cursor         OUT sys_refcursor)
    AS
    BEGIN
       tcs_getdrnsforcontracts (contracts,
                                showinwork,
                                userclock,
                                intmaxresults,
                                ret_cursor);
    END tcs_getpartreferencedata;
    var cur refcursor
    exec tcs_getpartreferencedata(contracts_value,showinwork_value,userclock_value,intmaxresults_value, :cur)
    print curfill in appropriate values for the parameters _value ....                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • How to execute a Command Prompt command from J2SE code executing on Windows

    How to execute a Command Prompt command from J2SE code executing on Windows??
    Please help me

    [http://java.sun.com/docs/books/tutorial/getStarted/]
    ~

  • Migrate tables and stored proc from SQLServer 2005 Express to Oracle10G

    How to migrate tables and stored procedures from SQLServer 2005 Express to Oracle10G using SQLDeveloper? thank you very much

    Using Oracle SQL Developer Migration Workbench
    http://www.oracle.com/technology/tech/migration/workbench/index_sqldev_omwb.html

  • SQL Exception: Invalid column index while calling stored proc from CO.java

    Hello all,
    I am getting a "SQL Exception: Invalid column index" error while calling stored proc from CO.java
    # I am trying to call this proc from controller instead of AM
    # PL/SQL Proc has 4 IN params and 1 Out param.
    Code I am using is pasted below
    ==============================================
              OAApplicationModule am = (OAApplicationModule)oapagecontext.getApplicationModule(oawebbean);
    OADBTransaction txn = (OADBTransaction)am.getOADBTransaction();
    OracleCallableStatement cs = null;
    cs = (OracleCallableStatement)txn.createCallableStatement("begin MY_PACKAGE.SEND_EMAIL_ON_PASSWORD_CHANGE(:1, :2, :3, :4, :5); end;", 1);
         try
    cs.registerOutParameter(5, Types.VARCHAR, 0, 2000);
                        cs.setString(1, "[email protected]");
                             cs.setString(2, s10);
    //Debug
    System.out.println(s10);
                             cs.setString (3, "p_subject " );
                             cs.setString (4, "clob_html_message - WPTEST" );
                   outParamValue = cs.getString(1);
    cs.executeQuery();
    txn.commit();
    catch(SQLException ex)
    throw new OAException("SQL Exception: "+ex.getMessage());
    =========================================
    Can you help please.
    Thanks,
    Vinod

    You may refer below URL
    http://oracleanil.blogspot.com/2009/04/itemqueryvoxml.html
    Thanks
    AJ

  • How do I get my stored photos from the cloud?

    How do I get my stored photos from the cloud?

    If you mean Photoroll.
    Then you should use the standard process of connecting your device to a computer.  It will be recognized as a camera and ask you to offload them.
    If they are photos loaded from iTunes onto your phone (ie Albums), they cannot be removed this way.  You will need a 3rd party app such as Phototransfer.
    Cheers

  • Calling a storeed proc from jap

    How do we call a stored procedure from a jsp?

    And to do the call (either from the JSP, which I also don't recommend, or from somewhere else) use CallableStatement. Read the API documentation for more information on how to use it.
    Alin.

Maybe you are looking for

  • How can I movie old imovie 9.0 files to the iMovie Library in iMovie 10

    I have figured out how to convert the imovie 9 files into imovie 10, Go into the file menu and go down to udpate projects and events, and that should import you other movies, but it creates a new Libary.  I was trying to rename the Libary, but accide

  • IPhone doesn't appear in iTunes sidebar

    I have tried all of the recommended steps to get my iPhone to show in the iTunes sidebar but I keep getting the message: "This iPhone cannot be used because the Apple Mobile Device service is not started." The irony is that I was able to download son

  • HP 7210 All-in-One clock

    Is there some way to sync the 7210's clock with the usb connected PC?  The clock gains a minute every couple of weeks and it's a pain to have to reset it frequently.  Thanks for any ideas!

  • Simple animation software for Arch?

    Can anyone suggest a simple animation program for Linux; something similar to AnimationShop for windows.  I know there's gimp-GAP, but that seems to be fairly advanced for my purposes.  I just want to be able to string together images into .gif or vi

  • Consuming HTTPS Web Service

    In our application, we are trying to consume a web service that only supports HTTPS (https://gatewaybeta.fedex.com/web-services) and are having trouble getting Apex to function properly. In fact, when we try to finish defining the web service, Apex (