Examples of ExecRow


Examples of org.apache.derby.iapi.sql.execute.ExecRow

  */
  protected void openCore() throws StandardException
  {
    lcc.getStatementContext().setTopResultSet(this, subqueryTrackingArray);

    ExecRow row = getNextRowCore(sourceResultSet);

    if (row != null)
    {
      rs = activation.getTargetVTI();

      if (SanityManager.DEBUG)
      {
        SanityManager.ASSERT(rs != null,
          "rs expected to be non-null");
      }
    }


    /* The source does not know whether or not we are doing a
     * deferred mode delete.  If we are, then we must clear the
     * index scan info from the activation so that the row changer
     * does not re-use that information (which won't be valid for
     * a deferred mode delete).
     */
    if (constants.deferred)
    {
      activation.clearIndexScanInfo();
            if( null == rowHolder)
                rowHolder =
                    new TemporaryRowHolderImpl(activation, new Properties(),
                                               (ResultDescription) null);
    }

        try
        {
            while ( row != null )
            {
                if( !constants.deferred)
                    rs.deleteRow();
                else
                {
                    ExecRow rowId = new ValueRow(1);
                    rowId.setColumn( 1, new SQLInteger( rs.getRow()));
                    rowHolder.insert( rowId);
                }

                rowCount++;

                // No need to do a next on a single row source
                if (constants.singleRowSource)
                {
                    row = null;
                }
                else
                {
                    row = getNextRowCore(sourceResultSet);
                }
      }
    }
        catch (StandardException se)
        {
            throw se;
        }
        catch (Throwable t)
        {
            throw StandardException.unexpectedUserException(t);
        }

    if (constants.deferred)
    {
      CursorResultSet tempRS = rowHolder.getResultSet();
      try
      {
                ExecRow  deferredRowBuffer = null;

        tempRS.open();
        while ((deferredRowBuffer = tempRS.getNextRow()) != null)
        {
                    int rowNumber = deferredRowBuffer.getColumn( 1).getInt();
                    rs.absolute( rowNumber);
          rs.deleteRow();
        }
      }
            catch (Throwable t)
View Full Code Here

Examples of org.apache.derby.iapi.sql.execute.ExecRow

   */
  public ExecRow getEmptyExecRow()
     throws StandardException
  {
    int              columnCount = getNumberOfColumns();
    ExecRow result =
            getDataDictionary().getExecutionFactory().getValueRow(columnCount);

    for (int index = 0; index < columnCount; index++)
    {
      ColumnDescriptor cd = (ColumnDescriptor) columnDescriptorList.elementAt(index);
      //String name = column.getColumnName();
      DataValueDescriptor dataValue = cd.getType().getNull();
      result.setColumn(index + 1, dataValue);
    }
    return result;
  }
View Full Code Here

Examples of org.apache.derby.iapi.sql.execute.ExecRow

    @exception StandardException    Thrown on error
   */
  public void finish()
    throws StandardException
  {
    ExecRow      deferredRow;
    ExecIndexRow  deferredIndexRow = new IndexRow();

    /* Deferred processing only necessary for unique indexes */
    if (rowHolder != null)
    {
      CursorResultSet rs = rowHolder.getResultSet();
      try
      {
        rs.open();
        while ((deferredRow = rs.getNextRow()) != null)
        {
          if (SanityManager.DEBUG)
          {
            if (!(deferredRow instanceof ExecIndexRow))
            {
              SanityManager.THROWASSERT("deferredRow isn't an instance "+
                "of ExecIndexRow as expected. "+
                "It is an "+deferredRow.getClass().getName());
            }
          }
          insertAndCheckDups((ExecIndexRow)deferredRow);
        }
      }
View Full Code Here

Examples of org.apache.derby.iapi.sql.execute.ExecRow

    throws StandardException
  {
    TabInfoImpl ti =  (catalogNumber < NUM_CORE) ? coreInfo[catalogNumber] :
      getNonCoreTI(catalogNumber);

    ExecRow row = ti.getCatalogRowFactory().makeRow(td, parent);

    int insertRetCode = ti.insertRow(row, tc, wait);

    if (!duplicatesAllowed)
    {
View Full Code Here

Examples of org.apache.derby.iapi.sql.execute.ExecRow

    ExecRow[] rl = new ExecRow[td.length];

    for (int index = 0; index < td.length; index++)
    {
      ExecRow row = crf.makeRow(td[index], parent);
      rl[index] = row;
    }

    int insertRetCode = ti.insertRowList( rl, tc );
    if (!allowDuplicates && insertRetCode != TabInfoImpl.ROWNOTDUPLICATE)
View Full Code Here

Examples of org.apache.derby.iapi.sql.execute.ExecRow

    throws StandardException
  {
    ConglomerateController  heapCC = null;
    ExecIndexRow        indexRow1;
    ExecIndexRow      indexTemplateRow;
    ExecRow         outRow;
    ScanController      scanController = null;
    boolean          foundRow;
    FormatableBitSet          colToCheck = new FormatableBitSet(indexCol);
    CatalogRowFactory    rf = ti.getCatalogRowFactory()
View Full Code Here

Examples of org.apache.derby.iapi.sql.execute.ExecRow

                    char lockGranularity, TransactionController tc)
    throws StandardException
  {
    ConglomerateController  heapCC;
    ExecIndexRow      keyRow1 = null;
    ExecRow            row;
    DataValueDescriptor    schemaIDOrderable;
    DataValueDescriptor    tableNameOrderable;
    TabInfoImpl          ti = coreInfo[SYSTABLES_CORE_NUM];
    SYSTABLESRowFactory  rf = (SYSTABLESRowFactory) ti.getCatalogRowFactory();
View Full Code Here

Examples of org.apache.derby.iapi.sql.execute.ExecRow

        {
          tableScan = getTableScanResultSet(baseTableConglom);

          try
          {
            ExecRow currRow = null;
            while ((currRow = tableScan.getNextRowCore()) != null)
            {
              // we have to set the source row so the check constraint
              // sees the correct row.
              sourceResultSet.setCurrentRow(currRow);
View Full Code Here

Examples of org.apache.derby.iapi.sql.execute.ExecRow

  private void normalInsertCore(LanguageConnectionContext lcc, boolean firstExecute)
    throws StandardException
  {
    boolean setUserIdentity = constants.hasAutoincrement() && isSingleRowResultSet();
    boolean  firstDeferredRow = true;
    ExecRow  deferredRowBuffer = null;
                long user_autoinc=0;
                       
    /* Get or re-use the row changer.
     * NOTE: We need to set ourself as the top result set
     * if this is not the 1st execution.  (Done in constructor
View Full Code Here

Examples of org.apache.derby.iapi.sql.execute.ExecRow

    ExecRow           inputRow,
    int[]             columnIndexes
  )
    throws StandardException
  {
    ExecRow outRow;
    int numInputCols = inputRow.nColumns();

    if (columnIndexes == null)
    {
      outRow = new ValueRow(numInputCols);
      Object[] src = inputRow.getRowArray();
      Object[] dst = outRow.getRowArray();
      System.arraycopy(src, 0, dst, 0, src.length);
      return outRow;
    }

    int numOutputCols = columnIndexes.length;

    outRow = new ValueRow(numOutputCols);
    for (int i = 0; i < numOutputCols; i++)
    {
      outRow.setColumn(i+1,
        inputRow.getColumn(columnIndexes[i]));
    }

    return outRow;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.