Overview of .NET Stored Procedures

.NET stored procedures are methods or procedures written in a .NET language which contains SQL or PL/SQL statements.

You can write custom stored procedures and functions using any .NET compliant language, such as C# and VB.NET, and use these .NET stored procedures in the database, in the same manner as other PL/SQL or Java stored procedures. .NET stored procedures can be called from PL/SQL packages, procedures, functions, and triggers; from SQL statements, or from anywhere a PL/SQL procedure or function can be called.

Oracle Database Extensions for .NET (a database option that allows you to write .NET stored procedures) must be installed and configured in the database to run the examples in this chapter.

This chapter discusses how to use and deploy .NET stored procedures in your application.

Starting the Common Language Runtime Service

To use .NET stored procedures, you must first start the common language runtime agent, represented by the OraClrAgent service. This service may not start by default. Note that it is located on the Oracle database, not on the client.

Note:

OraClrAgnt can be accessed through the Services Control Panel, as OracleOracleHomeNameClrAgnt, where OracleHomeName represents your Oracle home.

To start the common language runtime service:

From the Start menu, select All Programs, then select Administrative Tools, and finally, select Services.

In the Services window, click the Extended tab.

Scroll down the list of Services, and select OracleOracleHomeNameClrAgnt.

Click the Start hyperlink.

The Service Control window shows that the OracleClrAgent is starting.

When the Service Control window closes, note that the status of the OracleClrAgent is changed to Started.

Creating a Connection as SYSDBA

Next, you must create a database connection as SYSDBA which enables you to deploy your Oracle Project.

Note:

You must have administrative privileges as SYSDBA to perform this task.