See Also

OraclePackage Members  | Devart.Data.Oracle Namespace  | OracleCommand Class  | OracleConnection Class

Language

Visual Basic

C#

Show All

See AlsoLanguagesDevart.Data.OracleSend comments on this topic.

OraclePackage Class

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.

Inheritance Hierarchy

System.Object
   System.MarshalByRefObject
      System.ComponentModel.Component
         Devart.Data.Oracle.OraclePackage

Syntax

[Visual Basic]
Public Class OraclePackage    Inherits Component    Implements IComponentIDisposable 
[C#]
public class OraclePackage : Component, IComponentIDisposable 

Remarks

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.

Example

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 ' ExecuteStoredProc

See Also

OraclePackage Members  | Devart.Data.Oracle Namespace  | OracleCommand Class  | OracleConnection Class

 

 


© 2002 - 2013 Devart. All Rights Reserved.