Search in sources :

Example 6 with ExpNode

use of com.teradata.jaqy.utils.exp.ExpNode in project jaqy by Teradata.

the class FilterCommand method execute.

@Override
public void execute(String[] args, boolean silent, JaqyInterpreter interpreter) throws Exception {
    SessionUtils.checkOpen(interpreter);
    String str = args[0].trim();
    if (str.length() == 0) {
        interpreter.error("missing predicate");
    }
    ExpNode exp = WhereParser.getExp(args[0]);
    interpreter.setPredicate(new ExpNodePredicate(exp));
}
Also used : ExpNodePredicate(com.teradata.jaqy.utils.ExpNodePredicate) ExpNode(com.teradata.jaqy.utils.exp.ExpNode)

Example 7 with ExpNode

use of com.teradata.jaqy.utils.exp.ExpNode in project jaqy by Teradata.

the class ProjectColumnList method bind.

public void bind(JaqyResultSet rs, JaqyInterpreter interpreter) throws SQLException {
    int numCols = m_columnList.size();
    ExpNode[] exps = new ExpNode[numCols];
    FullColumnInfo[] columnInfos = new FullColumnInfo[numCols];
    ResultSetMetaData rsmd = rs.getMetaData().getMetaData();
    JaqyHelper helper = rs.getHelper();
    for (int i = 0; i < numCols; ++i) {
        ProjectColumn column = m_columnList.get(i);
        int index = rs.findColumn(column.name);
        columnInfos[i] = ResultSetMetaDataUtils.getColumnInfo(rsmd, index, helper);
        columnInfos[i].name = column.asName;
        columnInfos[i].label = column.asName;
        ColumnNode exp = new ColumnNode(column.name);
        exp.bind(rs, null, interpreter);
        exps[i] = exp;
    }
    m_project = new ExpNodeProject(exps);
    m_meta = new JaqyResultSetMetaData(new InMemoryResultSetMetaData(columnInfos), DummyHelper.getInstance());
}
Also used : InMemoryResultSetMetaData(com.teradata.jaqy.resultset.InMemoryResultSetMetaData) ResultSetMetaData(java.sql.ResultSetMetaData) JaqyResultSetMetaData(com.teradata.jaqy.connection.JaqyResultSetMetaData) FullColumnInfo(com.teradata.jaqy.schema.FullColumnInfo) JaqyHelper(com.teradata.jaqy.interfaces.JaqyHelper) JaqyResultSetMetaData(com.teradata.jaqy.connection.JaqyResultSetMetaData) ColumnNode(com.teradata.jaqy.utils.exp.ColumnNode) ExpNode(com.teradata.jaqy.utils.exp.ExpNode) InMemoryResultSetMetaData(com.teradata.jaqy.resultset.InMemoryResultSetMetaData)

Aggregations

ExpNode (com.teradata.jaqy.utils.exp.ExpNode)7 VariableManager (com.teradata.jaqy.VariableManager)5 Globals (com.teradata.jaqy.Globals)4 JaqyInterpreter (com.teradata.jaqy.JaqyInterpreter)4 Test (org.junit.Test)4 JaqyResultSetMetaData (com.teradata.jaqy.connection.JaqyResultSetMetaData)1 JaqyHelper (com.teradata.jaqy.interfaces.JaqyHelper)1 InMemoryResultSetMetaData (com.teradata.jaqy.resultset.InMemoryResultSetMetaData)1 FullColumnInfo (com.teradata.jaqy.schema.FullColumnInfo)1 ExpNodePredicate (com.teradata.jaqy.utils.ExpNodePredicate)1 ColumnNode (com.teradata.jaqy.utils.exp.ColumnNode)1 ResultSetMetaData (java.sql.ResultSetMetaData)1