SQL Differences Between dBASE and FoxPro

Last reviewed: June 28, 1995
Article ID: Q114123
The information in this article applies to:
  • Microsoft FoxPro for Windows, version 2.6
  • Microsoft FoxPro for MS-DOS, version 2.6

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


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: June 28, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.