You receive a "Server: Msg 7212, Level 17, State 1, Line 1" error message when you run an Oracle procedure from a computer that is running SQL Server 2000 (873234)



The information in this article applies to:

  • Microsoft SQL Server 2000 (all editions)

SYMPTOMS

You run an Oracle procedure in an Oracle database. When you do this from a computer that is running Microsoft SQL Server 2000 by using a linked server to an Oracle database, you receive the following error message:
Server: Msg 7212, Level 17, State 1, Line 1 Could not execute procedure 'Oracle Procedure Name' on remote server 'MyLinkedServer'.
[OLE/DB provider returned message: One or more errors occurred during processing of command.]
[OLE/DB provider returned message: Syntax error in {call...} ODBC Escape.]
The problem occurs if the linked server uses the Microsoft OLE DB Provider for Oracle (MSDAORA).

Note Oracle Procedure Name is a placeholder for the name of the Oracle procedure that is in the Oracle database. MyLinkedServer is a placeholder for the name of the linked server that is present in the instance of SQL Server 2000 that links to the Oracle database server.

MORE INFORMATION

Steps to reproduce the behavior

  1. Create an Oracle procedure in an Oracle database server by using the following script:
    CREATE OR REPLACE PROCEDURE SP_EMP is m_count number;
     begin
     select count(*) into m_count from emp;
     dbms_output.put_line(m_count);
    end;
  2. Create a linked server to the Oracle database server in SQL Server 2000.
    1. Click Start, point to Programs, point to Microsoft SQL Server, and then click Enterprise Manager.
    2. In the left pane, expand Microsoft SQL Servers, expand SQL Server Group, expand the server where you want to create a linked server, and then expand Security.
    3. Right-click Linked Servers, and then click New Linked Server. The Linked Server Properties - New Linked Server dialog box appears.
    4. On the General tab, type MyLinkedServer in the Linked server box.

      Note MyLinkedServer is a placeholder for the name of the linked server that is present in the instance of SQL Server 2000 that links to the Oracle database server.
    5. Under Server type, click Other data source.
    6. In the Provider name list, click Microsoft OLE DB Provider for Oracle.
    7. In the Product name box, type Oracle.
    8. In the Data source box, type the name of the Oracle database server that you want to connect to.
    9. In the Provider string box, type the provider string for the Oracle database server.
    10. On the Security tab, click Be made using this security context under For a login not defined in the list above.
    11. Type Logon Name in the Remote login box, and then type Password in the With password box.

      Note Logon Name is a placeholder for the user name that you use to log on to the Oracle database server. Password is a placeholder for the password that is you use to log on to the Oracle database server.
    12. On the Server Options tab, click to select the RPC Out check box under Option Name, and then click OK.
    13. Quit Enterprise Manager.
  3. Run the Oracle procedure.
    1. Start SQL Query Analyzer.
    2. In the query window, type the following:

      exec MyLinkedServer..Logon Name.sp_emp;

    3. On the Query menu, click Execute. You notice the error message that is mentioned in the "Symptoms" section.

REFERENCES

For more information about the OLE DB Provider for Oracle, visit the following Microsoft Developer Network (MSDN) Web site: For additional information, click the following article number to view the article in the Microsoft Knowledge Base:

280106 How to set up and troubleshoot a linked server to Oracle in SQL Server

The third-party products that this article discusses are manufactured by companies that are independent of Microsoft. Microsoft makes no warranty, implied or otherwise, regarding the performance or reliability of these products.

Modification Type:MinorLast Reviewed:8/17/2004
Keywords:kbStoredProc kbOracle kbtshoot kberrmsg kbCodeSnippet kbprb KB873234 kbAudDeveloper