Download as pdf or txt
Download as pdf or txt
You are on page 1of 9

17/10/21 22:28 C5 Database Commands | Viva Clipper !

Viva Clipper !

Notes of a Clipper Language Student

C5 Database Commands

Posted on July 13, 2012 by vivaclipper

Database Commands and Statements

APPEND BLANK
(https://vivaclipper.wordpress.com/2013/07/18/c5_append-blank/) : 

Add a new record to current database file.

APPEND BLANK

APPEND FROM
(https://vivaclipper.wordpress.com/2013/07/18/c5_append-from/) :

Import records from a (.dbf) or ASCII file

APPEND FROM <xcFile>

[FIELDS <idField list>]

[<scope>]

[WHILE <lCondition>]

[FOR <lCondition>]

[SDF | DELIMITED [WITH BLANK | <xcDelimiter>] |

[VIA <xcDriver>]]

https://vivaclipper.wordpress.com/2012/07/13/database-commands-and-statements/ 1/9
17/10/21 22:28 C5 Database Commands | Viva Clipper !

AVERAGE (https://vivaclipper.wordpress.com/2013/07/18/c5_average/) :

Average numeric expressions in the current work area

AVERAGE <nExp list> TO <idVar list>

[<scope>]

[WHILE <lCondition>]

[FOR <lCondition>]

CLEAR ALL (https://vivaclipper.wordpress.com/2013/07/18/c5_clear-all/)*


:

Close files and release public and private variables.

CLEAR ALL

CLOSE (https://vivaclipper.wordpress.com/2013/07/18/c5_close/) :

Close a specific set of files

CLOSE [<idAlias> | ALL | ALTERNATE | DATABASES | FORMAT |INDEXES ]

COMMIT (https://vivaclipper.wordpress.com/2013/07/18/c5_commit/) :

Perform a solid-disk write for all active work areas

COMMIT

CONTINUE (https://vivaclipper.wordpress.com/2013/07/18/c5_continue/) :

Resume a pending LOCATE

CONTINUE

COPY STRUCTURE
(https://vivaclipper.wordpress.com/2013/07/18/c5_copy-structure/) :
https://vivaclipper.wordpress.com/2012/07/13/database-commands-and-statements/ 2/9
17/10/21 22:28 C5 Database Commands | Viva Clipper !

Copy the current (.dbf) structure to a new (.dbf) file

COPY STRUCTURE [FIELDS <idField list>] TO <xcDatabase>

COPY STRUCTURE EXTENDED


(https://vivaclipper.wordpress.com/2013/07/18/c5_copy-structure-
extended/) :

Copy field definitions to a (.dbf) file

COPY STRUCTURE EXTENDED TO <xcExtendedDatabase>

COPY TO (https://vivaclipper.wordpress.com/2013/07/18/c5_copy-to/) :

Export records to a new (.dbf) or ASCII file

COPY [FIELDS <idField list>] TO <xcFile>

[<scope>]

[WHILE <lCondition>]

[FOR <lCondition>]

[SDF | DELIMITED [WITH BLANK | <xcDelimiter>] |

[VIA <xcDriver>]]

COUNT (https://vivaclipper.wordpress.com/2013/07/18/c5_count/) :

Tally records to a variable

COUNT TO <idVar>

[<scope>]

[WHILE <lCondition>]

[FOR <lCondition>]

CREATE (https://vivaclipper.wordpress.com/2013/07/18/c5_create/) :

Create an empty structure extended (.dbf) file

CREATE <xcExtendedDatabase>

https://vivaclipper.wordpress.com/2012/07/13/database-commands-and-statements/ 3/9
17/10/21 22:28 C5 Database Commands | Viva Clipper !

CREATE FROM (https://vivaclipper.wordpress.com/2013/07/18/c5_create-


from/) :

Create a new (.dbf) file from a structure extended file

CREATE <xcDatabase>

FROM <xcExtendedDatabase>

[NEW]

[ALIAS <xcAlias>]

[VIA <cDriver>]

DELETE (https://vivaclipper.wordpress.com/2013/07/19/c5-delete/):

Mark records for deletion

DELETE [<scope>]

[WHILE <lCondition>]

[FOR <lCondition>]

FIELD :

Declare database field names

FIELD <idField list> [IN <idAlias>]

FIND (https://vivaclipper.wordpress.com/2013/07/19/c5_find/)* :

Search an index for a specified key value

FIND <xcSearchString>

GO (https://vivaclipper.wordpress.com/2013/07/19/c5_go/):

Move the record pointer to a specific record

GO[TO] <nRecord> | BOTTOM | TOP

https://vivaclipper.wordpress.com/2012/07/13/database-commands-and-statements/ 4/9
17/10/21 22:28 C5 Database Commands | Viva Clipper !

JOIN (https://vivaclipper.wordpress.com/2013/07/19/c5_join/):

Merge two (.dbf) files to create a new (.dbf) file

JOIN WITH <xcAlias> TO <xcDatabase>

FOR <lCondition>

[FIELDS <idField list>]

LOCATE (https://vivaclipper.wordpress.com/2013/07/19/c5_locate/):

Search sequentially for a record matching a condition

LOCATE [<scope>]

FOR <lCondition>

[WHILE <lCondition>]

PACK (https://vivaclipper.wordpress.com/2013/07/19/c5_pack/):

Remove deleted records from a database file

PACK

RECALL (https://vivaclipper.wordpress.com/2013/07/19/c5_recall/) :

Restore records marked for deletion

RECALL [<scope>]

[WHILE <lCondition>]

[FOR <lCondition>]

REPLACE (https://vivaclipper.wordpress.com/2013/07/19/c5_replace/):

Assign new values to field variables

REPLACE <idField> WITH <exp>

[, <idField2> WITH <exp2>...]

[<scope>]

[WHILE <lCondition>]

[FOR <lCondition>]
https://vivaclipper.wordpress.com/2012/07/13/database-commands-and-statements/ 5/9
17/10/21 22:28 C5 Database Commands | Viva Clipper !

SEEK (https://vivaclipper.wordpress.com/2013/07/19/c5_seek/):

Search an index for a specified key value

SEEK <expSearch>

SELECT (https://vivaclipper.wordpress.com/2013/07/19/c5_select-2/) :

Change the current work area

SELECT <xnWorkArea> | <idAlias>

SET DELETED (https://vivaclipper.wordpress.com/2013/07/19/c5_set-


deleted/) :

Toggle filtering of deleted records

SET DELETED on | OFF | <xlToggle>

SET EXCLUSIVE (https://vivaclipper.wordpress.com/2013/07/19/c5_set-


exclusive/) :

Establish shared or exclusive USE of database files

SET EXCLUSIVE ON | off | <xlToggle>

SET FILTER (https://vivaclipper.wordpress.com/2013/07/20/c5_set-filter/)


:

Hide records not meeting a condition

SET FILTER TO [<lCondition>]

https://vivaclipper.wordpress.com/2012/07/13/database-commands-and-statements/ 6/9
17/10/21 22:28 C5 Database Commands | Viva Clipper !

SET  MEMOBLOCK
(https://vivaclipper.wordpress.com/2013/07/20/c5_set-memoblock/) :

Change the block size for memo files

SET MEMOBLOCK TO <nSize>

SET PATH (https://vivaclipper.wordpress.com/2013/07/20/c5_set-path/) :

Specify the search path for opening files

SET PATH TO [<xcPathspec list>]

SET RELATION (https://vivaclipper.wordpress.com/2013/07/20/c5_set-


relation/):

Relate two work areas by a key value or record number

SET RELATION TO [<expKey> | <nRecord> INTO <xcAlias>]

[, [TO] <expKey2> | <nRecord2> INTO <xcAlias2>...]

[ADDITIVE]

SET SOFTSEEK (https://vivaclipper.wordpress.com/2013/07/20/c5_set-


softseek/) :

Toggle relative SEEKing

SET SOFTSEEK on | OFF | <xlToggle>

SET UNIQUE (https://vivaclipper.wordpress.com/2013/07/20/c5_set-


unique/) :

Toggle the inclusion of nonunique keys into an index

SET UNIQUE on | OFF | <xlToggle>

https://vivaclipper.wordpress.com/2012/07/13/database-commands-and-statements/ 7/9
17/10/21 22:28 C5 Database Commands | Viva Clipper !

SKIP (https://vivaclipper.wordpress.com/2013/07/20/c5_skip/) :

Move the record pointer to a new position

SKIP [<nRecords>] [ALIAS <idAlias> | <nWorkArea>]

SORT (https://vivaclipper.wordpress.com/2013/07/20/c5_sort/) :

Copy to a (.dbf) file in sorted order

SORT TO <xcDatabase> ON <idField> [/[A | D][C]]

[, <idField2> [/[A | D][C]]...]

[<scope>]

[WHILE <lCondition>]

[FOR <lCondition>]

SUM (https://vivaclipper.wordpress.com/2013/07/20/c5_sum/) :

Sum numeric expressions to variables

SUM <nExp list> TO <idVar list>

[<scope>]

[WHILE <lCondition>]

[FOR <lCondition>]

TOTAL (https://vivaclipper.wordpress.com/2013/07/20/c5_total/) : 

Summarize records by key value to a (.dbf) file

TOTAL ON <expKey> FIELDS <idField list>

TO <xcDatabase>

[<scope>]

[WHILE <lCondition>]

[FOR <lCondition>]

UNLOCK (https://vivaclipper.wordpress.com/2013/07/20/c5_unlock/) :

Release file/record locks set by the current user

UNLOCK [ALL]

https://vivaclipper.wordpress.com/2012/07/13/database-commands-and-statements/ 8/9
17/10/21 22:28 C5 Database Commands | Viva Clipper !

UPDATE (https://vivaclipper.wordpress.com/2013/07/20/c5_update/) : 

Update current database file from another database file

UPDATE FROM <xcAlias>

ON <expKey> [RANDOM]

REPLACE <idField> WITH <exp>

[, <idField2> WITH <exp2>...]

USE (https://vivaclipper.wordpress.com/2013/07/20/c5_use/) : 

Open an existing (.dbf) and its associated files

USE [<xcDatabase>

[INDEX <xcIndex list>]

[ALIAS <xcAlias>]

[EXCLUSIVE | SHARED]

[NEW] [READONLY]

[VIA <cDriver>]]

ZAP (https://vivaclipper.wordpress.com/2013/07/20/c5_zap/) : 

Remove all records from the current database file

ZAP

This entry was posted in Uncategorized and tagged APPEND BLANK, APPEND FROM, AVERAGE,
CLEAR ALL*, CLOSE, COMMIT, CONTINUE, COPY STRUCTURE, COPY STRUCTURE EXTENDED,
COPY TO, COUNT, CREATE, CREATE FROM, DELETE, FIELD, FIND, GO, Join, LOCATE, PACK,
REPLACE, SEEK, SELECT, SET DELETED, SET EXCLUSIVE, SET FILTER, SET PATH, SET RELATION,
SET SOFTSEEK, SET UNIQUE, SKIP, SORT, SUM, TOTAL, UNLOCK, Update, USE, ZAP. Bookmark the
permalink.
This site uses Akismet to reduce spam. Learn how your comment data is processed.

Blog at WordPress.com.

https://vivaclipper.wordpress.com/2012/07/13/database-commands-and-statements/ 9/9

You might also like