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