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_xupload()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
N_XUPLOAD()
Upload a DBF to the current table

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

RDD Option
APPEND FROM or __DBAPP()

Arguments
If you specify <cFilespec>, RaSQL  opens the specified DBF and uploads it 
into the current Btrieve file. 
If a DBF is already open in the current area you may specify "*" or <nNext>.
If you specify "*", RaSQL uploads the DBF open in the current area.  
If you specify <nNext>, RaSQL uploads the NEXT specified number of records 
to the Btrieve file.

<lPositional> specifies the method used to move fields from DBF to table.
If <lPositional> is .F. or omitted then RaSQL moves fields from the DBF to 
table 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 DBF corresponds to none of the names in 
the target Btrieve file,  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 DBF to table 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  you specified <cFileSpec>,  RaSQL inserts all records from the specified 
DBF into the current Btrieve table.  At the end of the operation, the 
specified DBF remains open in the current area.  RaSQL positions the DBF 
record pointer on EOF and positions the Btrieve record pointer the last 
record appended.   This is a "raw" upload and index tags and delete flags 
are ignored.  Btrieve indexes, however, will be updated properly.

If "*" is specified, the source DBF must be open in the current area.  RaSQL 
appends all records from the DBF to the Btrieve table.  This is a "smart" 
append, i.e., DBF index order, filters and deleted() status will be 
respected.  At the end of the operation, RaSQL will position the DBF record 
pointer on EOF and the Btrieve table pointer  on the last record inserted.

If  you specify <nNext>, the source DBF must be open in the current area.  
The NEXT <nNext> DBF records, starting with the current record will be 
appended.  Index order, filters and deleted() status will be respected.  At 
the end of the operation the DBF record pointer will be positioned on the 
logical EOF while the Btrieve table pointer will be positioned on the last 
record inserted.

Example
* Upload data from DBF
N_XUSE('patients.dta', ...)
N_XUPLOAD('newdata.dbf')


See Also: N_XDNLOAD()

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