How to call MSSQL stored procedure from oracle database

MSSQL and Oracle databases are linked thru ODBC link using Oracle HSODBC.
I can query MSSQL table or view from Oracle Database using standard notation for acessing remote objects schema.object@dblink_name...
Can anybody give me syntax for calling MSSQL stored procedure thru ODBC database link?
I tried syntax exec schema.stored_procedure@dblink_name but it doesn't work...i'm getting schema.stored_procedure must be declared error...
Tnx,in advance!
Dejan Botica

Oracle database 10gR2.
MSSQL2000 database.
For example query:
select * from dbo.Tbl_Test@kron@dw_jamnica; works fine...
...while for example exec dbo.Test@kron@dw_jamnica;
reports error:
ORA-06550: line 1, column 7:
PLS-00201: identifier 'DBO.TEST@KRON@DW_JAMNICA' must be declared
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
Table Tbl_Test and procedure Test exists in MSSQL instance.
Regards,
Dejan

Similar Messages

  • How to call a stored procedure from WorkShop

    Hello Everyone .. I'm quite new with WebLogic 8.1 & WorkShop, so please bare with
    me .. Today I'm simply trying to find out how to call a stored procedure from
    within workshop, using any of the DB Controls .. I see workshop provides a way
    create a Java Control, Rowset Control, but it wont easily allow for a stored procedured
    to be entered in place of the inline query .. Perhaps I've over looked it. Any
    advise on the best way to tackle this task will be appreciated.
    Atahualpa

    Atahualpa--
    Maybe this will help:
    http://edocs.bea.com/workshop/docs81/doc/en/workshop/guide/controls/database/conStoredProcedures.html
    Eddie
    Atahualpa wrote:
    Hello Everyone .. I'm quite new with WebLogic 8.1 & WorkShop, so please bare with
    me .. Today I'm simply trying to find out how to call a stored procedure from
    within workshop, using any of the DB Controls .. I see workshop provides a way
    create a Java Control, Rowset Control, but it wont easily allow for a stored procedured
    to be entered in place of the inline query .. Perhaps I've over looked it. Any
    advise on the best way to tackle this task will be appreciated.
    Atahualpa

  • How to create java stored procedure from oracle(Dastageer)

    how to create java stored procedure from oracle-please help me to create the procedure.

    Hi,
    This forum is exclusively for discussions related to Sun Java Studio Creator. Please post your question in the appropriate forum.
    Thanks,
    RK.

  • How to call a stored procedure from EJB3/toplink essentials..?

    Hi,
    I want to call a stored procedure residing in the oracle 10 g Database from my application's data access layer, which is designed using EJB3/toplink essentials.
    I think this feature is not available right now in the EJB3 spec...any workaround with code if possible will be very help full...
    Thanks & Regards,
    Sarvesh

    This should help you....
    how to execute a stored procedure from ejb3.0 bean using entity manager

  • How to call a stored procedure from servlet?

    Hi all
    We are developing a project in servlet which needs to call a stored procedure in oracle 8i database.How to make a call? Whether can i get any data from the database using STORED PROCEDURE
    THANKS IN ADVANCE
    kamalakannan

    Hello,
    You can do an HTTP call from a store procedure using thre UTL_HTTP package; so you should be able to call your servlet this way.
    See UTL_HTTP documentation
    Regards
    Tugdual Grall

  • Calling Stored Procedure from Oracle DataBase using Sender JDBC (JDBC-JMS)

    Hi All,
    We have requirement to move the data from Database to Queue (Interface Flow: JDBC -> JMS).
    Database is Oracle.
    *Based on Event, data will be triggered into two tables: XX & YY. This event occurs twice daily.
    Take one field: 'aa' in XX and compare it with the field: 'pp' in YY.
    If both are equal, then
         if the field: 'qq' in YY table equals to "Add" then take the data from the view table: 'Add_View'.
         else  if the field: 'qq' in YY table equals to "Modify"  then take the data from the view table: 'Modify_View'.
    Finally, We need to archive the selected data from the respective view table.*
    From each table, data will come differently, means with different field names.
    I thought of call Stored Procedure from Sender JDBC Adapter for the above requirement.
    But I heard that, we cannot call stored procedure in Oracle through Sender JDBC as it returns Cursor instead of ResultSet.
    Is there any way other than Stored Procedure?
    How to handle Data Types as data is coming from two different tables?
    Can we create one data type for two tables?
    Is BPM required for this to collect data from two different tables?
    Can somebody guide me on how to handle this?
    Waiting eagerly for help which will be rewarded.
    Thanks and Regards,
    Jyothirmayi.

    Hi Gopal,
    Thank you for your reply.
    >Is there any way other than Stored Procedure?
    Can you try configuring sender adapter to poll the data in intervals. You can configure Automatic TIme planning (ATP) in the sender jdbc channel.
    I need to select the data from different tables based on some conditions. Let me simplify that.
    Suppose Table1 contains 'n' no of rows. For each row, I need to test two conditions where only one condition will be satisfied. If 1st condition is satisfied, then data needs to be taken from Table2 else data needs to be taken from Table3.
    How can we meet this by configuring sender adapter with ATP?
    ================================================================================================
    >How to handle Data Types as data is coming from two different tables?
    If you use join query in the select statement field of the channel then whatever you need select fields will be returned. This might be fields of two tables. your datatype fields are combination of two diff table.
    we need to take data only from one table at a time. It is not join of two tables.
    ================================================================================================
    Thanks,
    Jyothirmayi.

  • How to call a stored procedure from my JSP?

    Hi to all,
              I have a very simple jsp page and a simple sql server stored procedure!
              I need to call this stored procedure by passing two parameters.
              My result set will have 4 columns.
              I would really appreciate any input on how to issue this call to a SP.
              I am new to JSP.
              Regards,
              Sam
              

              Sam,
              BEA provides examples that are shipped with the product under
              <beahome>\weblogic700\samples\server\src\examples\
              Look at the jsp directory for JSP examples that access a database and look at
              say the jdbc\oracle\storedprocs.java for an example of java code calling out to
              a stored procedure - - by combining one of the jsp database examples with this
              stored procedure example you should be 'good to go'
              Chuck Nelson
              DRE
              BEA Technical Support
              

  • How to call multiple stored procedure from same DB Adapter

    Hi,
    I want to invoke 3 stored procedures from my message flow in BUS . I created a DB adapter and invoked 1 successfully . Now I don't to configure 2 other DB adapters for calling other 2 stored procedures . I want some how to be able to call the other 2 from the first DB adapter only . Somehow I need the flexibility to have procedure names as the operation names in 1 wsdl and be able to configure this in JDeveloper for this at time of DB adapter configuration . I am using 11G . Is it possible ?

    You can probably create a DB adapter with operation type selected as Execute Pure SQL and write SQL code to invoke the stored procedures depending on the procedure name (which you can get as one of the parameters of DB Adapter).
    However, Even if you were able to do it, the DB Adapter schemas are generated based on stored procedure parameter list and types. If you use Execute Pure SQL type of DB Adapter the schema will be generated based on the parameters which you are using in your custom SQL code within DB Adapter. Which means that if you want to add a new stored procedure as target which has a different name and different parameters then you will need to regenerate the DB adapter and update your custom SQL code. This also means that you will need to do regression testing interfaces to all stored procedures whenever there is any change in this DBAdapter.
    Now, my question is why do you want to invoke multiple stored procedures from same DB adapter?
    This is not a good way to design integration solutions and makes your services resistance to change as it will take more time to change and test.
    If all that you want is to have a web service which can have different operations for different stored procedures then you should create three business services and create a wrapper proxy service which has one operation for each stored procedure, within the proxy transform and call the correct backend service (you can use operational branch). This way you have a modular code where each module (read interface to one stored procedure) can be independently modified and tested.

  • How to call a Stored procedure from xsodata service?

    Hi Everyone,
    I have created an stored procedure and I'm trying to consume this store procedure from xsodata service.
    But unable to activate the service because of an error.
    Invalid procedure or parameter list in procedure "package.WebContent.src.hana.procedures::PROCEDURE
    I have activated both store procedure as well as attribute view.
    Here is my stored procedure.
    PROCEDURE "SCHEMA"."package.WebContent.src.hana.procedures::PROCEDURE" (
    IN row "SCHEMA"."package.tables::object" )
      LANGUAGE SQLSCRIPT
      SQL SECURITY INVOKER AS
      --DEFAULT SCHEMA <default_schema_name>
      --READS SQL DATA AS
    BEGIN
      Write your procedure logic
    declare shortdesc string;
    SELECT SHORT_DESCRIPTION INTO shortdesc FROM :row;
    END;
    Service:
    service namespace "package.WebContent.src.hana.service"{
    "package/OBJECT.attributeview" as "OBJECTS"
    key ("OBJECT_ID")
        create using "package.WebContent.src.hana.procedures::PROCEDURE";
    Is there anything wrong in the way i'm calling the procedure??

    Hi Arjun,
    You can expose the procedure as an Odata Service if you wrap it in a Scripted Calculation View..
    Firstly You will have to create a Scripted Calculation View from the Modeller perspective.
    Below is an example I just tried.
    Add Columns & Input Parameters
    Consume this Calc View in your Odata service :
    service namespace "services.test"
    "pda.Models::CV_TEST" as "Customer"
    keys generate local "ID"
    parameters via entity;
    Check your service by Passing the Input Parameters
    http://<host>:<port>/<>/services/test.xsodata/CustomerParameters(2)/Results?$format=json
    Hope this was Helpful
    Regards,
    Avinash Raju

  • How to call a stored procedure from jsf

    Hello everybody,
    Currently i am working on jdeveloper 10g rel 2 version and i am using adf and jsf to build my application, In one of my jsp page i need to call a plsql stored procedure.
    Please provide me the soln
    Regards
    Ahamed

    Hi,
    Although exposing the method on the binding layer is the preferred way I always end up in trouble due to the lack of support for complex datatypes and decent return values.
    The way I did this in 10.1.3 is:
    In your application module:
      private static final String STAMSAMENVOEGEN = "begin IVA_OWNER.IVA_UI_ALGEMEEN_PCK.SAMENVOEGEN_STAMMEN_GUI (P_ARRAY => :1, P_MESSAGE => :2 ); end;"; 
      public String stamSamenvoegen( Integer[] idArr ) {
        CallableStatement stamSamenvoegenSP = null;
        String ret = null;
        try {
          stamSamenvoegenSP = getDBTransaction().createCallableStatement( STAMSAMENVOEGEN, 0 );  
          Connection conn = ((DBTransactionImpl)getDBTransaction()).getPersistManagerConnection();
          oracle.sql.ArrayDescriptor arrayDesc = oracle.sql.ArrayDescriptor.createDescriptor("IVA_OWNER.IVA_VARRAY_NUMBER", conn);
          oracle.sql.ARRAY arr = new oracle.sql.ARRAY(arrayDesc, conn, idArr);
          stamSamenvoegenSP.setArray(1, arr);
          stamSamenvoegenSP.registerOutParameter(2, Types.VARCHAR);
          stamSamenvoegenSP.executeUpdate();
          ret = stamSamenvoegenSP.getString(2);     
        } catch ( Exception e ) {
          log.warning( "Call tor " + STAMSAMENVOEGEN + " failed, " + e.getMessage() );
        } finally {
          if ( stamSamenvoegenSP != null ) {
            try {
              stamSamenvoegenSP.close();
            } catch ( Exception e ) {
              log.warning( e.getMessage() );
        log.info( "Stam samenvoegen executed for " + idArr.toString() );
        return ret;
      } Now the backing bean to access it:
      <your appmodulename> chm = null;
      public BackingBean() {
        FacesContext fc = FacesContext.getCurrentInstance();
        ValueBinding vb = fc.getApplication().createValueBinding("#{data}");
        BindingContext bc = (BindingContext)vb.getValue(fc);
        //Can find this name in your databindings.cpx file in the model project
        DCDataControl dc = bc.findDataControl("<your app module>DataControl");
        ApplicationModule am = (ApplicationModule)dc.getDataProvider();
        chm = (<your app modulename>)am;
      }Hope this helps
    -Anton

  • How to call a stored procedure from a trigger

    Hi,
    Can anyone please send me sample SQL code to invoke a stored procedure inside a trigger?
    Thanks and Regards,
    Prince

    The user should have execution privilege of that procedure.Correct. The execute privilege needs to granted to the user directly, rather than through a role.
    Cheers, APC

  • How to call a "web procedure" from ORACLE Framework

    I need to call a procedure which generates an HTML file from my java Controller
    The procedure I try to execute use some HTP methods
    like :
    HTP.p ('<tr ><td class="x2i"></td></tr> <tr><td width"100%"></td></tr>');
    The java code is :
    OADBTransaction tx = pageContext.getApplicationModule(webBean).getOADBTransaction();
    String call = "call FAO_HR_ABSENCE_HISTORY_REP_WEB.setup(?)";
    try{
    CallableStatement cs = tx.createCallableStatement(call,1);
    cs.setInt(1,pageContext.getEmployeeId());
    cs.execute(); //
    }catch(Throwable th)
    th.printStackTrace();
    throw new OAException(""+th.getMessage(), OAException.ERROR);
    When I try to run it I catch the error below :
    java.sql.SQLException: ORA-06502: PL/SQL: numeric or value error: NULL index table key value
    ORA-06512: at "SYS.HTP", line 1536
    ORA-06512: at "SYS.HTP", line 1714
    ORA-06512: at "APPS.ORACLEAPPS", line 1111
    ORA-06502: PL/SQL: numeric or value error
    ORA-06512: at "APPS.ICX_SEC", line 3111
    ORA-06502: PL/SQL: numeric or value error: NULL index table key value
    ORA-06512: at "SYS.HTP", line 1536
    ORA-06512: at "SYS.HTP", line 1714
    ORA-06512: at "APPS.ICX_SEC", line 3457
    ORA-06502: PL/SQL: numeric or value error
    ORA-06512: at "APPS.HR_UTIL_DISP_WEB", line 3518
    ORA-06512: at "APPS.FAO_HR_ABSENCE_HISTORY_REP_WEB", line 156
    ORA-06502: PL/SQL: numeric or value error: NULL index table key value
    ORA-06512: at line 1
         at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
    ........

    Matteo,
    A couple of things:
    Even if your procedure works fine, it will provide some html output which is not getting used in your code given above anywhere. What exactly do you want to achieve?
    I am not familiar with the HTP package. Probably this is not the way to use in case of OAF. If you explain your requirement, we can suggest you properly.
    --Shiv                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • How to Create a Stored Procedure in Oracle

    I try to create a very simple Stored Procedure from Oracle SQL Developer, got the following error. Can someone give me some help on this? I am new on this. Thanks.
    Error(4,1): PLS-00103: Encountered the symbol "BEGIN" when expecting one of the following: := ( ; not null range default character The symbol ";" was substituted for "BEGIN" to continue.
    create or replace PROCEDURE Test
    AS ACCESSTYP_ID ACCESSTYP.ACCESSTYPCD%TYPE
    BEGIN
         SELECT ACCESSTYPCD
         INTO ACCESSTYP_ID
         FROM ACCESSTYP
         WHERE ACCESSTYPCD = 'WWW';
    END;

    I found out I forgot to put ";" after the declare.
    How do I test it call this stored procedure from
    Oracle SQL Developer.
    create or replace PROCEDURE Test_VL
    AS ACCESSTYP_ID
    ACCESSTYP.ACCESSTYPCD%TYPE;
         SELECT ACCESSTYPCD
         INTO ACCESSTYP_ID
         FROM ACCESSTYP
         WHERE ACCESSTYPCD = 'WWW';
    END;in your SQL Developer window just enclosed your procedure with a Begin ... End.
      Begin
        Test_VL;
      End;

  • Calling MSSQL SERVER STORED PROCEDURE FROM ORACLE STORED PROCEDURE

    Hi Guys,
    I want to call a stored procedure from mssql server 2005 as part of a stored procedure in PL/SQL. How do I go about this? I've already set up the linked servers.

    http://en.allexperts.com/q/Oracle-1451/2008/6/Calling-SQL-Stored-procedure-1.htm
    Does this help?

  • How to call a sql server stored procedure from oracle

    Hi all,
    Please anybody tell me how to call a sql server stored procedure from oracle.
    I've made an hsodbc connection and i can do insert, update, fetch data in sql server from oracle. But calling SP gives error. when I tried an SP at oracle that has line like
    "dbo"."CreateReceipt"@hsa
    where CreateReceipt is the SP of sql server and hsa is the DSN, it gives the error that "dbo"."CreateReceipt" should be declared.
    my database version is 10g
    Please help me how can i call it... I need to pass some parameters too to the SP
    thanking you

    hi,
    thank you for the response.
    when i call the sp using DBMS_HS_PASSTHROUGH, without parameters it works successfully, but with parameters it gives the following error
    ORA-28500: connection from ORACLE to a non-Oracle system returned this message:
    [Generic Connectivity Using ODBC][Microsoft][ODBC SQL Server Driver]Invalid parameter number[Microsoft][ODBC SQL Server Driver]Invalid Descriptor Index (SQL State: S1093; SQL Code: 0)
    my code is,
    declare
    c INTEGER;
    nr INTEGER;
    begin
    c := DBMS_HS_PASSTHROUGH.OPEN_CURSOR@hsa;
    DBMS_HS_PASSTHROUGH.PARSE@hsa(c, 'Create_Receipt(?,?)');
    DBMS_HS_PASSTHROUGH.BIND_VARIABLE@hsa(c,1,'abc');
    DBMS_HS_PASSTHROUGH.BIND_VARIABLE@hsa(c,2,'xyz');
    nr:=DBMS_HS_PASSTHROUGH.EXECUTE_NON_QUERY@hsa(c);
    DBMS_HS_PASSTHROUGH.CLOSE_CURSOR@hsa(c);
    end;
    Create_Receipt is the sp which requires two parameters.
    please give me a solution
    thanking you
    sreejith

Maybe you are looking for