@Override public int update() { Table table = getSchema().resolveTableOrView(session, tableName); if (table == null) { if (ifTableExists) { return 0; } throw DbException.get(ErrorCode.TABLE_OR_VIEW_NOT_FOUND_1, tableName); } session.getUser().checkRight(table, Right.ALL); table.lock(session, true, true); switch (type) { case CommandInterface.ALTER_TABLE_SET_REFERENTIAL_INTEGRITY: table.setCheckForeignKeyConstraints(session, value, value ? checkExisting : false); break; default: DbException.throwInternalError("type="+type); } return 0; }
int type = CommandInterface.ALTER_TABLE_SET_REFERENTIAL_INTEGRITY; boolean value = readBooleanSetting(); AlterTableSet command = new AlterTableSet(session, schema, type, value); command.setTableName(tableName); command.setIfTableExists(ifTableExists); if (readIf("CHECK")) { command.setCheckExisting(true); } else if (readIf("NOCHECK")) { command.setCheckExisting(false);
type = AlterTableSet.REFERENTIAL_INTEGRITY_FALSE; AlterTableSet command = new AlterTableSet(session, table.getSchema(), type); command.setTableName(table.getName()); if (readIf("CHECK")) { command.setCheckExisting(true); } else if (readIf("NOCHECK")) { command.setCheckExisting(false);
int type = CommandInterface.ALTER_TABLE_SET_REFERENTIAL_INTEGRITY; boolean value = readBooleanSetting(); AlterTableSet command = new AlterTableSet(session, schema, type, value); command.setTableName(tableName); command.setIfTableExists(ifTableExists); if (readIf("CHECK")) { command.setCheckExisting(true); } else if (readIf("NOCHECK")) { command.setCheckExisting(false);
int type = CommandInterface.ALTER_TABLE_SET_REFERENTIAL_INTEGRITY; boolean value = readBooleanSetting(); AlterTableSet command = new AlterTableSet(session, schema, type, value); command.setTableName(tableName); command.setIfTableExists(ifTableExists); if (readIf("CHECK")) { command.setCheckExisting(true); } else if (readIf("NOCHECK")) { command.setCheckExisting(false);
public int update() throws SQLException { Table table = getSchema().getTableOrView(session, tableName); session.getUser().checkRight(table, Right.ALL); table.lock(session, true, true); switch(type) { case REFERENTIAL_INTEGRITY_TRUE: table.setCheckForeignKeyConstraints(session, true, checkExisting); break; case REFERENTIAL_INTEGRITY_FALSE: table.setCheckForeignKeyConstraints(session, false, false); break; default: throw Message.getInternalError("type="+type); } return 0; }
@Override public int update() { Table table = getSchema().findTableOrView(session, tableName); if (table == null) { if (ifTableExists) { return 0; } throw DbException.get(ErrorCode.TABLE_OR_VIEW_NOT_FOUND_1, tableName); } session.getUser().checkRight(table, Right.ALL); table.lock(session, true, true); switch (type) { case CommandInterface.ALTER_TABLE_SET_REFERENTIAL_INTEGRITY: table.setCheckForeignKeyConstraints(session, value, value ? checkExisting : false); break; default: DbException.throwInternalError("type="+type); } return 0; }
@Override public int update() { Table table = getSchema().findTableOrView(session, tableName); if (table == null) { if (ifTableExists) { return 0; } throw DbException.get(ErrorCode.TABLE_OR_VIEW_NOT_FOUND_1, tableName); } session.getUser().checkRight(table, Right.ALL); table.lock(session, true, true); switch (type) { case CommandInterface.ALTER_TABLE_SET_REFERENTIAL_INTEGRITY: table.setCheckForeignKeyConstraints(session, value, value ? checkExisting : false); break; default: DbException.throwInternalError("type="+type); } return 0; }