Package org.apache.derby.impl.sql.compile

Examples of org.apache.derby.impl.sql.compile.ResultSetNode


/*
* <A NAME="simpleTable">simpleTable</A>
*/
  final public ResultSetNode simpleTable() throws ParseException, StandardException {
        ResultSetNode   resultSetNode;
    switch (jj_nt.kind) {
    case SELECT:
      resultSetNode = querySpecification();
                {if (true) return resultSetNode;}
      break;
View Full Code Here


/*
* <A NAME="insertColumnsAndSource">insertColumnsAndSource</A>
*/
  final public StatementNode insertColumnsAndSource(QueryTreeNode targetTable) throws ParseException, StandardException {
        Properties                      targetProperties = null;
        ResultSetNode   queryExpression;
        ResultColumnList        columnList = null;
    if (getToken(1).kind == LEFT_PAREN && ! subqueryFollows()) {
      jj_consume_token(LEFT_PAREN);
      columnList = insertColumnList();
      jj_consume_token(RIGHT_PAREN);
View Full Code Here

*/
  final public ResultSetNode rowValueConstructor(ResultSetNode leftRSN) throws ParseException, StandardException {
        ResultColumnList        resultColumns = (ResultColumnList) nodeFactory.getNode(
                                                                                                C_NodeTypes.RESULT_COLUMN_LIST,
                                                                                                getContextManager());
        ResultSetNode           newRSN;
    if (rowValueConstructorListFollows()) {
      jj_consume_token(LEFT_PAREN);
      rowValueConstructorList(resultColumns);
      jj_consume_token(RIGHT_PAREN);
                /* If leftRSN is null, simply return the newRSN, else generate and
     * return a UNION ALL above the 2 RSNs, after verifying that the size()
     * of both RSNs RCLs is the same.
     */
                newRSN = (ResultSetNode) nodeFactory.getNode(
                                                                C_NodeTypes.ROW_RESULT_SET_NODE,
                                                                resultColumns,
                                                                null,
                                                                getContextManager());
                if (leftRSN != null)
                {
                        if (leftRSN.getResultColumns().size() !=
                                newRSN.getResultColumns().size())
                        {
                                {if (true) throw StandardException.newException(SQLState.LANG_ROW_VALUE_CONSTRUCTOR_UNMATCHED_COLUMNS);}
                        }

                        newRSN = (ResultSetNode) nodeFactory.getNode(
                                                                        C_NodeTypes.UNION_NODE,
                                                                        leftRSN,
                                                                        newRSN,
                                                                        Boolean.TRUE,
                                                                        Boolean.TRUE,
                                                                        null,
                                                                        getContextManager());
                }
                {if (true) return newRSN;}
    } else {
      rowValueConstructorElement(resultColumns);
                /* If leftRSN is null, simply return the newRSN, else generate and
     * return a UNION ALL above the 2 RSNs, after verifying that the size()
     * of both RSNs RCLs is the same.
     */
                newRSN = (ResultSetNode) nodeFactory.getNode(
                                                                C_NodeTypes.ROW_RESULT_SET_NODE,
                                                                resultColumns,
                                                                null,
                                                                getContextManager());
                if (leftRSN != null)
                {
                        if (leftRSN.getResultColumns().size() !=
                                newRSN.getResultColumns().size())
                        {
                                {if (true) throw StandardException.newException(SQLState.LANG_ROW_VALUE_CONSTRUCTOR_UNMATCHED_COLUMNS);}
                        }

                        newRSN = (ResultSetNode) nodeFactory.getNode(
View Full Code Here

/*
* <A NAME="subquery">subquery</A>
*/
  final public SubqueryNode subquery(int subqueryType, ValueNode leftOperand) throws ParseException, StandardException {
        ResultSetNode   queryExpression;
        SubqueryNode    subqueryNode;
    queryExpression = queryExpression(null, NO_SET_OP);
                subqueryNode = (SubqueryNode) nodeFactory.getNode(
                                                                                C_NodeTypes.SUBQUERY_NODE,
                                                                                queryExpression,
View Full Code Here

        FromTable                       fromTable;
        TableOperatorNode       joinTable = null;
        FromTable                       tableReference;
        Object[]                        optionalTableClauses = new Object[OPTIONAL_TABLE_CLAUSES_SIZE];
        Properties                      tableProperties = null;
        ResultSetNode           derivedTable;
    if (jj_2_55(1)) {
      if (newInvocationFollows(1)) {
        javaToSQLNode = newInvocation();
      } else {
        switch (jj_nt.kind) {
View Full Code Here

    throw new Error("Missing return statement in function");
  }

  final public TableOperatorNode qualifiedJoin(ResultSetNode leftRSN, boolean nestedInParens) throws ParseException, StandardException {
        int                                     joinType = JoinNode.INNERJOIN;
        ResultSetNode           rightRSN;
        TableOperatorNode       ton = null;
        Object[]                        onOrUsingClause = null;
        ResultColumnList        usingClause = null;
        ValueNode                       onClause;
    switch (jj_nt.kind) {
View Full Code Here

/*
* <A NAME="tableValueConstructor">tableValueConstructor</A>
*/
  final public ResultSetNode tableValueConstructor() throws ParseException, StandardException {
        ResultSetNode   resultSetNode;
    jj_consume_token(VALUES);
    resultSetNode = tableValueConstructorList();
                {if (true) return resultSetNode;}
    throw new Error("Missing return statement in function");
  }
View Full Code Here

/*
* <A NAME="tableValueConstructorList">tableValueConstructorList</A>
*/
  final public ResultSetNode tableValueConstructorList() throws ParseException, StandardException {
        ResultSetNode   resultSetNode;
    resultSetNode = rowValueConstructor(null);
    label_32:
    while (true) {
      switch (jj_nt.kind) {
      case COMMA:
View Full Code Here

        char                            lockGranularity = TableDescriptor.DEFAULT_LOCK_GRANULARITY;
        Properties                      properties = null;
        TableName                       tableName;
        TableElementList        tableElementList;
        ResultColumnList        resultColumns = null;
        ResultSetNode           queryExpression;
        boolean                         withData = true;
    jj_consume_token(TABLE);
    tableName = qualifiedName(Limits.MAX_IDENTIFIER_LENGTH);
    if (getToken(1).kind == LEFT_PAREN &&
                               getToken(3).kind != COMMA &&
                               getToken(3).kind != RIGHT_PAREN) {
      tableElementList = tableElementList();
      switch (jj_nt.kind) {
      case DERBYDASHPROPERTIES:
        properties = propertyList(false);
        jj_consume_token(CHECK_PROPERTIES);
        break;
      default:
        jj_la1[209] = jj_gen;
        ;
      }
                                {if (true) return (StatementNode) nodeFactory.getNode(
                                                                                C_NodeTypes.CREATE_TABLE_NODE,
                                                                                tableName,
                                                                                tableElementList,
                                                                                properties,
                                                                                new Character(lockGranularity),
                                                                                getContextManager());}
    } else {
      switch (jj_nt.kind) {
      case AS:
      case LEFT_PAREN:
        switch (jj_nt.kind) {
        case LEFT_PAREN:
          jj_consume_token(LEFT_PAREN);
          resultColumns = tableColumnList();
          jj_consume_token(RIGHT_PAREN);
          break;
        default:
          jj_la1[210] = jj_gen;
          ;
        }
        jj_consume_token(AS);
        queryExpression = queryExpression(null, NO_SET_OP);
        jj_consume_token(WITH);
        switch (jj_nt.kind) {
        case NO:
          jj_consume_token(NO);
                                        withData = false;
          break;
        default:
          jj_la1[211] = jj_gen;
          ;
        }
        jj_consume_token(DATA);
                                // Raise error if WITH DATA is specified
                                // (until it is implemented)
                                if (withData) {
                                        {if (true) throw StandardException.newException(
                                                SQLState.NOT_IMPLEMENTED, "WITH DATA");}
                                }
                                /* Parameters not allowed in create table */
                                HasNodeVisitor visitor =
                                        new HasNodeVisitor(ParameterNode.class);
                                queryExpression.accept(visitor);
                                if (visitor.hasNode())
                                {
                                        {if (true) throw StandardException.newException(
                                                SQLState.LANG_NO_PARAMS_IN_TABLES);}
                                }
View Full Code Here

*  is also handled like a cursor) and the preparable
*  multiple row select statement, which allows not only
*  an order by clause but also a for update clause.
*/
  final public CursorNode preparableSelectStatement(boolean checkParams) throws ParseException, StandardException {
        ResultSetNode     queryExpression;
        Vector  updateColumns = new Vector();
        int               forUpdateState = CursorNode.UNSPECIFIED;
        int                               isolationLevel = ExecutionContext.UNSPECIFIED_ISOLATION_LEVEL;
        CursorNode                retval;
        OrderByList orderCols = null;
View Full Code Here

TOP

Related Classes of org.apache.derby.impl.sql.compile.ResultSetNode

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.