__dbSDF()

Template

Procedure

Name

__dbSDF()

Category

API

Subcategory

Database

Oneliner

Copies the contents of a database to an SDF text file or appends the contents of an SDF text file to a database.

Syntax

      __dbSDF( <lExport>,  <xcFile>,  [<aFields>], 
      [<bFor>],  [<bWhile>],  [<nNext>],  [<nRecord>],  <lRest>  )

Arguments

<lExport> If set to .T., copies records to an SDF file. If set to .F., append records from an SDF file.

<xcFile> The name of the text file to copy to or append from. If a file extension is not specified, “.txt” is used by default.

<aFields> An aray of field names to limit the processint to. If not specified, or if empty, then all fields are processed.

<bFor> An optional code block containing a FOR expression that will reduce the number of records to be processed.

<bWhile> An optional code block containing a WHILE expression that will reduce the number of records to be processed.

<nNext> If present, but <nRecord> is not present, specifies to process this number of records, starting with the current record. A value of 0 means to process no records.

<nRecord> If present, specifies the only record to process. A value of 0 means to process no records. Overrides <nNext> and <lRest>.

<lRest> If <lExport> is .T., then if <lRest> is set to .T. and there are no <nRecord>, <nNext>, or <bWhile> arguments, processes all records from current to last.

Description

__dbSDF() copies all or selected contents of a database table to an SDF text file or appends all or selected contents of an SDF text file to a database table.

Examples

      // Copy delinquent accounts into an SDF text file.
      USE ACCOUNTS NEW
      COPY TO overdue SDF FOR ! Empty( accounts->duedate ) ;
         .AND. Date() - accounts->duedate > 30
      // Import new customer records.
      USE CUSTOMER NEW
      APPEND FROM customer SDF

Compliance

Clipper

Platforms

All

Files

Seealso

__dbDelim(), APPEND FROM, COPY TO

3 responses to “__dbSDF()

  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.