seqNode.getSequenceName().getSchemaName() :
rulesContext.getDefaultSchemaName();
// Extract the (potential) schema name as the first parameter
TInstance schemaType = typesTranslator.typeForString(schema);
params.add(new ConstantExpression(
new TPreptimeValue(new Value(schemaType, schema))));
// Extract the schema name as the second parameter
String sequence = seqNode.getSequenceName().getTableName();
TInstance sequenceType = typesTranslator.typeForString(sequence);
params.add(new ConstantExpression(
new TPreptimeValue(new Value(sequenceType, sequence))));
return new FunctionExpression ("nextval", params,
sqlType, valueNode, type);
}
else if (valueNode instanceof CurrentSequenceNode) {
CurrentSequenceNode seqNode = (CurrentSequenceNode)valueNode;
List<ExpressionNode> params = new ArrayList<>(2);
String schema = seqNode.getSequenceName().hasSchema() ?
seqNode.getSequenceName().getSchemaName() :
rulesContext.getDefaultSchemaName();
// Extract the (potential) schema name as the first parameter
TInstance schemaType = typesTranslator.typeForString(schema);
params.add(new ConstantExpression(
new TPreptimeValue(new Value(schemaType, schema))));
// Extract the schema name as the second parameter
String sequence = seqNode.getSequenceName().getTableName();
TInstance sequenceType = typesTranslator.typeForString(sequence);
params.add(new ConstantExpression(
new TPreptimeValue(new Value(sequenceType, sequence))));
return new FunctionExpression ("currval", params,
sqlType, valueNode, type);
}
else if (valueNode instanceof DefaultNode) {