First character of parameter can be '/' or '-'.
Inside of the parameter the comma or semicolon is used as a
separator.
The remark to OS Unix, Linux:
In OS Unix character ';' designates the end of the command, therefore in the following cases:
/select:name,street,house,flat - is correct
/select:name;street;house;flat - is not correct!
"/select:name;street;house;flat" - is correct
If CDBFlite read commands from the file, both characters are
valid.
The remark to OS/2 DLL:
Sample script -
/* */
RxFuncAdd("CDBFlite","cdbflite","CDBFlite")
call CDBFlite 'c:\path\cdbflite.ini',
|
full name of ini-file or empty if not used: ''
/delete:10,20 - delete records #10 and #20
/delete:10-20 - delete records from #10 to #20
/delete:all - delete all records
/delete:10,20,30-35,40
/recall:10,20 - remove mark of deleting from records #10 and #20
/recall:10-20 - remove mark of deleting from records from #10 to #20
/recall:all - remove mark of deleting from all records
/recall:10,20,30-35,40
/delete:15-100 /pack
/pack:dbf
/zap
/blank
/append
/append:blank
/append:100
/trunc:100
/make:new.dbf
/sort:name
Before command /sort command /clear called automatically
(see below).
/sort:phone
/sort:street;house;flat
/cdx
/cpzero
/cpzero:3
*.dbf /check
/struct
/struct:somefile.txt
/struct:somefile.sql
/struct:somefile.dbf
/struct:somefile.prg
/struct:somefile.fox
/select:name
/select:name;phone
/select:name;street;house;flat
/select:*
/order:name /select:name;phone;street;house;flat
If you want to set the filter, set it before command /order
command. /filter command cancels /order command.
/order:name /select:name;phone /clear /order:phone /select:phone;name
/asc
/desc
/filter:name=Smith - to select people with name "Smith"
Here is required to explain, that in the command line you
can not use characters '|', '>', '<' - these characters used
Operation System for pipe of input-output. On this reason
you should replace in the command line this characters as
follows:
/filter:name=Smith&age>30 - to select people with name "Smith"
and age more them 30 year
/filter:name=Smith&age{30 - to select people with name "Smith"
and age less them 30 year
/filter:name=Smith;name=Gates - to select people with name "Smith"
or "Gates"
/filter:name=Smith|name=Gates - to select people with name "Smith"
or "Gates"
/filter:name~uck - to select people, containing a
substring "uck". Thus will be
selected "Luck", "Duck" etc. I.e.
not only beginning of field.
'|' --> ';'
If the commands are transmitted to the program from the
file, there it is possible to use any characters. The
following logical operations are allowed:
'>' --> '}'
'<' --> '{'
= - equal
If you set several filters, they will incorporated:
<> or >< - not equal
> or >> - more
>= - more or equal
< or << - less
<= - less or equal
~ - entry of a substring (for string fields)
/filter:name=A /filter:age=30
it's same as
/filter:name=A&age=30
It is necessary to notice, that in the second case to work
will be faster, as the matching goes for 1 pass, in the
first case 2.
If the compared expression contains blanks, you should to
conclude expression in quotes.
/filter:name="John Smith"
/filter command cancels /order command.
In the filter expression available following functions
ABS, ACOS, ASIN, ATAN, COSH, COS, EXP, LOG10, LOG,
POW10, ROUND, SINH, SIN, SQRT, SQR, TANH, TAN, TRUNC
for numeric fields.
/filter:summa-round(summa)>0.5
In the filter expression available following functions
TRIM, LTRIM, RTRIM, SUBSTR, LEFT, RIGHT
for Character and Date fields.
/filter:substr(date,3,2)=05 /select:*
For comparison date-field you should use finction DTOS:
/filter:date=dtos(02.05.2001) /select:*
/case /sort:name
/del /select:*
/date:ymd /filter:born=1971 /date:mdy /select:*
You can set date separator:
/date:- // 01-28-2001
/date:/ // 01/28/2001
/range:1-10
/range:11-20
/range:1-100,200-500,150
/range:all
/field:name="John Smith";age=30;phone=3-14159265358
/field:first=100 /update
/filter:name=John /field:first=100 /update
/count
*.dbf /name /count
*.dbf /name /filter:customer="Smith" /select:*
/calc:2+2*2
/calc:cos(0)
/trim - without suffix, trimming spaces is off.
/trim:left - Remove leading spaces from a character string.
/trim:right - Remove trailing spaces from a character string.
/trim:all - Remove leading and trailing spaces from a
character string.
/out /select:*
If filename with extension .txt specified, command /select
will add information to the indicated file in the same kind,
as previous parameter.
/out:file.txt /select:*
If filename with extension .csv specified, command /select
will add information to the indicated file in the CSV format
/out:file.csv /select:*
If filename with extension .htm specified, command /select
will add information to the indicated file as table, using
html syntax.
/out:file.htm /select:*
If filename with extension .dbf specified, command /select
will add information to the indicated .dbf-file. If file
does not exists - it will be created. If the file exists,
CDBFlite adds the information only in existing fields (same
names, as in the source file).
/out:file.dbf /select:name;address;phone
If filename with the .sql extension specified, command
/select will add information to the indicated file as
command "INSERT INTO" of SQL language.
/out:file.sql /select:*
If filename with the .prg or .fox extension specified,
command /select will add information to the indicated file
as command "REPLACE" of Clipper or FoxPro language.
/struct:dump.sql /out:dump.sql /select:*
/out:file.prg /select:*
/struct:dump.prg /out:dump.prg /select:*
cdbflite first.dbf +second.dbf
/hdr+ /select:*
/fields /select:*
/deleted-
/cmp or /cmp:i - to print the common information about databases.
Designatirons, used at comparison:
/cmp:s - to compare structures of databases.
/cmp:c - to compare contents of databases.
/cmp:isc - to execute all commands.
- - the field is absent.
<> - field has same name, but all other parameters are different.
~= - field has same name and type, but size is different.
= - all parameters of fields same, except offset inside the record.
== - Complete conformity of fields.
cdbflite file1.dbf /cmp:file2.dbf /cmp
cdbflite file1.dbf /cmp:file2.dbf /cmp:s
cdbflite file1.dbf /cmp:file2.dbf /f:born}dtos(01.01.1970) /o:name /cmp:ics
/sum:salary
/sum:payment;discount
/sum:*
/avg:salary
/avg:payment;discount
/avg:*
/encode:super_secret
/decode:super_secret
/psw:12345 /field:a1=John;a2=Smith;a3=100;a4=05.27.2001 /append
/psw:12345 /select:*
/bak+
/bak-
Besides you can specify some commands after the field definition
An entire file can look like this:
-PRC_MNC
PRC_PID=PARCELID
-PRC_ASSNG_
-PRC_ASS001
FULLNAME C(80) EXP:TRIM(FIRST) TRIM(LAST)
PRC_BLOCK/BLOCK
PRC_LOT=LOT
ID N(10) INC:1