Examples—Set Statement
The following are set statement examples:
1. Create tables "withlog1", "withlog2", and "withlog3" with journal logging enabled and "nolog" without.
set journaling;
create table withlog1 ( ... );
create table withlog2 ( ... );
set nojournaling;
create table withlog3 ( ... ) with journaling;
create table nolog1 ( ... );
2. Create tables "a", "b", and "d" with different structures.
create table a as ...;/* HEAP - the default */
set result_structure hash hash;
create table b as select id ...;/* HASH on 'id' */
set result_structure heap;
create table d as select id ...;/* HEAP again */
3. Set lockmode parameters for the current session. Tables accessed after executing this statement are governed by these locking behavior characteristics.
set lockmode session where level = page,
readlock = nolock,
maxlocks = 50, timeout = 10;
4. Set the lockmode parameters explicitly for table employee.
set lockmode on employee
where level = table, readlock = exclusive,
maxlocks = session, timeout = 0;
5. Reset your session default locking characteristics to the system defaults.
set lockmode session where level = system,
readlock = system,
maxlocks = system, timeout = system;