This shows you the differences between two versions of the page.
— |
set-session [2015/09/23 20:27] (current) |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== SET Session Option ====== | ||
+ | SET statement allows you to set various session-level options. | ||
+ | |||
+ | ===== CURRENT SCHEMA ===== | ||
+ | |||
+ | Changing the current schema (database): | ||
+ | |||
+ | |||
+ | **Syntax**: | ||
+ | |||
+ | <code language=sql> | ||
+ | SET [CURRENT] SCHEMA [=] schema_name; | ||
+ | | | ||
+ | SET CURRENT_SCHEMA [=] schema_name; | ||
+ | </code> | ||
+ | |||
+ | Note: | ||
+ | * //schema_name// is an identifier, string literal or expression. | ||
+ | * HPL/SQL converts this statement to USE //schema_name// statement in Hive. | ||
+ | |||
+ | **Example:** | ||
+ | |||
+ | <code language=sql> | ||
+ | SET CURRENT SCHEMA = default; | ||
+ | SET SCHEMA = 'default'; | ||
+ | SET SCHEMA 'def' || 'ault'; | ||
+ | </code> | ||
+ | |||
+ | **Compatibility:** IBM DB2 | ||
+ | |||
+ | **Version:** HPL/SQL 0.3.11 | ||
+ | |||
+ | **See also:** | ||
+ | * [[use|USE]] |