Difference between revisions of "SET EXCLUSIVE"

From Recital Documentation Wiki
Jump to: navigation, search
(Example)
(Example)
Line 24: Line 24:
  
 
==Example==
 
==Example==
<pre>
+
<source>
 
// Close today’s payments
 
// Close today’s payments
 
procedure close_day  
 
procedure close_day  
Line 44: Line 44:
 
   set exclusive off
 
   set exclusive off
 
   set view to payments
 
   set view to payments
return</pre>
+
return</source>
  
 
==Products==
 
==Products==

Revision as of 11:32, 11 March 2009

SET EXCLUSIVE

Class

Environment


Purpose

Determines whether or not table and index files are opened shareable


Syntax

SET EXCLUSIVE ON | OFF | (<expL>)


See Also

USE


Description

If SET EXCLUSIVE is ON when a table and its associated index files are opened, then the table and index files cannot be by another user until they are closed. If SET EXCLUSIVE is OFF when a table and its associated index files are opened, then the table and index files are shareable by multiple users. File and record locking to control concurrent updates to the table and index files is automatically enforced if EXCLUSIVE was OFF when the table was opened. The commands MODIFY STRUCTURE, PACK, REINDEX, INDEX ON (tags) and ZAP are the only commands that require a table to be opened exclusively. By default, EXCLUSIVE is ON.


Example

// Close todayâs payments procedure close_day

 set exclusive on
 set view to accounts
 if used()
   select payments
   set dcache to reccount()
   set dcache on
   seek dtos(date())
   total on dtos(payment_date)+emp_no to (cdow(date));
   while payment_date = date()
   seek dtos(date())
   delete rest while payment_date = date()
   pack
 else
   dialog box "Cannot open payments exclusively."
 endif
 set exclusive off
 set view to payments

return

Products

Recital Database Server, Recital Mirage Server, Recital Terminal Developer