use of org.hsqldb_voltpatches.Session in project voltdb by VoltDB.
the class DatabaseInformationFull method SQL_SIZING.
Table SQL_SIZING() {
Table t = sysTables[SQL_SIZING];
if (t == null) {
t = createBlankTable(sysTableHsqlNames[SQL_SIZING]);
addColumn(t, "SIZING_ID", CARDINAL_NUMBER);
addColumn(t, "SIZING_NAME", CHARACTER_DATA);
addColumn(t, "SUPPORTED_VALUE", CARDINAL_NUMBER);
addColumn(t, "COMMENTS", CHARACTER_DATA);
HsqlName name = HsqlNameManager.newInfoSchemaObjectName(sysTableHsqlNames[SQL_SIZING].name, false, SchemaObject.INDEX);
t.createPrimaryKey(name, new int[] { 0 }, false);
return t;
}
PersistentStore store = database.persistentStoreCollection.getStore(t);
Session sys = database.sessionManager.newSysSession(SqlInvariants.INFORMATION_SCHEMA_HSQLNAME, session.getUser());
String sql = (String) statementMap.get("/*sql_sizing*/");
Result rs = sys.executeDirectStatement(sql);
t.insertSys(store, rs);
return t;
}
use of org.hsqldb_voltpatches.Session in project voltdb by VoltDB.
the class DatabaseInformationFull method CONSTRAINT_TABLE_USAGE.
/**
* The CONSTRAINT_TABLE_USAGE view has one row for each table identified by a
* <table name> simply contained in a <table reference>
* contained in the <search condition> of a check constraint,
* domain constraint, or assertion. It has one row for each table
* containing / referenced by each PRIMARY KEY, UNIQUE and FOREIGN KEY
* constraint<p>
*
* <b>Definition:</b> <p>
*
* <pre class="SqlCodeExample">
* CONSTRAINT_CATALOG VARCHAR
* CONSTRAINT_SCHEMA VARCHAR
* CONSTRAINT_NAME VARCHAR
* TABLE_CATALOG VARCHAR
* TABLE_SCHEMA VARCHAR
* TABLE_NAME VARCHAR
* </pre>
*
* <b>Description:</b> <p>
*
* <ol>
* <li> The values of CONSTRAINT_CATALOG, CONSTRAINT_SCHEMA, and
* CONSTRAINT_NAME are the catalog name, unqualified schema name,
* and qualified identifier, respectively, of the constraint being
* described. <p>
*
* <li> The values of TABLE_CATALOG, TABLE_SCHEMA, and TABLE_NAME are the
* catalog name, unqualified schema name, and qualified identifier,
* respectively, of a table identified by a <table name>
* simply contained in a <table reference> contained in the
* *lt;search condition> of the constraint being described, or
* its columns.
* </ol>
*
* @return Table
*/
Table CONSTRAINT_TABLE_USAGE() {
Table t = sysTables[CONSTRAINT_TABLE_USAGE];
if (t == null) {
t = createBlankTable(sysTableHsqlNames[CONSTRAINT_TABLE_USAGE]);
addColumn(t, "CONSTRAINT_CATALOG", SQL_IDENTIFIER);
addColumn(t, "CONSTRAINT_SCHEMA", SQL_IDENTIFIER);
// not null
addColumn(t, "CONSTRAINT_NAME", SQL_IDENTIFIER);
addColumn(t, "TABLE_CATALOG", SQL_IDENTIFIER);
addColumn(t, "TABLE_SCHEMA", SQL_IDENTIFIER);
// not null
addColumn(t, "TABLE_NAME", SQL_IDENTIFIER);
HsqlName name = HsqlNameManager.newInfoSchemaObjectName(sysTableHsqlNames[CONSTRAINT_TABLE_USAGE].name, false, SchemaObject.INDEX);
t.createPrimaryKey(name, new int[] { 0, 1, 2, 3, 4, 5 }, false);
return t;
}
PersistentStore store = database.persistentStoreCollection.getStore(t);
//
Session sys = database.sessionManager.newSysSession(SqlInvariants.INFORMATION_SCHEMA_HSQLNAME, session.getUser());
Result rs = sys.executeDirectStatement("select DISTINCT CONSTRAINT_CATALOG, CONSTRAINT_SCHEMA, " + "CONSTRAINT_NAME, TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME " + "from INFORMATION_SCHEMA.CONSTRAINT_COLUMN_USAGE");
t.insertSys(store, rs);
sys.close();
return t;
}
use of org.hsqldb_voltpatches.Session in project voltdb by VoltDB.
the class DatabaseInformationFull method SQL_PARTS.
Table SQL_PARTS() {
Table t = sysTables[SQL_PARTS];
if (t == null) {
t = createBlankTable(sysTableHsqlNames[SQL_PARTS]);
addColumn(t, "PART", CHARACTER_DATA);
addColumn(t, "NAME", CHARACTER_DATA);
addColumn(t, "IS_SUPPORTED", YES_OR_NO);
addColumn(t, "IS_VERIFIED_BY", CHARACTER_DATA);
addColumn(t, "COMMENTS", CHARACTER_DATA);
HsqlName name = HsqlNameManager.newInfoSchemaObjectName(sysTableHsqlNames[SQL_PARTS].name, false, SchemaObject.INDEX);
t.createPrimaryKey(name, new int[] { 0 }, false);
return t;
}
PersistentStore store = database.persistentStoreCollection.getStore(t);
Session sys = database.sessionManager.newSysSession(SqlInvariants.INFORMATION_SCHEMA_HSQLNAME, session.getUser());
String sql = (String) statementMap.get("/*sql_parts*/");
Result rs = sys.executeDirectStatement(sql);
t.insertSys(store, rs);
return t;
}
use of org.hsqldb_voltpatches.Session in project voltdb by VoltDB.
the class LobManager method setCharsForNewClob.
public Result setCharsForNewClob(long lobID, InputStream inputStream, long length) {
Session session = sysLobSession;
if (length == 0) {
return ResultLob.newLobSetResponse(lobID, 0);
}
Result result = setBytesIS(session, lobID, inputStream, length * 2);
if (result.isError()) {
return result;
}
return ResultLob.newLobSetResponse(lobID, 0);
}
Aggregations