private AlterSequence parseAlterSequence() { boolean ifExists = readIfExists(false); String sequenceName = readIdentifierWithSchema(); AlterSequence command = new AlterSequence(session, getSchema()); command.setSequenceName(sequenceName); command.setIfExists(ifExists); while (true) { if (readIf("RESTART")) { read("WITH"); command.setStartWith(readExpression()); } else if (readIf("INCREMENT")) { read("BY"); command.setIncrement(readExpression()); } else if (readIf("MINVALUE")) { command.setMinValue(readExpression()); } else if (readIf("NOMINVALUE")) { command.setMinValue(null); } else if (readIf("MAXVALUE")) { command.setMaxValue(readExpression()); } else if (readIf("NOMAXVALUE")) { command.setMaxValue(null); } else if (readIf("CYCLE")) { command.setCycle(true); } else if (readIf("NOCYCLE")) { command.setCycle(false); } else if (readIf("NO")) { if (readIf("MINVALUE")) { command.setMinValue(null); } else if (readIf("MAXVALUE")) { command.setMaxValue(null);
Database db = session.getDatabase(); if (sequence == null) { sequence = getSchema().findSequence(sequenceName); if (sequence == null) { if (!ifExists) { Long startValue = getLong(start); Long min = getLong(minValue); Long max = getLong(maxValue); Long inc = getLong(increment); sequence.modify(startValue, min, max, inc);
readIf("WITH"); Expression start = readExpression(); AlterSequence command = new AlterSequence(session, schema); command.setColumn(column); command.setStartWith(start); return commandIfTableExists(schema, tableName, ifTableExists, command); } else if (readIf("SELECTIVITY")) {
private AlterSequence parseAlterSequence() throws SQLException { String sequenceName = readIdentifierWithSchema(); Sequence sequence = getSchema().getSequence(sequenceName); AlterSequence command = new AlterSequence(session, sequence.getSchema()); command.setSequence(sequence); if (readIf("RESTART")) { read("WITH"); command.setStartWith(readExpression()); } if (readIf("INCREMENT")) { read("BY"); command.setIncrement(readExpression()); } return command; }
readIf("WITH"); Expression start = readExpression(); AlterSequence command = new AlterSequence(session, table.getSchema()); command.setColumn(column); command.setStartWith(start); return command; } else if (readIf("SELECTIVITY")) {
private AlterSequence parseAlterSequence() { boolean ifExists = readIfExists(false); String sequenceName = readIdentifierWithSchema(); AlterSequence command = new AlterSequence(session, getSchema()); command.setSequenceName(sequenceName); command.setIfExists(ifExists); while (true) { if (readIf("RESTART")) { read("WITH"); command.setStartWith(readExpression()); } else if (readIf("INCREMENT")) { read("BY"); command.setIncrement(readExpression()); } else if (readIf("MINVALUE")) { command.setMinValue(readExpression()); } else if (readIf("NOMINVALUE")) { command.setMinValue(null); } else if (readIf("MAXVALUE")) { command.setMaxValue(readExpression()); } else if (readIf("NOMAXVALUE")) { command.setMaxValue(null); } else if (readIf("CYCLE")) { command.setCycle(true); } else if (readIf("NOCYCLE")) { command.setCycle(false); } else if (readIf("NO")) { if (readIf("MINVALUE")) { command.setMinValue(null); } else if (readIf("MAXVALUE")) { command.setMaxValue(null);
readIf("WITH"); Expression start = readExpression(); AlterSequence command = new AlterSequence(session, schema); command.setColumn(column); command.setStartWith(start); return commandIfTableExists(schema, tableName, ifTableExists, command); } else if (readIf("SELECTIVITY")) {
Database db = session.getDatabase(); if (sequence == null) { sequence = getSchema().findSequence(sequenceName); if (sequence == null) { if (!ifExists) { Long startValue = getLong(start); Long min = getLong(minValue); Long max = getLong(maxValue); Long inc = getLong(increment); sequence.modify(startValue, min, max, inc);
private AlterSequence parseAlterSequence() { boolean ifExists = readIfExists(false); String sequenceName = readIdentifierWithSchema(); AlterSequence command = new AlterSequence(session, getSchema()); command.setSequenceName(sequenceName); command.setIfExists(ifExists); while (true) { if (readIf("RESTART")) { read("WITH"); command.setStartWith(readExpression()); } else if (readIf("INCREMENT")) { read("BY"); command.setIncrement(readExpression()); } else if (readIf("MINVALUE")) { command.setMinValue(readExpression()); } else if (readIf("NOMINVALUE")) { command.setMinValue(null); } else if (readIf("MAXVALUE")) { command.setMaxValue(readExpression()); } else if (readIf("NOMAXVALUE")) { command.setMaxValue(null); } else if (readIf("CYCLE")) { command.setCycle(true); } else if (readIf("NOCYCLE")) { command.setCycle(false); } else if (readIf("NO")) { if (readIf("MINVALUE")) { command.setMinValue(null); } else if (readIf("MAXVALUE")) { command.setMaxValue(null);
readIf("WITH"); Expression start = readExpression(); AlterSequence command = new AlterSequence(session, schema); command.setColumn(column); command.setStartWith(start); return commandIfTableExists(schema, tableName, ifTableExists, command); } else if (readIf("SELECTIVITY")) {
Database db = session.getDatabase(); if (sequence == null) { sequence = getSchema().findSequence(sequenceName); if (sequence == null) { if (!ifExists) { Long startValue = getLong(start); Long min = getLong(minValue); Long max = getLong(maxValue); Long inc = getLong(increment); sequence.modify(startValue, min, max, inc);