| xHarbour Reference Documentation > Command Reference |
![]() |
![]() |
![]() |
Copies the current database structure to a new database file.
COPY STRUCTURE [FIELDS <fieldNames,...>] ;
TO <cDatabase>
COPY STRUCTURE is a database command used for creating an empty database file based on the field definitions of the current work area. All fields of the current work area are used for the new database unless a list of field names is provided.
Should <cDatabase> already exist, it will be overwritten without warning.
| See also: | APPEND FROM, COPY STRUCTURE EXTENDED, CREATE, DbAppend(), DbCopyStruct(), DbCopyExtStruct(), DbCreate() |
| Category: | Database commands |
| Source: | rtl\dbstrux.prg |
| LIB: | xhb.lib |
| DLL: | xhbdll.dll |
// The example demonstrates a technique for creating a subset of records
// in a temporary database file.
PROCEDURE Main
USE Address NEW
COPY STRUCTURE TO Temp
USE Temp
APPEND FROM Address FOR Trim(Upper(Address->City)) = "LONDON"
< database operations with temporary file >
CLOSE Temp
ERASE Temp.dbf
RETURN
http://www.xHarbour.com