Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- RaSQL/B 6.1a for Clipper - <b>n_xdnload()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
N_XDNLOAD()
Download current table to specified DBF Table

Syntax
N_XDNLOAD(<cFilespec>|"*"|<nNext>    [,<lPositional>])

RDD Option
COPY TO or __DBCOPY()

Arguments
<cFilespec> is the filespec of the destination DBF. If "*" is specified, 
RaSQL uses the DBF open in the current area.  If  you specify <nNext> then 
RaSQL appends the next <nNext> records from the Btrieve file, starting with 
the current record, to the DBF open in the current area.

<lPositional> specifies the method used to move fields from table to DBF.
If <lPositional> is .F. or omitted then RaSQL moves fields from the table to 
DBF fields of the same name. In order to find a match, N_XDNLOAD() will 
truncate all field names to ten characters and replace all special 
characters with underscores (_). Thus table field name SS# would match DBF 
field name SS_, and table field order_number would match DBF field 
order_numb. If a field name in the source table corresponds to none of the 
names in the target DBF,  RaSQL will not move the field. If a field exists 
in the target but not in the source, RaSQL will leave the target field 
blank.
If <lPositional> is .T., then RaSQL moves fields from table to DBF in field 
order, regardless of the name. Undesirable results will occur if the files 
have incompatible structures.

Returns
True if successful. False on failure. Use N_XERROR() to get an error code.

Remarks
If <cFileSpec> is specified, a DBF file of the appropriate structure must 
already exist and must not be open in any area. If the existing DBF already 
contains records,  RaSQL will append the downloaded records to the DBF.  
Once the operation is complete, the DBF will remain open in the current area 
with the record pointer on the last appended record.  The Btrieve record 
pointer will be on EOF.

If "*" is specified then the target DBF must be open in the current area.  
RaSQL will append all the records from the Btrieve file to the DBF and will 
update any open indexes.  If  you have specified an N_XFILTER, only matching 
records will be downloaded.  At the end of the operation the DBF record 
pointer will be on the last appended record, while the Btrieve record 
pointer will be on EOF.

Specifying <nNext> is similar to using the Clipper NEXT scope.  RaSQL will 
append the number of Btrieve records specified, starting with the current 
record, to the DBF in the current area and will update any open indexes.  If  
you have specified N_XFILTER, only matching records will be counted and 
downloaded.  At the end of the operation, the DBF record pointer will be on 
the last appended record while the Btrieve record pointer will be on the 
next record past the last record downloaded (or EOF).

If needed,  you can use N_XMAKEDBF() to create a DBF with a structure that 
matches the table's.

Example
* Download Btrieve table to DBF on local drive
N_XSELECT('patients')
* Download table to DBF
N_XDNLOAD('c:patients.dbf')
USE patients.dbf

* Append to currently open DBF (patients.dbf)
USE patients.dbf
N_XDNLOAD("*")

* Append next 10 records from Btrieve file
N_XSEEK("Smith")
USE patients.dbf
N_XDNLOAD(10)


See Also: N_XFILTER() N_XMAKEDBF() N_XUPLOAD()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson