public void setCurrentSchema(Schema schema) { this.currentSchemaName = schema.getName(); }
@Override public String getSchemaName() { return table.getSchema().getName(); }
@Override public String getSchemaName() { Table table = column.getTable(); return table == null ? null : table.getSchema().getName(); }
/** * Check that this user does not own any schema. An exception is thrown if * he owns one or more schemas. * * @throws DbException if this user owns a schema */ public void checkOwnsNoSchemas() { for (Schema s : database.getAllSchemas()) { if (this == s.getOwner()) { throw DbException.get(ErrorCode.CANNOT_DROP_2, getName(), s.getName()); } } }
String schemaName = getSchema().getName(); paramValues.add(ValueString.get(tableName)); if (readIf("FROM")) {
private AlterSchemaRename parseAlterSchema() { String schemaName = readIdentifierWithSchema(); Schema old = getSchema(); AlterSchemaRename command = new AlterSchemaRename(session); command.setOldSchema(getSchema(schemaName)); read("RENAME"); read("TO"); String newName = readIdentifierWithSchema(old.getName()); checkSchema(old); command.setNewName(newName); return command; }
private AlterIndexRename parseAlterIndex() { String indexName = readIdentifierWithSchema(); Schema old = getSchema(); AlterIndexRename command = new AlterIndexRename(session); command.setOldIndex(getSchema().getIndex(indexName)); read("RENAME"); read("TO"); String newName = readIdentifierWithSchema(old.getName()); checkSchema(old); command.setNewName(newName); return command; }
.getName())) { throw DbException.get(ErrorCode.SCHEMA_NOT_FOUND_1, schema);
identifier(table.getSchema().getName()), identifier(table.getSchema().getName()), identifier(table.getSchema().getName()), identifier(s.getSchema().getName()), identifier(schema.getName()), schema.getName()) ? "TRUE" : "FALSE", identifier(table.getSchema().getName()), identifier(table.getSchema().getName()), identifier(table.getSchema().getName()), identifier(table.getSchema().getName()),
private Expression readWildcardOrSequenceValue(String schema, String objectName) { if (readIf("*")) { return new Wildcard(schema, objectName); } if (schema == null) { schema = session.getCurrentSchemaName(); } if (readIf("NEXTVAL")) { Sequence sequence = findSequence(schema, objectName); if (sequence != null) { return new SequenceValue(sequence); } } else if (readIf("CURRVAL")) { Sequence sequence = findSequence(schema, objectName); if (sequence != null) { Function function = Function.getFunction(database, "CURRVAL"); function.setParameter(0, ValueExpression.get(ValueString .get(sequence.getSchema().getName()))); function.setParameter(1, ValueExpression.get(ValueString .get(sequence.getName()))); function.doneWithParameters(); return function; } } return null; }
private void parseReferences(AlterTableAddConstraint command, Schema schema, String tableName) { if (readIf("(")) { command.setRefTableName(schema, tableName); command.setRefIndexColumns(parseIndexColumnList()); } else { String refTableName = readIdentifierWithSchema(schema.getName()); command.setRefTableName(getSchema(), refTableName); if (readIf("(")) { command.setRefIndexColumns(parseIndexColumnList()); } } if (readIf("INDEX")) { String indexName = readIdentifierWithSchema(); command.setRefIndex(getSchema().findIndex(session, indexName)); } while (readIf("ON")) { if (readIf("DELETE")) { command.setDeleteAction(parseAction()); } else { read("UPDATE"); command.setUpdateAction(parseAction()); } } if (readIf("NOT")) { read("DEFERRABLE"); } else { readIf("DEFERRABLE"); } }
read("TO"); String newName = readIdentifierWithSchema(table.getSchema() .getName()); checkSchema(table.getSchema()); AlterTableRename command = new AlterTableRename(session, boolean ifExists = readIfExists(false); String constraintName = readIdentifierWithSchema(table .getSchema().getName()); ifExists = readIfExists(ifExists); checkSchema(table.getSchema()); .getSchema().getName()); checkSchema(table.getSchema()); AlterTableDropConstraint command = new AlterTableDropConstraint(
if (readIf("CONSTRAINT")) { ifNotExists = readIfNotExists(); constraintName = readIdentifierWithSchema(schema.getName()); checkSchema(schema); comment = readCommentIf();