Class ExecSPSNode

  • All Implemented Interfaces:
    Visitable

    class ExecSPSNode
    extends StatementNode
    A ExecSPSNode is the root of a QueryTree that represents an EXECUTE STATEMENT statement. It is a tad abnormal. During a bind, it locates and retrieves the SPSDescriptor for the particular statement. At generate time, it generates the prepared statement for the stored prepared statement and returns it (i.e. it effectively replaces itself with the appropriate prepared statement).
    • Constructor Detail

      • ExecSPSNode

        ExecSPSNode​(TableName newObjectName,
                    ContextManager cm)
        Constructor for a ExecSPSNode
        Parameters:
        newObjectName - The name of the table to be created
        cm - The context manager
        Throws:
        StandardException - Thrown on error
    • Method Detail

      • bindStatement

        public void bindStatement()
                           throws StandardException
        Bind this ExecSPSNode. This means doing any static error checking that can be done before actually creating the table. For example, verifying that the ResultColumnList does not contain any duplicate column names.
        Overrides:
        bindStatement in class StatementNode
        Throws:
        StandardException - Thrown on error
      • isAtomic

        public boolean isAtomic()
        SPSes are atomic if its underlying statement is atomic.
        Overrides:
        isAtomic in class StatementNode
        Returns:
        true if the statement is atomic
      • getCursorInfo

        public java.lang.Object getCursorInfo()
        Get information about this cursor. For sps, this is info saved off of the original query tree (the one for the underlying query).
        Overrides:
        getCursorInfo in class StatementNode
        Returns:
        the cursor info
      • getParameterTypes

        public DataTypeDescriptor[] getParameterTypes()
                                               throws StandardException
        Return a description of the ? parameters for the statement represented by this query tree. Just return the params stored with the prepared statement.
        Overrides:
        getParameterTypes in class QueryTreeNode
        Returns:
        An array of DataTypeDescriptors describing the ? parameters for this statement. It returns null if there are no parameters.
        Throws:
        StandardException - on error
      • makeConstantAction

        public ConstantAction makeConstantAction()
        Create the Constant information that will drive the guts of Execution. This is assumed to be the first action on this node.
        Overrides:
        makeConstantAction in class QueryTreeNode
      • needsSavepoint

        public boolean needsSavepoint()
        We need a savepoint if we will do transactional work. We'll ask the underlying statement if it needs a savepoint and pass that back. We have to do this after generation because getting the PS now might cause us to basically do DDL (for a stmt recompilation) which is explicitly banned during binding. So the caller can only call this after generate() has retrieved the target PS.
        Overrides:
        needsSavepoint in class StatementNode
        Returns:
        boolean always true.
      • getSPSName

        public java.lang.String getSPSName()
        Get the name of the SPS that is used to execute this statement. Only relevant for an ExecSPSNode -- otherwise, returns null.
        Overrides:
        getSPSName in class StatementNode
        Returns:
        the name of the underlying sps
      • acceptChildren

        void acceptChildren​(Visitor v)
                     throws StandardException
        Description copied from class: QueryTreeNode
        Accept a visitor on all child nodes. All sub-classes that add fields that should be visited, should override this method and call accept(v) on all visitable fields, as well as super.acceptChildren(v) to make sure all visitable fields defined by the super-class are accepted too.
        Overrides:
        acceptChildren in class QueryTreeNode
        Parameters:
        v - the visitor
        Throws:
        StandardException - on errors raised by the visitor