JBoss Community Archive (Read Only)

Teiid 8.12

SET Statement

Execution properties may also be set on the connection by using the SET statement. The SET statement is not yet a language feature of Teiid and is handled only in the JDBC client.

SET Syntax:

Syntax Rules:

The SET statement is most commonly used to control planning and execution.

Enabling Plan Debug
Statement s = connection.createStatement();
s.execute("SET SHOWPLAN DEBUG");
Statement s1 = connection.createStatement();
ResultSet rs = s1.executeQuery("select col from table");

ResultSet planRs = s1.exeuteQuery("SHOW PLAN");
String debugLog = planRs.getString("DEBUG_LOG");
Query Plan without executing the query
s.execute("SET NOEXEC ON");
s.execute("SET SHOWPLAN DEBUG");
e.execute("SET NOEXEC OFF");

The SET statement may also be used to control authorization. A SET SESSION AUTHORIZATION statement will perform a Reauthentication given the credentials currently set on the connection. The connection credentials may be changed by issuing a SET PASSWORD statement. A SET PASSWORD statement does not perform a reauthentication.

Changing Session Authorization
Statement s = connection.createStatement();
s.execute("SET PASSWORD 'someval'");
s.execute("SET SESSION AUTHORIZATION 'newuser'");
JBoss.org Content Archive (Read Only), exported from JBoss Community Documentation Editor at 2020-03-13 12:25:12 UTC, last content change 2015-01-22 15:07:29 UTC.