SQL Commands and Functions

Visual FoxPro supports Structured Query Language (SQL) commands and functions. Visual FoxPro's SQL commands make use of Rushmore Query Optimization technology to optimize performance, and a single SQL command can be used to replace multiple Visual FoxPro commands.

Visual FoxPro supports the following:

  • ALTER TABLE - SQL Command
    Modifies an existing table. You can modify the name, type, precision, scale, null value support, and referential integrity rules for each field in the table.
  • CREATE CURSOR - SQL Command
    Creates a temporary table. Each field in the temporary table is defined with a name, type, precision, scale, null value support, and referential integrity rules. These definitions can be obtained from the command itself or from an array.
  • CREATE SQL VIEW Command
    Displays the View Designer, allowing you to create an SQL view.
  • CREATE TABLE -SQL Command
    Creates a table. Each new table field is defined with a name, type, precision, scale, null value support, and referential integrity rules. These definitions can be obtained from the command itself or from an array.
  • DELETE - SQL Command
    Marks records in a table for deletion using SQL syntax.
  • INSERT - SQL Command
    Appends a new record to the end of an existing table. The new record contains data listed in the INSERT command or from an array.
  • SELECT - SQL Command
    Specifies the criteria on which a query is based and issues the query. Visual FoxPro interprets the query and retrieves the specified data from the table(s). The SELECT command is built into Visual FoxPro like any other Visual FoxPro command. You can create a SELECT command query in these areas:
    • In the Command window.
    • In a Visual FoxPro program (like any other Visual FoxPro command).
    • In the Query Designer.
  • SQL Pass-Through Foundation Class
    Makes it possible for you to execute stored procedures on a host database such as Microsoft SQL Server.
  • SQLCANCEL( ) Function
    Requests cancellation of an executing SQL statement
  • SQLCOLUMNS( ) Function
    Stores a list of column names and information about each column for the specified data source table to a Visual FoxPro cursor.
  • SQLCOMMIT( ) Function
    Commits a transaction.
  • SQLCONNECT( ) Function
    Establishes a connection to a data source.
  • SQLDISCONNECT( ) Function
    Terminates a connection to a data source.
  • SQLEXEC( ) Function
    Sends an SQL statement to the data source, where the statement is processed.
  • SQLGETPROP( ) Function
    Returns current or default settings for an active connection.
  • SQLMORERESULTS( ) Function
    Copies another result set to a Visual FoxPro cursor if more result sets are available.
  • SQLPREPARE( ) Function
    Prepares an SQL statement for remote execution by SQLEXEC( ).
  • SQLROLLBACK( ) Function
    Cancels any changes made during the current transaction.
  • SQLSETPROP( ) Function
    Specifies settings for an active connection.
  • SQLSTRINGCONNECT( ) Function
    Establishes a connection to a data source through a connection string.
  • SQLTABLES( ) Function
    Stores the names of tables in a data source to a Visual FoxPro cursor.
  • UPDATE - SQL Command
    Updates records in a table. The records can be updated based on the results of a SELECT - SQL statement.

See Also

CREATE QUERY | MODIFY QUERY | Language Reference