}
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;