Difference between revisions of "SET EXCLUSIVE"
Barrymavin (Talk | contribs) (→Example) |
Yvonnemilne (Talk | contribs) |
||
(5 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
==Purpose== | ==Purpose== | ||
Determines whether or not table and index files are opened shareable | Determines whether or not table and index files are opened shareable | ||
Line 15: | Line 8: | ||
==See Also== | ==See Also== | ||
− | USE | + | [[INDEX]], [[MODIFY STRUCTURE]], [[PACK]], [[REINDEX]], [[SET MULTIUSER]], [[USE]], [[ZAP]] |
==Description== | ==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. | 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. | 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== | ==Example== | ||
− | < | + | <code lang="recital"> |
// Close today’s payments | // Close today’s payments | ||
procedure close_day | procedure close_day | ||
− | set exclusive on | + | |
− | + | set exclusive on | |
− | + | set view to accounts | |
+ | if used() | ||
select payments | select payments | ||
set dcache to reccount() | set dcache to reccount() | ||
Line 35: | Line 30: | ||
seek dtos(date()) | seek dtos(date()) | ||
total on dtos(payment_date)+emp_no to (cdow(date)); | total on dtos(payment_date)+emp_no to (cdow(date)); | ||
− | + | while payment_date = date() | |
seek dtos(date()) | seek dtos(date()) | ||
delete rest while payment_date = date() | delete rest while payment_date = date() | ||
pack | pack | ||
− | + | else | |
dialog box "Cannot open payments exclusively." | dialog box "Cannot open payments exclusively." | ||
− | + | endif | |
− | + | set exclusive off | |
− | + | set view to payments | |
− | return</ | + | |
+ | return</code> | ||
==Products== | ==Products== | ||
− | Recital | + | Recital, Recital Server, Recital Web |
[[Category:Documentation]] | [[Category:Documentation]] | ||
[[Category:Commands]] | [[Category:Commands]] | ||
− | [[Category:Set_Commands]] | + | [[Category:Set_Commands|EXCLUSIVE]] |
+ | [[Category:Environment]] | ||
+ | [[Category:Environment Set Commands]] |
Latest revision as of 15:19, 17 November 2009
Purpose
Determines whether or not table and index files are opened shareable
Syntax
SET EXCLUSIVE ON | OFF | (<expL>)
See Also
INDEX, MODIFY STRUCTURE, PACK, REINDEX, SET MULTIUSER, USE, ZAP
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, Recital Server, Recital Web