SQL Differences Between dBASE and FoxPro

ID: Q114123

The information in this article applies to:

SUMMARY

The information below describes the Structured Query Language (SQL) differences between dBASE and FoxPro. This information is also found in the "Switching from dBASE" topic in FoxPro 2.6 Help.

To go directly to this topic in FoxPro, choose dBASE Help from the Help menu.

MORE INFORMATION

There are significant differences in the implementations of SQL in dBASE IV and FoxPro and some dBASE IV SQL commands are not supported in FoxPro.

dBASE SQL

    To work with dBASE IV data in SQL, you create a SQL database and
    perform operations on it in a special SQL mode. Programs using SQL
    must be separate and distinct from other dBASE programs (.PRS v
    .PRG programs). The semicolon is a continuation character for
    dBASE commands and a required command termination character for
    SQL commands.

FoxPro SQL
    FoxPro supports the SQL commands CREATE CURSOR, CREATE TABLE,
    INSERT, and SELECT. SQL is fully integrated in FoxPro. You can use
    SQL commands exactly as you would use any other FoxPro commands,
    interspersing FoxPro and SQL commands if you want. The semicolon
    is a continuation character for all FoxPro and SQL commands.

    Because of the significant differences between the implementation
    of SQL in dBASE IV and in FoxPro, complex dBASE IV SQL programs
    will not run in FoxPro and will have to be rewritten.

dBASE IV SQL commands not supported in FoxPro:

   ALTER TABLE                 CLOSE <SQL cursor name>
   CREATE DATABASE             CREATE INDEX
   CREATE SYNONYM              CREATE VIEW
   DBCHECK                     DBDEFINE
   DECLARE CURSOR              DELETE
   DELETE WHERE CURRENT        DROP DATABASE
   DROP INDEX                  DROP SYNONYM
   DROP TABLE                  DROP VIEW
   FETCH                       GRANT
   LOAD DATA                   OPEN
   REVOKE                      ROLLBACK
   RUNSTATS                    SHOW DATABASE
   START DATABASE              STOP DATABASE
   UPDATE                      UNLOAD DATA

Additional reference words: FoxDos FoxWin 2.60 foxhelp.dbf foxhelp.hlp KBCategory: kbprg KBSubcategory: FxinteropDbase

Last Reviewed: June 28, 1995