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

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


/*
* <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

  }

  final public StatementNode viewDefinition(Token beginToken) throws ParseException, StandardException {
        int                                     checkOptionType;
        ResultColumnList        resultColumns = null;
        ResultSetNode           queryExpression;
        TableName                       tableName;
        Token                           checkTok = null;
        Token                           endToken;
    jj_consume_token(VIEW);
    tableName = qualifiedName(Limits.MAX_IDENTIFIER_LENGTH);
    switch (jj_nt.kind) {
    case LEFT_PAREN:
      jj_consume_token(LEFT_PAREN);
      resultColumns = viewColumnList();
      jj_consume_token(RIGHT_PAREN);
      break;
    default:
      jj_la1[225] = jj_gen;
      ;
    }
    jj_consume_token(AS);
    queryExpression = queryExpression(null, NO_SET_OP);
                checkOptionType = ViewDescriptor.NO_CHECK_OPTION;
                endToken = getToken(0);
                /* Parameters not allowed in create view */
                HasNodeVisitor visitor = new HasNodeVisitor(ParameterNode.class);
                queryExpression.accept(visitor);
                if (visitor.hasNode())
                {
                        {if (true) throw StandardException.newException(SQLState.LANG_NO_PARAMS_IN_VIEWS);}
                }

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

  final public StatementNode bareCallStatement() throws ParseException, StandardException {
        ParameterNode           returnParam;

        ValueNode                       value;

        ResultSetNode           resultSetNode;
    switch (jj_nt.kind) {
    case CALL:
      jj_consume_token(CALL);
      value = primaryExpression(true);
                if (! (value instanceof JavaToSQLValueNode) ||
                        ! (((JavaToSQLValueNode) value).getJavaValueNode() instanceof MethodCallNode))
                {
                        {if (true) throw StandardException.newException(SQLState.LANG_INVALID_CALL_STATEMENT);}
                }

                StatementNode callStatement =
                                                                        (StatementNode) nodeFactory.getNode(
                                                                                                C_NodeTypes.CALL_STATEMENT_NODE,
                                                                                                value,
                                                                                                getContextManager());

                setUpAndLinkParameters();

                {if (true) return callStatement;}
      break;
    case QUESTION_MARK:
      returnParam = dynamicParameterSpecification();
                getCompilerContext().setReturnParameterFlag(); //bug4450

      jj_consume_token(EQUALS_OPERATOR);
      jj_consume_token(CALL);
      resultSetNode = rowValueConstructor(null);
                // validate that we have something that is an appropriate call statement
                ResultColumnList rcl = resultSetNode.getResultColumns();

                // we can have only 1 return value/column
                if (rcl == null || rcl.size() > 1)
                {
                        {if (true) throw StandardException.newException(SQLState.LANG_INVALID_CALL_STATEMENT);}
View Full Code Here

* However recursive descent parsers want recursion to be on the right, so this kind of associativity is unnatural
* for our parser. The queryExpression method must know whether it is being called as the right hand side of a
* set operator to produce a query tree with the correct associativity.
*/
  final public ResultSetNode queryExpression(ResultSetNode leftSide, int operatorType) throws ParseException, StandardException {
        ResultSetNode   term;
    term = nonJoinQueryTerm(leftSide, operatorType);
    switch (jj_nt.kind) {
    case EXCEPT:
    case UNION:
      term = unionOrExcept(term);
View Full Code Here

/*
* <A NAME="unionOrExcept">unionOrExcept</A>
*/
  final public ResultSetNode unionOrExcept(ResultSetNode term) throws ParseException, StandardException {
        ResultSetNode   expression;
        Token                   tok = null;
    switch (jj_nt.kind) {
    case UNION:
      jj_consume_token(UNION);
      switch (jj_nt.kind) {
View Full Code Here

* which is not the same as
*   t1 INTERSECT (t2 INTERSECT ALL t3)
* See the comment on queryExpression.
*/
  final public ResultSetNode nonJoinQueryTerm(ResultSetNode leftSide, int operatorType) throws ParseException, StandardException {
        ResultSetNode   term;
    term = nonJoinQueryPrimary();
    switch (jj_nt.kind) {
    case INTERSECT:
      term = intersect(term);
      break;
View Full Code Here

/*
* <A NAME="intersect">intersect</A>
*/
  final public ResultSetNode intersect(ResultSetNode term) throws ParseException, StandardException {
        ResultSetNode   expression;
        Token                   tok = null;
    jj_consume_token(INTERSECT);
    switch (jj_nt.kind) {
    case ALL:
    case DISTINCT:
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.