001package gudusoft.gsqlparser.stmt.db2;
002
003import gudusoft.gsqlparser.*;
004import gudusoft.gsqlparser.nodes.TObjectName;
005import gudusoft.gsqlparser.nodes.TObjectNameList;
006import gudusoft.gsqlparser.nodes.TFetchSqlNode;
007import gudusoft.gsqlparser.nodes.TParseTreeVisitor;
008
009public class TDb2FetchCursorStmt extends TCustomDb2Stmt {
010     public TDb2FetchCursorStmt (EDbVendor dbvendor){
011        super(dbvendor);
012        sqlstatementtype = ESqlStatementType.sstdb2fetchcursorstmt ;
013        }
014
015    void buildsql() {
016    }
017
018    void clear() {
019    }
020
021    String getasprettytext() {
022        return "";
023    }
024
025    void iterate(TVisitorAbs pvisitor) {
026    }
027
028    private TObjectName cursorName = null;
029
030    public TObjectName getCursorName() {
031        return cursorName;
032    }
033
034    public TObjectNameList getVariableNames() {
035        return variableNames;
036    }
037
038    private TObjectNameList variableNames = null;
039
040     public int doParseStatement(TCustomSqlStatement psql) {
041        if (rootNode == null) return -1;
042         TFetchSqlNode node = (TFetchSqlNode)rootNode;
043
044        super.doParseStatement(psql);
045         this.cursorName = node.getCursorName();
046         this.variableNames = node.getVariableNames();
047       return 0;
048    }
049
050    public void accept(TParseTreeVisitor v){
051        v.preVisit(this);
052        v.postVisit(this);
053    }
054
055    public void acceptChildren(TParseTreeVisitor v){
056        v.preVisit(this);
057        v.postVisit(this);
058    }
059
060    public void setCursorName(TObjectName cursorName) {
061        this.cursorName = cursorName;
062    }
063
064    public void setVariableNames(TObjectNameList variableNames) {
065        this.variableNames = variableNames;
066    }
067}