COPY STRUCTURE EXTENDED Command Example

The following example displays the structure of the orders table, copies the structure extended to a temp table, browses temp, creates a backup table from temp, and displays the structure of backup.

CLOSE DATABASES
OPEN DATABASE (HOME(2) + 'Data\testdata')
USE orders  && Opens Orders table
CLEAR
DISPLAY STRUCTURE

WAIT WINDOW 'Structure of the orders table' NOWAIT
COPY STRUCTURE EXTENDED TO temp
USE temp
WAIT WINDOW 'The temp table - 1 row per field in orders' NOWAIT
BROWSE
CREATE backup FROM temp
USE backup
DISPLAY STRUCTURE
WAIT WINDOW 'Backup.dbf has the same structure as orders' NOWAIT
USE
DELETE FILE temp.dbf
DELETE FILE backup.dbf