Search in sources :

Example 1 with SQLServerParameter

use of com.alibaba.druid.sql.dialect.sqlserver.ast.stmt.SQLServerExecStatement.SQLServerParameter in project druid by alibaba.

the class SQLServerStatementParser method parseExecParameter.

/**
     * SQLServer parse Parameter statement support out type
     * @author zz [455910092@qq.com]
     */
public void parseExecParameter(Collection<SQLServerParameter> exprCol, SQLObject parent) {
    if (lexer.token() == Token.RPAREN || lexer.token() == Token.RBRACKET) {
        return;
    }
    if (lexer.token() == Token.EOF) {
        return;
    }
    SQLServerParameter param = new SQLServerParameter();
    SQLExpr expr = this.exprParser.expr();
    expr.setParent(parent);
    param.setExpr(expr);
    if (lexer.token() == Token.OUT) {
        param.setType(true);
        accept(Token.OUT);
    }
    exprCol.add(param);
    while (lexer.token() == Token.COMMA) {
        lexer.nextToken();
        param = new SQLServerParameter();
        expr = this.exprParser.expr();
        expr.setParent(parent);
        param.setExpr(expr);
        if (lexer.token() == Token.OUT) {
            param.setType(true);
            accept(Token.OUT);
        }
        exprCol.add(param);
    }
}
Also used : SQLServerParameter(com.alibaba.druid.sql.dialect.sqlserver.ast.stmt.SQLServerExecStatement.SQLServerParameter) SQLExpr(com.alibaba.druid.sql.ast.SQLExpr)

Aggregations

SQLExpr (com.alibaba.druid.sql.ast.SQLExpr)1 SQLServerParameter (com.alibaba.druid.sql.dialect.sqlserver.ast.stmt.SQLServerExecStatement.SQLServerParameter)1