| Devart.Data.Oracle Namespace : OraclePackage Class |
Provides access to packages stored in the Oracle database.
For a list of all members of this type, see OraclePackage members.
Devart.Data.Oracle.OraclePackage
[Visual Basic]
Public Class OraclePackage
Inherits Component
Implements IComponent , IDisposable [C#]
public class OraclePackage : Component , IComponent , IDisposable Use OraclePackage component to get access to packages stored in the Oracle database. Packages may encapsulate sets of procedures and functions along with related variables and constants. For a list of Oracle supplied packages refer to Oracle online documents.
This class is available only in Professional and Developer Editions. It is not available in Standard and Mobile Editions.
The following example executes procedure with/without parameters and returns value.
[C#]
public void ExecuteStoredProc(OracleConnection conn)
{
OraclePackage package = new OraclePackage();
// Set active connection
// Connection must be opened
package.Connection = conn;
// Set package name where stored procedure exists
package.PackageName = "dbms_random";
// Execute procedure with parameters
package.ExecuteProcedure("initialize", 10);
// Execute procedure and return value
object randomInt = package.ExecuteProcedure("random",typeof(Int));
// Print returned value
Console.WriteLine(randomInt);
// Execute procedure without parameters
package.ExecuteProcedure("terminate");
} [Visual Basic]
Public Sub ExecuteStoredProc(conn As OracleConnection)
Dim package As New OraclePackage()
' Set active connection
' Connection must be opened
package.Connection = conn
' Set package name where stored procedure exists
package.PackageName = "dbms_random"
' Execute procedure with parameters
package.ExecuteProcedure("initialize", 10)
' Execute procedure and return value
Dim randomInt As Object
randomInt = package.ExecuteProcedure("random", GetType(Int))
' Print returned value
Console.WriteLine(randomInt)
' Execute procedure without parameters
package.ExecuteProcedure("terminate")
End Sub ' ExecuteStoredProcOraclePackage Members | Devart.Data.Oracle Namespace | OracleCommand Class | OracleConnection Class
© 2002 - 2013 Devart. All Rights Reserved.