Creating Stored Procedures

You can create stored procedures for the tables in your database. A stored procedure is Visual FoxPro code that is stored in the .dbc file. Stored procedures are code procedures that operate specifically on the data in the database. Stored procedures can improve performance because they are loaded into memory when a database is opened.

To create, modify, or remove a stored procedure

  • In the Project Manager, select a database and select Stored Procedures, then choose New, Modify, or Remove.

    -or-

  • In the Database Designer, choose Edit Stored Procedures from the Database menu.

    -or-

  • In the Command window, use the MODIFY PROCEDURE command.

Each of these options opens the Visual FoxPro text editor, allowing you to create, modify, or remove stored procedures in the current database.

You can use stored procedures for creating user-defined functions that you reference in field- and record-level validation rules. When you save a user-defined function as a stored procedure in your database, the code for the function is saved in the .dbc file and automatically moves with the database if you relocate the database. Using stored procedures also makes your application more portable because you don't have to manage user-defined function files separately from your database file.

See Also

Building Referential Integrity | Viewing and Setting Database Properties | Viewing and Modifying Database Architecture | Creating Persistent Relationships | Creating Databases | Working with a Database