Procedures(ProcedureName: String): IDalProcedures;
ProcedureName. Physical name of procedure in the database.
The Procedures property returns the cursor containing system information about the specified procedure.
If an empty row is specified as the value of the ProcedureName property, the property returns the cursor containing the information about all the procedures, which are in the database.
Sub UserProc;
Var
Driver: IDalDriver;
Connect: IDalConnection;
ProcCur: IDalProcedures;
ConnectDesc: IDalConnectionDescriptor;
ConnectDescParams: IDalConnectionDescriptorParams;
ColFields: IDalCursorFields;
ColField: IDalCursorField;
i: Integer;
Begin
Driver := New DalOrcl8Driver.Create;
ConnectDesc := Driver.CreateDescriptor;
ConnectDescParams := ConnectDesc.Params;
ConnectDescParams.Find("User Name").Value := "User";
ConnectDescParams.Find("Password").Value := "Password";
ConnectDescParams.Find("Host BSTR").Value := "OrclServer";
ConnectDescParams.Find("Schema").Value := "Repository";
Connect := ConnectDesc.CreateConnection;
//Parameters of the Proc_1 procedure
ProcCur := Connect.Procedures("Proc_1");
ColFields := ProcCur.Fields;
//View parameters and their values
While Not ProcCur.Eof Do
i := i + 1;
Debug.WriteLine("Parameter number: " + i.ToString);
Debug.Indent;
For Each ColField In ColFields Do
Debug.WriteLine(ColField.Name + " = " + ColField.Value);
End For;
Debug.Unindent;
ProcCur.Next;
End While;
ProcCur.Close;
Connect.Close;
End Sub UserProc;
On executing the example the repository connection is established with specified location parameters. A cursor with parameters of the Proc_1 procedure is created based on the connection. Information about parameters and their values is displayed in the development environment console.
The requirements and result of the Fore.NET example execution match with those in the Fore example.
Imports Prognoz.Platform.Interop.Dal;
Imports Prognoz.Platform.PiLibNet.Utils;
Sub UserProc();
Var
Driver: DalOrcl8Driver = ComCreator.Instance.CoCreate<DalOrcl8DriverClass>();
Connect: IDalConnection;
ProcCur: IDalProcedures;
ConnectDesc: IDalConnectionDescriptor;
ConnectDescParams: IDalConnectionDescriptorParams;
ColFields: IDalCursorFields;
ColField: IDalCursorField;
i: Integer;
Begin
ConnectDesc := Driver.CreateDescriptor();
ConnectDescParams := ConnectDesc.Params;
ConnectDescParams.Find("User Name").Value := "User";
ConnectDescParams.Find("Password").Value := "Password";
ConnectDescParams.Find("Host BSTR").Value := "OrclServer";
ConnectDescParams.Find("Schema").Value := "Repository";
Connect := ConnectDesc.CreateConnection();
//Parameters of the Proc_1 procedure
ProcCur := Connect.Procedures["Proc_1"];
ColFields := ProcCur.Fields;
//View parameters and their values
While Not ProcCur.Eof() Do
i := i + 1;
System.Diagnostics.Debug.WriteLine("Parameter number: " + i.ToString());
System.Diagnostics.Debug.Indent();
For Each ColField In ColFields Do
System.Diagnostics.Debug.WriteLine(ColField.Name + " = " + ColField.Value);
End For;
System.Diagnostics.Debug.Unindent();
ProcCur.Next();
End While;
ProcCur.Close();
Connect.Close();
End Sub;
See also: