public static void WithArguments()
{
var body = new PlSqlBlockStatement();
body.Statements.Add(new AssignVariableStatement(SqlExpression.VariableReference("a"), SqlExpression.Constant(3)));
body.Statements.Add(new ReturnStatement(SqlExpression.VariableReference("a")));
var statement = new CreateFunctionStatement(ObjectName.Parse("SYS.func1"), PrimitiveTypes.Integer(), new[] {
new RoutineParameter("a", PrimitiveTypes.Integer()),
}, body);
var sql = statement.ToString();
var expected = new SqlStringBuilder();
expected.Append("CREATE FUNCTION SYS.func1(a INTEGER IN NOT NULL) ");
expected.AppendLine("RETURN INTEGER IS");
expected.AppendLine(" BEGIN");
expected.AppendLine(" :a := 3");
expected.AppendLine(" RETURN :a");
expected.Append(" END");
Assert.AreEqual(expected.ToString(), sql);
}