Simplicty and flexibility!


Support::

Unlock


Parameters


Returns/Result


Examples


Reference

unlock

unlock

Type

Processing Command

Purpose

The unlock command is functional only when running DataEase on a LAN (Local Area Network). The unlock command unlocks locked tables or records allowing other users full access to the data.

Syntax

unlock all files .

unlock file TABLENAME .

unlock selected record .

Usage

The unlock all files command unlocks all tables referenced by the procedure. If unlock all files is the first statement in the script, the default locking rules are overridden and all data is locked by individual records. You may lock tables on a selective basis using the lock file command.

The unlock file command unlocks the specified table for the duration of the procedure, or until the same table is specified in a lock command. In a script that begins with a lock all files statement, the unlock file command lets you unlock tables selectively, while the other tables referenced by the script remain locked.

The unlock selected record command unlocks the record that is currently being processed. If the default locking rules are overridden by an unlock all files or unlock file command, DataEase automatically locks a record from the time it is selected for processing until the next record is selected. Often, significant processing not involving the locked record may take place. By using the lock and unlock selected record commands, you can reduce the amount of time a record remains locked.

LAN

The default LAN Multi-User Locking Options resolve conflicts that arise when users attempt to view, modify, or delete records in a table while data in that table is being accessed by a procedure. If another user is currently using a resource required by the unlock command, DataEase displays a Resource Conflict message. While this message is displayed, DataEase automatically tries to execute the command at brief intervals.

When the required resource becomes available, DataEase automatically resumes processing and executes the rest of the procedure.

Example

In order to override the default locking rules, the first statement of a script must be either lock all files or unlock all files. If neither of these commands appears at the start of the script, the default locking rules govern LAN functioning until a lock or unlock command appears in the script. All lock and unlock commands are automatically terminated at the end of a script.

 

lock file RESERVATIONS shared .

 

for MEMBERS with ( sum of

RESERVATIONS TOTAL DUE > 5000) ;

lock selected record .

list records

LAST NAME ;

TOTAL DUE .

unlock selected record .

end

for MEMBERS with ( highest of

RESERVATIONS DEPARTURE DATE < 01/01/99 ) ;

delete records .

end

 

This script tells DataEase: (1) Lock the RESERVATIONS table so other users can view records but cannot add, delete or modify RESERVATIONS records during the processing of this procedure, (2) select all the MEMBERS records whose related RESERVATIONS records have a combined TOTAL DUE greater than $5000, (3) lock each MEMBERS record as it is selected for further processing. For each record selected, list the member's LAST NAME and TOTAL DUE, and (4) after each record is listed, unlock the record before continuing to the next part of the script.

Locking the RESERVATIONS table at the start of this procedure prevents other users from entering new records that might alter the sum of calculation. Locking and unlocking each MEMBERS record as it is listed prevents the TOTAL DUE information from being modified by another user.

See Also


On the forum about Unlock

[@EOF@]...

Product: . Written by alembagheri tahmas 07/12/13 at 13:37:32

Hi there,I am trying to use an external MySQL DB in dataease. I have successfully create the ODBC link and added the DB to dataease. I can also access the DB from dataease. Now, just for testing purposes, I am trying to create a simple report b...

Product: DataEase for Windows 7.x. Written by George Washington 11/04/14 at 08:26:17

no se pude exportar ahora archivos a pdf, ni a excel o otros cosa mala. en verdad creo que hace faltaen las versiones anteriores me funcionaba mas o menos bien.&nbsp;le hace falta a los aplicativos que se desarrollan en Dataeasegr...

Product: DataEase 8 Reporter. Written by eduardo paez 02/05/14 at 14:40:11

Thanks. Anyway I'm trying to use this fuction but it seems to me that it doesn't work on 8.2. I tried also in a DQL.There's something wrong?<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAA9IAAAJ3CAYAAAB4NWk3AAAAAXNSR0IArs4...

Product: . Written by Marco Marchesi 15/02/16 at 14:50:46

[@EOF@]...

Product: Dataease [{8}]FIVE. Written by Chamil Rajindra 21/02/19 at 10:17:46

Thanks for the very good explanation!AS...

Product: . Written by afonso santos 28/10/19 at 00:50:14

I am pleased to see that the migration from Dos 4.53 is then sa 5.5 works. A really useful thing would be a compiler of SQL languages. Will you get there?Original Text:Mi compiaccio a vedere che la migrazione da Dos 4.53 è poi sa 5.5 funzio...

Product: . Written by Grossi Gioacchino 18/11/19 at 14:33:44

How can i delete a Style sheet?...

Product: Dataease [{8}]FIVE. Written by Rainer 22/03/21 at 11:13:10

I run W7 and since a few days&nbsp;Dataease 8.5 is not starting any more, do you have an idea? i installed it again but that did not help....

Product: Dataease [{8}]FIVE. Written by Rainer 08/06/21 at 14:12:40

[@EOF@]...

Product: . Written by Hiralal Rampul 01/12/21 at 17:47:10

On the blog about Unlock


dg3_HelpView