SET Examples
Example 1:
The following example illustrates the use of the set statement to create three tables with journaling enabled and one without:
set journaling
create withlog1 ( ... )
retrieve into withlog2 ( ... )
set nojournaling
create withlog3 ( ... ) with journaling
create nolog1 ( ... )
Example 2:
The following example creates a few tables with different structures:
retrieve into a ( ... ) /* heap */
set ret_into hash
retrieve into b (id = ... ) /* hash on key id */
retrieve into c (id = ... ) sort by id
/* heap, sorted on id */
set ret_into heap
retrieve into d (id = ... ) /* heap again */
Example 3:
The following example illustrates the setting of lockmode parameters for the session and for a specific table:
set lockmode session where level = page,
readlock = nolock, maxlocks = 50, timeout = 10
set lockmode on employee where level = table,
readlock = exclusive, maxlocks = session, timeout = 0
Example 4:
The following example resets your session default locking characteristics to the system defaults:
set lockmode session where level = system,
readlock = system, maxlocks = system, timeout = system
Last modified date: 04/03/2024