Search in sources :

Example 1 with PrepareProcedure

use of org.h2.command.ddl.PrepareProcedure in project h2database by h2database.

the class Parser method parsePrepare.

private Prepared parsePrepare() {
    if (readIf("COMMIT")) {
        TransactionCommand command = new TransactionCommand(session, CommandInterface.PREPARE_COMMIT);
        command.setTransactionName(readUniqueIdentifier());
        return command;
    }
    String procedureName = readAliasIdentifier();
    if (readIf("(")) {
        ArrayList<Column> list = New.arrayList();
        for (int i = 0; ; i++) {
            Column column = parseColumnForTable("C" + i, true);
            list.add(column);
            if (readIf(")")) {
                break;
            }
            read(",");
        }
    }
    read("AS");
    Prepared prep = parsePrepared();
    PrepareProcedure command = new PrepareProcedure(session);
    command.setProcedureName(procedureName);
    command.setPrepared(prep);
    return command;
}
Also used : AlterTableRenameColumn(org.h2.command.ddl.AlterTableRenameColumn) AlterTableAlterColumn(org.h2.command.ddl.AlterTableAlterColumn) Column(org.h2.table.Column) ExpressionColumn(org.h2.expression.ExpressionColumn) IndexColumn(org.h2.table.IndexColumn) PrepareProcedure(org.h2.command.ddl.PrepareProcedure) TransactionCommand(org.h2.command.dml.TransactionCommand) ValueString(org.h2.value.ValueString) AlterTableRenameConstraint(org.h2.command.ddl.AlterTableRenameConstraint) AlterTableAddConstraint(org.h2.command.ddl.AlterTableAddConstraint) AlterTableDropConstraint(org.h2.command.ddl.AlterTableDropConstraint)

Aggregations

AlterTableAddConstraint (org.h2.command.ddl.AlterTableAddConstraint)1 AlterTableAlterColumn (org.h2.command.ddl.AlterTableAlterColumn)1 AlterTableDropConstraint (org.h2.command.ddl.AlterTableDropConstraint)1 AlterTableRenameColumn (org.h2.command.ddl.AlterTableRenameColumn)1 AlterTableRenameConstraint (org.h2.command.ddl.AlterTableRenameConstraint)1 PrepareProcedure (org.h2.command.ddl.PrepareProcedure)1 TransactionCommand (org.h2.command.dml.TransactionCommand)1 ExpressionColumn (org.h2.expression.ExpressionColumn)1 Column (org.h2.table.Column)1 IndexColumn (org.h2.table.IndexColumn)1 ValueString (org.h2.value.ValueString)1