BDE.CreateStoredProc Method

Applies to TestComplete 15.45, last modified on December 01, 2022
Accessing databases by using the Borland Database Engine (BDE) is deprecated. Do not use it to create new tests. It will be removed from the product in one of the future releases. As an alternative, you can access databases by using the Microsoft Active Data Object (ADO). See Using ADO Components.

Description

The CreateStoredProc method creates an object of the IAQAStoredProc type (an analogue of the VCL TStoredProc type).

Note: This method requires the Borland Database Engine to be installed on your computer.

Declaration

BDE.CreateStoredProc()

Result An IAQAStoredProc object

Applies To

The method is applied to the following object:

Result Value

An object of the IAQAStoredProc type.

Remarks

The IAQAStoredProc object provides the same functionality as the TStoredProc object in VCL applications. It implements the same methods and properties, under the same names. See the VCL documentation for TStoredProc.

Once the IAQAStoredProc object is created, you can use it to execute stored procedures. To do this:

  • Specify the database for which the procedure is stored (the DatabaseName property).
  • Specify the name of the stored procedure (the StoredProcName property).
  • If necessary, specify parameters for the procedure (the Params property).
  • Execute the procedure using the Open or ExecProc methods.

Example

The code below creates a new stored procedure and specifies its name.

JavaScript, JScript

function CreateStoredProc()
{
  // Creates the procedure
  var Proc = BDE.CreateStoredProc();
  // Specifies the procedure name
  Proc.StoredProcName = "DEMODPROC";
  // Specifies procedure parameters
  // ...
  // ...
}

Python

def CreateStoredProc():
  # Creates the procedure
  Proc = BDE.CreateStoredProc()
  # Specifies the procedure name
  Proc.StoredProcName = "DEMODPROC"
  # Specifies procedure parameters
  # ...
  # ...

VBScript

Sub CreateStoredProc
  ' Creates the procedure
  Set Proc = BDE.CreateStoredProc
  ' Specifies the procedure name
  Proc.StoredProcName = "DEMODPROC"
  ' Specifies procedure parameters
  ' ...
  ' ...
End Sub

DelphiScript

function CreateStoredProc;
var Proc;
begin
  // Creates the procedure
  Proc := BDE.CreateStoredProc();
  // Specifies the procedure name
  Proc.StoredProcName := 'DEMODPROC';
  // Specifies procedure parameters
  // ...
  // ...
end;

C++Script, C#Script

function CreateStoredProc()
{
  // Creates the procedure
  var Proc = BDE["CreateStoredProc"]();
  // Specifies the procedure name
  Proc["StoredProcName"] = "DEMODPROC";
  // Specifies procedure parameters
  // ...
  // ...
}

See Also

BDE.CreateTable
BDE.CreateQuery

Highlight search results