User Tools

Site Tools


dbaseiv_supported_commands_and_attributes.htm
Navigation:  ISAM File Drivers > dBaseIV Database Driver >====== dBaseIV:Supported Commands and Attributes ====== Previous pageReturn to chapter overviewNext page
File Attributes Supported
CREATE Y
DRIVER(filetype [,driver string]) Y
NAME Y
ENCRYPT N
OWNER(password) N
RECLAIM N1
PRE(prefix) Y
BINDABLE Y
THREAD Y12
EXTERNAL(member) Y
DLL([flag]) Y
OEM Y
File Structures Supported
INDEX Y
KEY Y
MEMO Y
BLOB N
RECORD Y
Index, Key, Memo Attributes Supported
BINARY N
DUP Y2
NOCASE Y
OPT N
PRIMARY Y
NAME Y
Ascending Components Y
Descending Components Y
Mixed Components N
Field Attributes Supported
DIM N
OVER Y
NAME Y
File Procedures Supported
BOF(file) Y8
BUFFER(file) N
BUILD(file) Y
BUILD(key) Y
BUILD(index) Y
BUILD(index, components) Y3
BUILD(index, components, filter) N
BYTES(file) N
CLOSE(file) Y
COPY(file, new file) Y4
CREATE(file) Y
DUPLICATE(file) Y
DUPLICATE(key) Y
EMPTY(file) Y
EOF(file) Y8
FLUSH(file) Y
LOCK(file) N
NAME(label) Y
OPEN(file, access mode) Y5
PACK(file) Y
POINTER(file) Y9
POINTER(key) Y9
POSITION(file) Y10
POSITION(key) Y10
RECORDS(file) Y11
RECORDS(key) Y11
REMOVE(file) Y
RENAME(file, new file) Y4
SEND(file, message) Y
SHARE(file, access mode) Y5
STATUS(file) Y
STREAM(file) Y
UNLOCK(file) N
Record Access Supported
ADD(file) Y6
ADD(file, length) N
APPEND(file) Y6
APPEND(file, length) N
DELETE(file) Y1
GET(file,key) Y
GET(file, filepointer) Y
GET(file, filepointer, length) N
GET(key, keypointer) Y
HOLD(file) Y7
NEXT(file) Y
NOMEMO(file) Y
PREVIOUS(file) Y
PUT(file) Y
PUT(file, filepointer) Y
PUT(file, filepointer, length) N
RELEASE(file) Y
REGET(file,string) Y
REGET(key,string) Y
RESET(file,string) Y
RESET(key,string) Y
SET(file) Y
SET(file, key) Y
SET(file, filepointer) Y
SET(key) Y
SET(key, key) Y
SET(key, keypointer) Y
SET(key, key, filepointer) Y
SKIP(file, count) Y
WATCH(file) Y
Transaction Processing Supported
LOGOUT(timeout, file, …, file) N
COMMIT N
ROLLBACK N
Null Data Processing Supported
NULL(field) N
SETNULL(field) N
SETNULL(file,field) N
SETNONNULL(field) N

Notes

1      When the driver deletes a record from a dBase IV database, the record is not physically removed, instead the driver marks it inactive. Memo fields are not physically removed from the memo file, however they cannot be retrieved if they refer to an inactive record. Key values are removed from the index files. To remove records and memo fields permanently, execute a PACK(file).

TipBox.jpg

To those programmers familiar with dBase IV, this driver processes deleted records consistent with the way dBase IV processes them after the SET DELETED ON command is issued. Records marked for deletion are ignored from processing by executable code statements, but remain in the data file.

2      In dBase IV it is legal to enter multiple records with duplicates of the unique key components. However, only the first of these records is indexed. So processing in key order only shows this first record. If you delete a record, then enter a new record with the same key value, the key file continues to point at the deleted record rather than the new record. In this situation, the dBase IV file driver driver changes the key file to point at the active record rather than the deleted record. This means that if you use a dBase IV program to delete a unique record, then insert a duplicate of this record, the new record is invisible when processing in key order until a pack is done. If you do the same process in a Clarion program, the new record is visible when processing in key order.

3      When building dynamic indexes, the components may take one of two forms:

  BUILD(DynNdx, '+Pre:FLD1, -Pre:FLD2')

This form specifies the names of the fields on which to build the index. The field names must appear as specified in the fields' NAME() attribute if supplied, or must be the label name. A prefix may be used for compatibility with Clarion conventions but is ignored.

  BUILD(DynNdx, 'T[Expression]')

This form specifies the type and Expression used to build an index–see Miscellaneous–Key Definition below.

4      These commands copy data and memo files using newfile, which may specify a new file name or directory. Key or index files are copied if the newfile is a subdirectory specification. To copy an index file to a new file, use a special form of the copy command:

 COPY(file,'<;index>|<;newfile>')

This returns File Not Found if an invalid index is passed. The COPY command assumes a default extension of .NDX for both the source and the target file names if none is specified. If you require a file name without an extension, terminate the name with a period. Given the file structure:

Clar2 FILE,CREATE,DRIVER('dBase4'),PRE(CL2)

NumKey  KEY(+CL2:Num),DUP

StrKey  KEY(+CL2:Str1)

StrKey2 KEY(+CL2:Str2)

AMemo   MEMO(100), NAME('mem')

Record  RECORD

Num      STRING(@n-_9.2)

STR1     STRING(2)

STR2     STRING(2)

Mem      STRING(10)

       END

     END

The following commands copy this file definition to A:

COPY(Clar2,'A:\CLAR2')

COPY(Clar2,'StrKey|A:\STRKEY')

COPY(Clar2,'StrKey2|A:\STRKEY2')

COPY(Clar2,'NumKey|A:\NUMKEY')

After these calls, the following files would exist on drive A: CLAR2.DBF, CLAR2.DBT, STRKEY.NDX, STRKEY2.NDX, and NUMKEY.NDX.

5      You do not need SHARE (or VSHARE) in any environment (for example, Novell) that supplies file locking as part of the operating system.

6      The ADD statement tests for duplicate keys before modifying the data file or its associated KEY files. Consequently it is slower than APPEND which performs no checks and does not update KEYs. When adding large amounts of data to a database use APPEND…BUILD in preference to ADD.

7      dBase IV performs record locking by locking the entire record within the data file. This prevents read access to other processes. Therefore we recommend minimizing the amount of time for which a record is held.

8      Although the driver supports these functions, we do not recommend their use. They must physically access the files and add overhead. Instead, test the value returned by ERRORCODE() after each sequential access. NEXT or PREVIOUS post Error 33 (Record Not Available) if an attempt is made to access a record beyond the end or beginning of the file.

9      There is no distinction between file pointers and key pointers; they both return the record number for any given record.

10     POSITION(file) returns a STRING(12). POSITION(key) returns a STRING containing the size of the key fields + 4 bytes.

11     Under dBase IV, the RECORDS() function reports the same number of records for the data file and its keys and indexes. Usually there will be no difference in the number of records unless the INDEX is out of date. Because the DELETE statement does not physically remove records, the number of records reported by the RECORDS() function includes inactive records. Exercise care when using this function.The field names must appear as specified in the fields' NAME() attribute if supplied, or must be the label name. A prefix may be used for compatibility with the Clarion conventions but is ignored.

12      THREADed files consume additional file handles for each thread that accesses the file.

dbaseiv_supported_commands_and_attributes.htm.txt · Last modified: 2021/04/15 15:57 by 127.0.0.1