Excuting stored procedure remotly from SQL Server

Hi everybody,
H recive an error message when I try to execute a remote stored procedure on Oracle from SQL Server though a linked server of ME OLE provider for oracle.
I can view all of the Oracle tables and views within SQL Enterprise Manager. When I try to execute a the command (execute OracleServer...StoredProcedure) through MS query analyzer using the linked Oracle server, I receive the error.
Could you please help me overcome this problem
I found something similiar, but with no accepted answer:
Accessing Oracle Table via Linked Server
Thanks alot

Let's put it in another way:
How could I execute a stored procedure on Oracle from an OLE DB connection?
Is there syntax for PL/SQL to use from other languages like Transact-SQL?
Thanks once again

Similar Messages

  • Creation of DB Adaptert for calling stored procedure in MS SQL server

    Hi,
    I need to create a DB adapter to call a stored procedure in MS SQL Server.
    I have gone thru the thread MS SQL Server database connection
    It mentions that we need to use a command line utility for generating the wsdl and xsd for calling stored procedures in MS SQL server. Please provide information where to find this utility and how to use it.
    Any links to tutorials are welcome.
    Thanks !!.
    Silas.

    Command line is required for stored procedures, if you are using the basic options you don't need to worry.
    (1) Download MS SQL Server 2005 JDBC Driver from Microsoft Site. http://msdn.microsoft.com/en-us/data/aa937724.aspx
    (2) The download is self extracting exe file. Extract this into Program Files on your machine. It should create folder as "Microsoft SQL Server 2005 JDBC Driver"
    (3) In above mentioned folder search for sqljdbc.jar copy this file into JDeveloper\JDBC\lib folder.
    (4) Open JDeveloper/jdev/bin/jdev.conf file add following entry.
    AddJavaLibPath C:/Program files/Microsoft SQL Server 2000 Driver for JDBC/lib
    While executing this step make sure that your JDeveloper is closed.
    (5) On command prompt go to J Developer folder and execute following command
    jdev -verbose
    This will open JDeveloper.
    (6) Now go to JDeveloper > Connections > Database Connections > New Database Connection
    (7) Select Third Party JDBC
    (8) Specify MS Sql Server User Name, password and Role.
    (9) In connection page specify following
    - Driver Class: com.microsoft.sqlserver.jdbc.SQLServerDriver
    - For class path browse to C:/Program files/Microsoft SQL Server 2000 Driver for JDBC/lib folder, select sqljdbc.jar add it as library.
    - Specify URL as following.
    jdbc:sqlserver://SERVERNAME:1433;databaseName=MSSQLDBNAME;
    (10) Go to Test page and test it.
    cheers
    James

  • Writing a stored procedure to import SQL Server table data into a Oracle table

    Hello,
    As a new DBA I have been tasked with writing a stored procedure to import SQL Server table data into an Oracle table. I have been given many suggestions on how to do it from SQL Server but I I just need to write a stored procedure to run it from the Oracle side. Suggestions/guidance on where to start would be greatly appreciated! Thank you!
    I started to write it based on what I have but I know this is not correct :/
    # Here is the select statement for the data source in SQL Server...
    SELECT COMPANY
    ,CUSTOMER
    ,TRANS_TYPE
    ,INVOICE
    ,TRANS_DATE
    ,STATUS
    ,TRAN_AMT
    ,CREDIT_AMT
    ,APPLD_AMT
    ,ADJ_AMT
    ,TRANS_USER1
    ,PROCESS_LEVEL
    ,DESCRIPTION
    ,DUE_DATE
    ,OUR_DATE
    ,OUR_TIME
    ,PROCESS_FLAG
    ,ERROR_DESCRIPTION
      FROM data_source_table_name
    #It loads data into the table in Oracle....   
    Insert into oracle_destination_table_name (
    COMPANY,
    CUSTOMER,
    TRANS_TYPE,
    INVOICE,
    TRANS_DATE,
    STATUS,
    TRANS_AMT,
    CREDIT_AMT,
    APPLD_AMT,
    ADJ_AMT,
    TRANS_USER1,
    PROCESS_LEVEL,
    DESCRIPTION,
    DUE_DATE,
    OUR_DATE,
    OUR_TIME,
    PROCESS_FLAG,
    ERROR_DESCRIPTION)
    END;

    CREATE TABLE statements would have been better as MS-SQL and Oracle don't have the same data types.
    OUR_DATE, OUR_TIME will (most likely) be ONE column in Oracle.
    DATABASE LINK
    Personally, I'd just load the data over a database link:
    insert into oracle_destination_table_name ( <column list> )
    select ... <transform data here>
    from data_source_table@mssql_db_link
    As far as creating the database link from Oracle to MS-SQL ... that is for somebody else to answer.
    (most likely you'll need to use an ODBC driver)
    EXTERNAL TABLE
    If the data from MS-SQL is in a CSV file, just use and external table.
    same concept:
    insert into oracle_destination_table_name ( <column list> )
    select ... <transform data here>
    from data_source_external_table
    MK

  • How to invoke a stored procedure on MS Sql Server with Java?

    I started writing Enterprise Java Beans and created an ODBC dsn with MS Sql Server 2000 which I can access using jdbc:odbc:mySqlDSN. This all works fine using Java Sql Statements. What kind of Java/Java Sql statement can I use to invoke a stored procedure on the Sql Server? Is it possible to use ADO/ADO command objects with Java? Is it possible to import/implement Mdac2.6 ActiveX data objects libary in Java?
    Thanks

    Thanks all for your replies. I will search the api for callable statements. I am curious though, the reply that suggests using a prepared statement - can I put the name of a stored procedure in a prepared statment or is this just suggestions an action query like Insert Into, Update, Delete? Like with ADO you can say
    cmdObject.CommandType = adStoredProcedure
    cmdObject.CommandText = "NameOfStoredProc"
    cmdObject.ExecuteNonQuery()
    Once I am calling/importing/implementing the proper libraries/interfaces in Java, can a prepared statement reference a stored procedure as above?
    Thanks

  • Where are User Defined Functions and Stored Procedures kept in SQL Server?

    Hi,
    I have a growing list of Stored Procedures and User-Defined Functions in SQL Server, and would like to be able to list all my user SP and UDF easily.
    Is it possible to write a query to list all SP and UDF?
    I saw the following specimen code in an SQL book, but am not sure this is what I need because I could not make it work.
    SELECT *
        FROM INFORMATION_SCHEMA.ROUTINES
    WHERE SPECIFIC_SCHEMA = N'CustomerDetails'
        AND SPECIFIC_NAME = N'apf_CusBalances'
    I tried:
    SELECT *
        FROM INFORMATION_SCHEMA.ROUTINES
    but it does not work.
    Suppose all my SP are named following this pattern:
        dbo.usp_Storeproc1
    How would I modify the above code? or is there a better code?
    Thanks
    Leon Lai

    Hi ,
    try this to get list of all stored procedures:
    SELECT *
    FROM sys.procedures where name like 'dbo.usp%'
    Thanks,
    Neetu

  • Error in Oracle 10 Procedure - converted from SQL Server

    I have converted the folowing script from SQL Server proc to Oracle Proc; it compiles with a warning "30 Hint: Comparision with NULL in 'sp_MyEmployee'"
    When this proc is executed; it generates an error "ORA-00900: invalid SQL statement"
    Please help!
    CREATE OR REPLACE PROCEDURE osp_DMEmployee(v_ahRole IN VARCHAR2 DEFAULT null,
                        v_Exclusion IN varchar2 DEFAULT null) as
    v_MyString varchar2(32767);
    v_spot NUMBER(5,0);
    v_str varchar2(8000);
    v_email varchar2(5000);
    SWV_Exclusion varchar2(5000);
    BEGIN
    SWV_Exclusion := v_Exclusion;
    v_MyString := 'SQLWAYS_EVAL# exprsnlid, dmdescription, dmregion, dmfieldloc, dmbusentity,
                                  dmemployeenum, dmusername, dmtitle, dmemail, ahrole
                             FROM dm_Employee WHERE dmEmail is NOT NULL';
    if v_ahRole is not NULL then
    IF v_ahRole = 'PLANNER' then
    v_MyString := v_MyString || 'SQLWAYS_EVAL# AND (DMTitle like ''%Coord%'' OR DMTitle like ''%Planner%'' OR DMTitle like ''%Svc Leader%'') ';
    end if;
    IF v_ahRole = 'TECHNICIAN' then
    v_MyString := v_MyString || 'SQLWAYS_EVAL# ''' || v_ahRole || 'SQLWAYS_EVAL# is NOT NULL ';
    end if;
    IF v_ahRole = 'SUPERVISOR' then
    v_MyString := v_MyString || 'SQLWAYS_EVAL# ''' || v_ahRole || 'SQLWAYS_EVAL# is NOT NULL ';
    end if;
    end if;     
    IF SWV_Exclusion is NOT NULL then
    /* WHILE SUBSTR(CAST(SWV_Exclusion AS VARCHAR2),1,4000) <> '' LOOP */
    WHILE SWV_Exclusion <> '' LOOP
    v_spot := instr(SWV_Exclusion,',');
    IF v_spot > 0 then
    v_str := SUBSTR(SWV_Exclusion,1,v_spot -1);
    SWV_Exclusion := SUBSTR(SWV_Exclusion,-(LENGTH(SWV_Exclusion) -v_spot));
    ELSE
    v_str := SWV_Exclusion;
    SWV_Exclusion := '';
    end if;
    IF v_email is NOT NULL then
    v_email := v_email || ',' || ' ''' || SUBSTR(v_str,1,100) || ''' ';
    ELSE
    v_email := ' ''' || SUBSTR(v_str,1,100) || ''' ';
    end if;
    END LOOP;
    end if;
    v_MyString := v_MyString || 'SQLWAYS_EVAL# IN (' || v_email || ')';
    v_MyString := v_MyString || 'SQLWAYS_EVAL# ail';
    DBMS_OUTPUT.PUT_LINE(SUBSTR(v_MyString,1,250));
    EXECUTE IMMEDIATE v_MyString;
    RETURN;
    END;

    1) When discussing an error, please copy the actual error message. Usually you will get a line number to assist investigation;
    2) Please refer to the FAQ (upper right corner of page) to show how to preserve code and make your question more readable;
    3) Please ask the question in a forum that deals with the topic - such as "Database - General" (look for "Forum Home" link at top left of page)
    4) Please note that the title of this forum is "Community Feedback and Suggestions (Do Not Post Product-Related Questions Here)"
    (And ... did you display the SQL that you were attempting to execute. Execute Immediate is a last resort style of programming - not nice for most Oracle apps.)

  • DB Adapter calling stored procedure in MS SQL Server.

    Hi
    i am calling a stored procedure in a MS SQL Server.
    I configured a Datasource for MS SQL Server driver as Oracle's MS SQL Server Driver(Type 4) Versions: 7.0 and later and provide all db details of sql server. I tested the data source and was getting success message. My BPEL code is just talking with input parameter and then calling the stored procedure in sql server. I was able to compile the code in jdeveloper and deploy to weblogic. But when i am testing the code. i am getting an error.
    <env:Fault>
    <faultcode>env:Server</faultcode>
    <faultstring>Exception occured when binding was invoked.
    Exception occured during invocation of JCA binding: "JCA Binding execute of Reference operation 'IDMService' failed due to: JCA Binding Component connection issue.
    JCA Binding Component is unable to create an outbound JCA (CCI) connection.
    Test:IDMService [ IDMService_ptt::IDMService(InputParameters,OutputParameters) ] : The JCA Binding Component was unable to establish an outbound JCA CCI connection due to the following issue: javax.resource.spi.IllegalStateException: [Connector:199176]Unable to execute allocateConnection(...) on ConnectionManager. A stale Connection Factory or Connection Handle may be used. The connection pool associated with it has already been destroyed. Try to re-lookup Connection Factory eis/sql/idm from JNDI and get a new Connection Handle.
    Please make sure that the JCA connection factory and any dependent connection factories have been configured with a sufficient limit for max connections. Please also make sure that the physical connection to the backend EIS is available and the backend itself is accepting connections.
    The invoked JCA adapter raised a resource exception.
    Please examine the above error message carefully to determine a resolution.</faultstring>
    <faultactor/>
    <detail>
    <exception>[Connector:199176]Unable to execute allocateConnection(...) on ConnectionManager. A stale Connection Factory or Connection Handle may be used. The connection pool associated with it has already been destroyed. Try to re-lookup Connection Factory eis/sql/idm from JNDI and get a new Connection Handle.</exception>
    </detail>
    </env:Fault>
    What is the problem with connection . How cna i rectify it.
    Thanks,
    Venu Raja

    followed the steps mentioned in meatalnk..
         JCA-12563 - Unable to Establish an Outbound JCA CCI Connection [ID 1235943.1]
    Metalink ID - 1235943.1

  • Creation of DB Adapter for calling stored procedure in MS SQL server 2008

    Hi,
    I am trying to create WSDL and XSD using oracle.tip.adapter.db.sp.artifacts.GenerateArtifacts command line tool to access a MS SQL Server 2008 store procedure and the utility throws the below error,
    C:\jdevstudio10134\integration\lib>java oracle.tip.adapter.db.sp.artifacts.GenerateArtifacts sp.properties
    Warning: Could not locate file pc.properties in classpath
    log4j:WARN No appenders could be found for logger (collaxa.cube.infrastructure).
    log4j:WARN Please initialize the log4j system properly.
    Database platform version is not supported.
    Attempt to use an unsupported database platform version: 10.
    Use a supported version of the database platform. Contact oracle support if error is not fixable.
    It seems this utilty is not supporting MS SQL server 2008 to create artifacts, can you please help me?
    Oracle SOA server: 10.1.3.4
    Driver used: com.microsoft.sqlserver.jdbc.SQLServerDriver
    Thanks,
    Levey

    Hi Levey,
    The Oracle® Application Server Adapters for Files, FTP, Databases, and Enterprise Messaging User’s Guide 10g Release 3 (http://docs.oracle.com/cd/E11036_01/integrate.1013/b28994.pdf), only names Microsoft SQL Server 2000 and 2005. It provides some tips for integrating with MS SQL Server.
    The Oracle® Fusion Middleware User's Guide for Technology Adapters 11g Release 1 (http://docs.oracle.com/cd/E23943_01/integration.1111/e10231.pdf) does name Microsoft SQL Server 2008.
    Perhaps raise a SR to be sure.
    Kind regards, Ronald

  • Stored procedure help - ms sql server

    [1] basically I need to select certain rows from the db and
    grab their IDs... ( done)
    [2] now I have to perform a series of insert statments based
    on those ids retrieved.
    I thought about storing the results of [1] into a table
    variable and then looping over that variable to perform my insert
    statments...
    how can this be done?

    Your insert doesn't specify which previously selected values
    match up with which columns in the insert table time_trk_history so
    it is hard to recommend more than a hypothecical. Having said that,
    why don't you move your SELECT statment into your INSERT statement:
    INSERT INTO
    time_trk_history
    (caseID, dateCreated, status_to_colorID, dateTimeStart,
    commentID)
    SELECT hist.id, @timeoutDays_Green, and whatever other
    columns and constants that you want
    FROM time_trk_history hist, time_trk_items items
    WHERE whatever.....
    Phil

  • Migrating from SQL Server to Oracle 8i

    Hi all :),
    I am trying to migrate from SQL Server to Oracle 9i.
    I am using the Migration Workbench.
    Everything goes fine during Capturing phase, but while
    creating Oracle model the Workbench just hangs at
    "Mapping Tablespaces" for over three hours.
    (not exactly hangs in the sense that it responds to mouse
    events and I can abort the ongoing activity ...)
    What should I do ? Should I let it go on and see what
    happens.
    I follow each and every step as mentioned in the
    documentation ... but obviously I am doing something
    wrong. Any pointers ???
    However ... if I try to migrate to Personal Oracle 8 ...
    the migration goes fine from start to end ... just that
    the SQL Server triggers aren't successfully migrated.

    You may want to start by downloading the Oracle Migration Workbench. That generally does a reasonable job in moving the tables, stored procedures, etc. from SQL Server to Oracle. If your VB code is database agnostic, it should continue to work without any more intervention. Realistically, however, you'll rpobably have to at least tweak a few things that don't work the same way in the old ODBC/ OLE DB provider and the new one.
    The hard part of migrations like this is that you may need to revisit some of your architectural decisions if you want Oracle to perform well. There are plenty of things that one does in SQL Server (i.e. frequent commits) to improve performance that have the opposite affect in Oracle. Identifying and fixing these sorts of things tends to be the largest part of a migration like this. Unfortunately, I don't know of a resource that talks addresses all the possible gotchas here.
    Justin
    Distributed Database Consulting, Inc.
    www.ddbcinc.com

  • JDBC - CallableStatement - Error in Accessing Stored Procedure of MS SQL

    Dear Friends,
    The following is the code to access a stored procedure of MS SQL Server 7.0 sp4,
              try
                   CallableStatement cstmt;
                   ResultSet rst;
                   cstmt = connection.prepareCall("{call backupdb[?,?]}");
                   cstmt.setString("db_name","SBIREMITLIVE");
                   cstmt.setString("path", "c:\testing.bak");
                   cstmt.executeQuery();
                   System.out.println("Stored Procedure called successfully");
              catch(SQLException se)
                   System.out.println(se.toString());
    when i execute this i am getting the error as " MS ODBC-MS SQL Server Syntax error or Access Violation "
    What's the problem exactly ? anybody came across this issue..if so...kindly help me....
    Here is my MS SQL Server stored procedure.....for reference
    create procedure backupdb(@db_name varchar(40), @path varchar(100)) as
    Backup database @db_name to disk = @path
    Regards,
    V.Prasanna

    Dear DigitalDreamer,
    Yes, as per your suggestion, it's working fine...thanks a lot...
    here is the code...
                   CallableStatement cstmt;
                   ResultSet rst;
                   cstmt = connection.prepareCall(" exec backupdb ?,? ");
                   cstmt.setString(1,"SBIREMITLIVE");
                   cstmt.setString(2, "c:\\testing.bak");
                   cstmt.execute();
    Regards,
    V.Prasanna

  • Migration from SQL Server 2008 to Oracle 11g

    Hi there,
    I have a quick question, Anyone who have experienced to migration procedures,function from SQL Server 2008 to 11g R2. Is it possible? I migrated tables and views through Oracle heterogenious servinces but I am not sure about the fucntions and procedures.
    Any help would be appreciated.
    Warm regards,

    Automated conversions are possible. After these conversions the system will pretty much run. However, and it can be a pretty big HOWEVER, performance could well take a hit - which the uninitiated or SQL Server acolytes will seek to blame on Oracle not being very good. This is not actually the case.
    You could be in for a major review and rewrite. Besides the syntax differences in the procedural languages, there is a huge - like really huge - difference in transaction control, isolation, and read consistency. Basically, keep in mind that Oracle reads do not block writes, writes do not block reads, and there are no dirty reads. Writes only block other writes. Thus, no coding 'tricks' are needed to get around these blockers. Oracle has global temporary tables that are generally used to help out those converting from SQL Server. In actuality, then are mostly not needed as you can almost always do your work in one SQL statement.
    Read the concepts guide from cover to cover, then do it again, then start looking at what you need to do to convert your procedural code.

  • How to call procedure in Java from SQL Server Database

    Hello Every Body
    i Have Question about
    How to call procedure in Java from SQL Server Database
    Thanks

    Hi,
    have you tried a Google search? I just gave it a 3 second try and already found: http://stackoverflow.com/questions/6113674/how-do-i-execute-a-ms-sql-server-stored-procedure-in-java-jsp-returning-table-d
    Frank

  • Reading BLOB from SQL Server 2005 using DB Link from Oracle 10g

    Hi All,
    I am trying to read a table's data from SQL Server 2005 using ODBC DB Link created in Oracle 10g (10.2.0.3/4) database. I am not using oracle gateway.
    I am able read all data except for the BLOB data from SQL server 2005. It gives error given below when I try to execute query SELECT * from T_TRANSACTION_DATA@sdeslink inside a stored procedure:
    ORA-22992: cannot use LOB locators selected from remote tables
    Kindly help how to read BLOB from SQL server 2005 inside Oracle 10g.
    Best Regards!
    Irfan

    Irfan,
    If you can read the blob data using 10.2 HSODBC then there should be no problem using the 11g gateway.
    I recommend you download the latest version which is 11.2.0.3 available from My oracle Support as -
    Patch 10404530: 11.2.0.3.0 PATCH SET FOR ORACLE DATABASE SERVER
    This is a full version and does not need a previous version to have bene installed. When installing it needs to be in a completlely separate ORACLE_HOME from the existing 11.2 install.
    For the Ora-22992 problem have a look at this note in My Oracle Support -
    Ora-22992 has a workaround in 10gR2 (Doc ID 436707.1)
    Regards,
    Mike

  • How to build a report in web Intelligence using Store procedure under Microsoft SQL Server 2000

    Post Author: ltkin
    CA Forum: WebIntelligence Reporting
    Hi,
    How to build a report in web Intelligence using Store procedure under Microsoft SQL Server 2000 ?
    Regards,

    Hi ltkin,
    Unfortunately, it is not possible in Xir2 to create Webi reports from stored procedures.
    Webi reports can only be created from Universe. So in Business Objects XIR3 we can create a special universe that enables Web Intelligence user's to access stored procedures residing in the database. This is the only way that Web Intelligence user's can access stored procedures.
    Please let me know if the above information helps.
    Regards,
    Pavan

Maybe you are looking for

  • Converting Robohelp Content to a Word and PDF document.

    I am in the process of creating an online help manual with several jpg images.  The jpg images are clear in Robohelp, but when I convert the content to a Word or PDF, the content and images are fuzzy and blurry, especially the PDF. Any thoughts or su

  • Newbie and floating fields

    Hi, I'm a newbie to LCD and I'm currently working with LCD as apart of my job... I'm currently working on and XDP that has floating fields defined within the document, i.e. {floatingfield} however within my XDP there is a piece of text defined as %si

  • Display webpage in Flash Professional

    I was wondering is there an easy to display a web page in flash professional?

  • ISight just doesn't work on Windows 7 64Bits

    I'm a new MacBook Pro user for a few days. I was attracted by the design of MacBook and knew I could install Windows on it, so after shopping for some time, I decided to get MBP 13". I got Windows 7 64Bits installed yesterdat; all the drivers are ins

  • Dispose Report closes all Excel spreadsheets

    With Report generation toolkit, I am creating an excel spreadsheet. I create a "New Report", do stuff and "Dispose Report". When I "Dispose Report", it closes ALL excel spreadsheets that are open, including ones that are not part of the LabVIEW appli