Can be an integer constant (15, 200); a variable, a form field, or a parameter that evaluates to an integer; the word ALL. If num is omitted, or less than 0, it defaults to 1.
setspec
The set specification for the simple set whose records you want to delete. If omitted, records are deleted from the current set (if it exists).
Comments
Records cannot be deleted from a composite set. Data cannot be deleted from application documents or forms. If the target of DELETE is a set object or result set, deletion always starts at the current member of the set.
Data removed from the database by a DELETE command cannot be recovered.
Example
delete
Deletes the current member of the current set.
delete 5 Employees where DeptNum = D01
Deletes the first five records in Employees where the department number is D01.
Deletes records from EntitySets or relationships with fields.
Syntax
DELETE [ALL] FROM SQLsetspec [EVALUATE clause] [-> clause]
Parameters
ALL
Optional. Whether or not you include the ALL argument, all records in SQLsetspec are deleted.
SQLsetspec
An SQL set specification. If omitted, records are deleted from the current set (if it exists).
Comments
DELETE FROM is the SQL version of the DELETE command. Records cannot be deleted from a composite set. Data cannot be deleted from application documents or forms. DELETE FROM acts by default on all records in SQLsetspec. By contrast, DELETE acts by default on only the first record in a set.
Warning: You cannot recover data deleted by the DELETE FROM command. If no backup copy of the data exists, the data is permanently lost.
Example
delete from Employees where LastName = “Smith”
Deletes every employee whose last name is Smith.
delete from Fields where Length > (select avg (length) from Fields)
Deletes every field whose length is greater than the average length of all fields.
Returns information about the currently accessed application directories.
Syntax
$dirpath()
Return Value
Character string.
Comments
$dirpath returns a character string consisting of the names of all currently accessed application directories and their access types (U for update, R for read). Information about each directory is enclosed in semicolons (;). The directory name appears first, followed by the access type in parentheses. Directories appear in the order that they were accessed; that is, the most recently accessed directories appear first.
Example
access dir1
access dir2 updatev
output $dirpath()
Prints the string; dir2(U);dir1(R);ZIM(U);_$ZimServices(R);_$session$_(U);
let vDirPath = $dirpath()
let vPos = $position($toalpha(vDirPath, -1), ";Dir1(")
if vPos > 0
output "Directory Dir1 is accessed ";
if $substring(vDirPath,vPos+6,1)="U"
output "update."
else
output "read."
endif
else
output "Directory Dir1 is NOT accessed."
endif
Uses $position to test if a particular directory is accessed.
Encrypts the data in an EntitySet or relationship with fields.
Syntax
ENCRYPT object
Parameters
object
The name of an EntitySet or a relationship with fields. Can be a role name.
Comments
The ENCRYPT command makes stored data meaningless to anyone scanning a raw database file on disk, thereby protecting the data from unauthorized access. The encryption key is established when the New Database utility is executed. If the data in the specified object has already been encrypted, reissuing the command raises an error. The ENCRYPT and DECRYPT commands prevent users outside of an application session from reading sensitive data contained in disk files. All encryption and decryption in a particular database is based on a key established when you initiate a new database . Encrypted EntitySets and relationships are accessed in exactly the same way as un-encrypted EntitySets or relationships. Internally, the software automatically decrypts data from an encrypted file as you work with that file. A slight performance penalty is paid for working with encrypted data. An encrypted object can be returned to normal with a DECRYPT command.
Changes the runtime file name of a connector document
Syntax
SET CONNECTOR DOCUMENT connector document TO filename
Parameters
connector document
The name of the connector document.
filename
The file name to which the connector document will be referencing.
Comments
The SET CONNECTOR DOCUMENT changes the run-time value for the filename field on a connector document. The new filename is used for all subsequent opens on the document. The filename of a connector document describes the type of the connection and the host and port where the connector resides. There are two connection types ™S™ which is used for connectors that are used for simple command-response operations or are shared single-threaded processes and F™ for connectors that provide a data feed and are either multi-threaded or used exclusively by a single ZIM instance.
A ™S™ type connection is automatically closed after the command completes and the connector issues a PROMPT. The ™F™ type connection never closes.
Example
To set the filename for the connector document SMS_SEND to be a command-response connection where the connector is running on the host ™zimdatabases.com™ at TCP port 9000:
set connector document SMS_SEND to !zimdatabases.com!9000
To set the filename on the connector SMS_RECEIVE to be a data feed where the connector is running on the host ™zimdatabases.com™ at TCP port 9001:
set connector document SMS_RECEIVE to ™F!zimdatabases.com!9001™
Specifies if quotation marks are required for character strings.
Syntax
SET QUOTING ON|OFF
Comments
The QUOTING option is set OFF by default.
Setting QUOTING ON causes the software to issue a warning message each time it encounters a non-numeric character string not enclosed in quotation marks (i.e., unquoted character strings that are valid numbers do not elicit warnings).
The SET QUOTING ON command can be used to reinforce the distinction between character strings and object names (reserved words and the names of objects in your application). While you are reminded to enclose character strings in quotation marks, you are not forced to comply. The software continues to accept unquoted character strings, because the messages being issued are warnings, not errors. Warning messages can be turned off with SET WARNINGS OFF or a SET MESSAGES OFF command.
The SET QUOTING command is not affected by the SET RESET and SET RESTORE commands.
Example
set quoting on let Name = Smith
When the LET command is encountered, a warning message is issued because Smith is not enclosed in quotation marks.
set quoting on find employees let Name = “Smith” let Name = FirstName let Salary = 20000
No warnings are issued: Smith is enclosed in quotation marks; FirstName is a field name; and 20000 is a valid number.
Calculates a time value by adding minutes to (or subtracting minutes from) a specified time value.
Syntax
$addminutes(time,number)
where
time
an 8-digit number or an expression that evaluates to an 8-digit number, that expresses a valid time value in the format HHMMSSTT
number
a number or an expression that evaluates to a number
Return Value
Number, representing a time value.
Comments
Use $addminutes to perform arithmetic with time values. The $addminutes function calculates a time value by adding a number representing minutes to a time value. If number is negative, the effect is to subtract the minutes from the time.
Quickly marks a large block of code that you want to prevent from running or that you want to be generated by the GENERATE command by putting the delimiters at the start and end of an output section in a template program.
Syntax
Place a two less than characters before the start of the code.
<< code / statements >>
Place a two greater than characters at the end of your code.
Parameters
code \ statements
one or more command statements, typically using macros, to send to the current output destination when the program containing them is processed with a GENERATE command
Comments
The program template delimiters, << and >>, must appear alone on a physical line in the application document. When the program is executed, parsed, or compiled, the statements between the delimiters are ignored.
When the program is run under the GENERATE command, the statements are sent as output, after macro substitution, to the current output device.
Example
… commands1 … << … commands2 … >> … commands3 …
Under normal execution, commands1 and commands3 execute normally; commands2 are ignored.
When the program is parsed or compiled, commands1 and commands3 are parsed or complied in the usual manner; commands2 are ignored.
When the GENERATE command is used, commands1 and commands3 execute normally; commands2 are sent as output, after macro substitution, to the current output device.