Previous Topic

Next Topic

Examples: Set

The following are Set statement examples:

  1. Create three tables with journal logging enabled and one without.

    set journaling;
    create table withlog1 ( ... );
    create table withlog2 ( ... );
    set nojournaling;
    create table withlog3 ( ... ) with journaling;
    create nolog1 ( ... );

  2. Create a few tables with different structures.

    create table a as ...;/* heap */
    set result_structure 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 a particular table.

    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;

  6. Switch sessions in a multi-session application.

    set session connection personnel;

  7. Set the session description to 'Payroll App: Generating invoices'.

    set session
        with description = 'payroll app: generating invoices';

  8. Set the session priority to 5 below the normal base priority.

    set session with priority = -5

  9. Restore the initial session priority.

    set session with priority = initial;

  10. Changes the session role to clerk.

    set role clerk with password='clerkpassword';


© 2007 Ingres Corporation. All rights reserved.