# __dbSDF()

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

Syntax

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

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 set to .T. and there are no nRecord, nNext, or bWhile arguments, processes all records from current to last.

Returns

  NIL

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
    Tests

Status

  Started

Compliance

  __dbSDF() is intended to be fully compliant with CA-Clipper's function of the same name and is the underlying implementation of the APPEND FROM SDF and COPY TO SDF commands.

Platforms

  All

Files

See Also

- __dbDelim()
- APPEND FROM,
- COPY TO