__dbCopyStruct()

Template

Procedure

Name

__dbCopyStruct()

Category

API

Subcategory

Database

Oneliner

Create a new database based on current database structure

Syntax

      __dbCopyStruct( <cFileName>,  [<aFieldList>] )

Arguments

<cFileName> is the name of the new database file to create. (.dbf) is the default extension if none is given.

<aFieldList> is an array where each element is a field name. Names could be specified as uppercase or lowercase.

Description

__dbCopyStruct() create a new empty database file with a structure that is based on the currently open database in this work-area. If <aFieldList> is empty, the newly created file would have the same structure as the currently open database. Else, the new file would contain only fields that exactly match <aFieldList>.

__dbCopyStruct() can be use to create a sub-set of the currently open database, based on a given field list.

COPY STRUCTURE command is preprocessed into __dbCopyStruct() function during compile time.

Examples

      // Create a new file that contain the same structure
      USE TEST
      __dbCopyStruct( "mycopy.dbf" )

      // Create a new file that contain part of the original structure
      LOCAL aList
      USE TEST
      aList := { "NAME" }
      __dbCopyStruct( "onlyname.dbf",  aList )

Compliance

Clipper

Platforms

All

Files

Library is rdd

Seealso

COPY STRUCTURE, COPY STRUCTURE EXTENDED, dbCreate(), dbStruct(), __dbCopyXStruct(), __dbCreate(), __dbStructFilter()

3 responses to “__dbCopyStruct()

  1. Pingback: Harbour Internal Functions | Viva Clipper !

  2. Pingback: Harbour Database Functions | Viva Clipper !

  3. Pingback: Harbour RG Summary | Viva Clipper !

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.