Package com.akiban.sql

Examples of com.akiban.sql.StandardException


    jj_consume_token(COLUMN);
    oldColumnReference = columnReference();
    jj_consume_token(TO);
    newColumnName = identifier();
        if ((tableName = oldColumnReference.getTableNameNode()) == null)
            {if (true) throw new StandardException("Table name missing in RENAME COLUMN");}

        tableElementList = (TableElementList)nodeFactory
                    .getNode(NodeTypes.TABLE_ELEMENT_LIST, parserContext);

        tableElementList.addTableElement((TableElementNode)nodeFactory
View Full Code Here


        jj_la1[386] = jj_gen;
        ;
      }
      jj_consume_token(NULL);
        if ( dataTypeDescriptor[0] == null ) {
            {if (true) throw new StandardException("[NOT] NULL requires a data type");}
        }
        dataTypeDescriptor[0] = dataTypeDescriptor[0].getNullabilityType(notNull == null);
        {if (true) return null;}
      break;
    case PRIMARY:
View Full Code Here

        jj_consume_token(-1);
        throw new ParseException();
      }
        if (hasAutoIncrement)
            //bug 5724 - auto increment columns not allowed in ALTER TABLE statement
            {if (true) throw new StandardException("Auto increment column not allowed in ALTER TABLE");}

        changeType[0] = DDLStatementNode.ADD_TYPE;
      break;
    case ALTER:
      jj_consume_token(ALTER);
View Full Code Here

    */
    private void checkRequiredRoutineClause(Object[] clauses)
            throws StandardException {
        String language = (String)clauses[CreateAliasNode.LANGUAGE];
        if (language == null) {
            throw new StandardException("Missing required " + ROUTINE_CLAUSE_NAMES[CreateAliasNode.LANGUAGE]);
        }
        int[] required;
        if (language.equalsIgnoreCase("JAVA")) {
            required = new int[] {
                CreateAliasNode.PARAMETER_STYLE,
                CreateAliasNode.EXTERNAL_NAME
            };
        }
        else {
            required = new int[] {
                CreateAliasNode.PARAMETER_STYLE,
                CreateAliasNode.INLINE_DEFINITION
            };
        }
        for (int i = 0; i < required.length; i++) {
            int re = required[i];
            if (clauses[re] == null) {
                throw new StandardException("Missing required " + ROUTINE_CLAUSE_NAMES[re]);
            }
        }
    }
View Full Code Here

    case CALL:
      jj_consume_token(CALL);
      value = primaryExpression();
        if (! (value instanceof JavaToSQLValueNode) ||
            ! (((JavaToSQLValueNode) value).getJavaValueNode() instanceof MethodCallNode)) {
            {if (true) throw new StandardException("Invalid call statement");}
        }

        StatementNode callStatement = (StatementNode)
            nodeFactory.getNode(NodeTypes.CALL_STATEMENT_NODE,
                                value,
                                parserContext);

        {if (true) return callStatement;}
      break;
    case QUESTION_MARK:
    case DOLLAR_N:
      // ? = CALL method()
          returnParam = dynamicParameterSpecification();
      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 new StandardException("Invalid call statement");}
        }

        // We must have a method call node.
        value = rcl.get(0).getExpression();
        if (! (value instanceof JavaToSQLValueNode) ||
            ! (((JavaToSQLValueNode) value).getJavaValueNode() instanceof MethodCallNode)) {
            {if (true) throw new StandardException("Invalid call statement");}
        }

        // wrap the row result set in a cursor node
        StatementNode cursorNode = (StatementNode)
            nodeFactory.getNode(NodeTypes.CURSOR_NODE,
View Full Code Here

          break label_3;
        }
      }
        //ON ROLLBACK RETAIN CURSORS is only supported case *** TODO: fix this ***
        if (savepointStatementClauses[SAVEPOINT_RETAIN_CURSORS] == null)
            {if (true) throw new StandardException("Missing required ON ROLLBACK RETAIN CURSORS");}
        savepointStatementType = SavepointNode.StatementType.SET;
      break;
    case ROLLBACK:
      jj_consume_token(ROLLBACK);
      switch (jj_nt.kind) {
View Full Code Here

      throw new ParseException();
    }
        // Check for repeated clause
        if (savepointStatementClauses[clausePosition] != null) {
            String which = SAVEPOINT_CLAUSE_NAMES[clausePosition];
            {if (true) throw new StandardException("Repeated " + which + " clause");}
        }

        savepointStatementClauses[clausePosition] = Boolean.TRUE;
  }
View Full Code Here

        break label_4;
      }
    }
        // NOT LOGGED is mandatory
        if (declareTableClauses[TEMPORARY_TABLE_NOT_LOGGED] == null)
            {if (true) throw new StandardException("Missing required NOT LOGGED");}
        // if ON COMMIT behavior not explicitly specified in DECLARE command, resort to default ON COMMIT DELETE ROWS
        if (declareTableClauses[TEMPORARY_TABLE_ON_COMMIT] == null)
            declareTableClauses[TEMPORARY_TABLE_ON_COMMIT] = Boolean.TRUE;
        // if ON ROLLBACK behavior not explicitly specified in DECLARE command, resort to default ON ROLLBACK DELETE ROWS
        if (declareTableClauses[TEMPORARY_TABLE_ON_ROLLBACK] == null)
View Full Code Here

      }
    }
        // Check for repeated clause.
        if (declareTableClauses[clausePosition] != null) {
            String which = TEMPORARY_TABLE_CLAUSE_NAMES[clausePosition];
            {if (true) throw new StandardException("Repeated " + which + " clause");}
        }
        declareTableClauses[clausePosition] = clauseValue;
  }
View Full Code Here

        jj_la1[70] = jj_gen;
        ;
      }
        if ((precision <= 0) ||
                (precision > MAX_DECIMAL_PRECISION_SCALE)) {
            {if (true) throw new StandardException("Invalid precision: " + precision);}
        }
        else if ((scale < 0) ||
                         (scale > MAX_DECIMAL_PRECISION_SCALE)) {
            {if (true) throw new StandardException("Invalid scale: " + scale);}
        }
        else if (scale > precision) {
            {if (true) throw new StandardException("Scale is greater than precision: " +
                                                                     scale + " > " + precision);}
        }
        /*
        ** If we have a decimal point, need to count it
        ** towards maxwidth.    Max width needs to account
View Full Code Here

TOP

Related Classes of com.akiban.sql.StandardException

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.