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

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


* <A NAME="preparableDeleteStatement">preparableDeleteStatement</A>
*
*  This may be a search or positioned delete statement.
*/
  final public QueryTreeNode preparableDeleteStatement() throws ParseException, StandardException {
        QueryTreeNode qtn;
    jj_consume_token(DELETE);
    qtn = deleteBody();
                {if (true) return qtn;}
    throw new Error("Missing return statement in function");
  }
View Full Code Here


        JavaToSQLValueNode      javaToSQLNode = null;
        String                          correlationName = null;
        TableName  tableName = null;
        ValueNode  whereClause = null;
        FromTable  fromTable = null;
        QueryTreeNode retval;
        Properties targetProperties = null;
        Token      whereToken = null;
    if (fromNewInvocationFollows()) {
      jj_consume_token(FROM);
      javaToSQLNode = newInvocation();
View Full Code Here

/*
* <A NAME="insertStatement">insertStatement</A>
*/
  final public QueryTreeNode insertStatement() throws ParseException, StandardException {
        QueryTreeNode   insertNode;
        QueryTreeNode   targetTable;
    jj_consume_token(INSERT);
    jj_consume_token(INTO);
    targetTable = targetTable();
    insertNode = insertColumnsAndSource(targetTable);
                setUpAndLinkParameters();
View Full Code Here

/*
* <A NAME="preparableUpdateStatement">preparableUpdateStatement</A>
*/
  final public QueryTreeNode preparableUpdateStatement() throws ParseException, StandardException {
        QueryTreeNode qtn;
    jj_consume_token(UPDATE);
    qtn = updateBody();
                {if (true) return qtn;}
    throw new Error("Missing return statement in function");
  }
View Full Code Here

/*
* <A NAME="callStatement">callStatement</A>
*/
  final public QueryTreeNode callStatement() throws ParseException, StandardException {
        QueryTreeNode retval;
    switch (jj_nt.kind) {
    case CALL:
    case QUESTION_MARK:
      retval = bareCallStatement();
      break;
View Full Code Here

                        ! (((JavaToSQLValueNode) value).getJavaValueNode() instanceof MethodCallNode))
                {
                        {if (true) throw StandardException.newException(SQLState.LANG_INVALID_CALL_STATEMENT);}
                }

                QueryTreeNode callStatement =
                                                                        (QueryTreeNode) 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);}
                }

                // we must have a method call node
                value = ((ResultColumn) rcl.elementAt(0)).getExpression();
                if (! (value instanceof JavaToSQLValueNode) ||
                        ! (((JavaToSQLValueNode) value).getJavaValueNode() instanceof MethodCallNode))
                {
                        {if (true) throw StandardException.newException(SQLState.LANG_INVALID_CALL_STATEMENT);}
                }

                // wrap the row result set in a cursor node
                QueryTreeNode cursorNode =
                                        (QueryTreeNode) nodeFactory.getNode(
                                                C_NodeTypes.CURSOR_NODE,
                                                "SELECT",
                                                resultSetNode,
                                                null,
View Full Code Here

/*
* <A NAME="newInvocation">newInvocation</A>
*/
  final public JavaToSQLValueNode newInvocation() throws ParseException, StandardException {
        QueryTreeNode   newNode;
        Vector  parameterList = new Vector();
        String  javaClassName;
    jj_consume_token(NEW);
    javaClassName = javaClassName();
    methodCallParameterList(parameterList);
View Full Code Here

        Token                           checkTok = null;
        Token                           endToken;
        int                                     actionBegin;
        int                                     actionEnd;
        int                                     triggerEvent;
        QueryTreeNode           actionNode;
        ResultColumnList        triggerColumns = (ResultColumnList) nodeFactory.getNode(
                                                                                        C_NodeTypes.RESULT_COLUMN_LIST,
                                                                                        getContextManager());
        Vector                          refClause = null;
    jj_consume_token(TRIGGER);
    triggerName = qualifiedName(Limits.MAX_IDENTIFIER_LENGTH);
    isBefore = beforeOrAfter();
    triggerEvent = triggerEvent(triggerColumns);
    jj_consume_token(ON);
    tableName = qualifiedName(Limits.MAX_IDENTIFIER_LENGTH);
    switch (jj_nt.kind) {
    case REFERENCING:
      refClause = triggerReferencingClause();
      break;
    default:
      jj_la1[222] = jj_gen;
      ;
    }
    jj_consume_token(FOR);
    jj_consume_token(EACH);
    isRow = rowOrStatement();
    jj_consume_token(MODE);
    jj_consume_token(DB2SQL);
    //we are not top level statement
                    actionNode = proceduralStatement(tokenHolder);
                actionEnd = getToken(0).endOffset;
                actionBegin = tokenHolder[0].beginOffset;

                // No DML in action node for BEFORE triggers.
                if (isBefore.booleanValue() && (actionNode instanceof DMLModStatementNode)) {
                                {if (true) throw StandardException.newException(
                                        SQLState.LANG_UNSUPPORTED_TRIGGER_STMT,
                                        ((StatementNode) actionNode).statementToString(), "BEFORE");}
                                        }


                // no params in trigger action
                HasNodeVisitor visitor = new HasNodeVisitor(ParameterNode.class);
                actionNode.accept(visitor);
                if (visitor.hasNode())
                {
                        {if (true) throw StandardException.newException(SQLState.LANG_NO_PARAMS_IN_TRIGGER_ACTION);}
                }
View Full Code Here

/*
* <A NAME="spsRenameStatement">spsRenameStatement</A>
*/
  final public QueryTreeNode spsRenameStatement() throws ParseException, StandardException {
        QueryTreeNode qtn;
    jj_consume_token(RENAME);
    switch (jj_nt.kind) {
    case TABLE:
      qtn = renameTableStatement();
      break;
View Full Code Here

/*
* <A NAME="renameTableStatement">renameTableStatement</A>
*/
  final public QueryTreeNode renameTableStatement() throws ParseException, StandardException {
        QueryTreeNode qtn;
        TableName tableName;
        String newTableName;
    jj_consume_token(TABLE);
    tableName = qualifiedName(Limits.MAX_IDENTIFIER_LENGTH);
    jj_consume_token(TO);
View Full Code Here

TOP

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

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.