Page 1 of 1

List of Stored Procedures

Posted: Mon 20 Sep 2010 08:32
by TheDotNetSystem
Hi !

Is there a way, to get a List of my Stored Procedures?

Posted: Tue 21 Sep 2010 08:23
by Shalex
Please use the OracleConnection.GetSchema() method to return System.Data.DataTable object with information about the server elements. The following sample shows a possible usage of the Procedures collection:

Code: Select all

using (OracleConnection conn = new OracleConnection())
{
    conn.ConnectionString = "server=ora1110;uid=scott;pwd=tiger;";
    conn.Open();
    DataTable table = conn.GetSchema("Procedures");
    DataTable table2 = conn.GetSchema("Procedures", new string[] { "schema_name" });
    DataTable table3 = conn.GetSchema("Procedures", new string[] { "schema_name", "package_name" });
    DataTable table4 = conn.GetSchema("Procedures", new string[] { "schema_name", "package_name", "procedure_name"});
}
For more information, please refer to the Retrieving Metadata article.