Package org.apache.derby.iapi.sql.execute

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


  {
    long            indexConglomerateNumber = tabInfo.getIndexConglomerate( indexNumber );
    IndexRowGenerator      indexRowGenerator = tabInfo.getIndexRowGenerator( indexNumber );
    CatalogRowFactory      rowFactory = tabInfo.getCatalogRowFactory();
    ExecRow            heapRow = rowFactory.makeEmptyRow();
    ExecIndexRow        indexableRow = indexRowGenerator.getIndexRowTemplate();

    ScanController        heapScan =
      tc.openScan(
        heapConglomerateNumber,       // conglomerate to open
        false,                          // don't hold open across commit
        0,                              // for read
                TransactionController.MODE_TABLE,
                TransactionController.ISOLATION_REPEATABLE_READ,
        (FormatableBitSet) null,                 // all fields as objects
        null,                           // start position - first row
        ScanController.GE,              // startSearchOperation
        null,                           //scanQualifier,
        null,                           //stop position-through last row
        ScanController.GT);             // stopSearchOperation

    RowLocation          heapLocation =
            heapScan.newRowLocationTemplate();

    ConglomerateController    indexController =
      tc.openConglomerate(
        indexConglomerateNumber,
                false,
        TransactionController.OPENMODE_FORUPDATE,
        TransactionController.MODE_TABLE,
        TransactionController.ISOLATION_REPEATABLE_READ);

    while ( heapScan.fetchNext(heapRow.getRowArray()) )
        {
       heapScan.fetchLocation( heapLocation );

      indexRowGenerator.getIndexRow( heapRow, heapLocation, indexableRow, (FormatableBitSet) null );

      indexController.insert(indexableRow.getRowArray());
    }

    indexController.close();
    heapScan.close();
  }
View Full Code Here


     * and stop position for scan.
     */
    viewIdOrderable = getIDValueAsCHAR(viewID);

    /* Set up the start/stop position for the scan */
    ExecIndexRow keyRow = exFactory.getIndexableRow(1);
    keyRow.setColumn(1, viewIdOrderable);

    vd = (ViewDescriptor)
          getDescriptorViaIndex(
            SYSVIEWSRowFactory.SYSVIEWS_INDEX1_ID,
            keyRow,
View Full Code Here

     * and stop position for scan.
     */
    viewIdOrderable = getIDValueAsCHAR(vd.getUUID());

    /* Set up the start/stop position for the scan */
    ExecIndexRow keyRow = (ExecIndexRow) exFactory.getIndexableRow(1);
    keyRow.setColumn(1, viewIdOrderable);

    ti.deleteRow( tc, keyRow, SYSVIEWSRowFactory.SYSVIEWS_INDEX1_ID );

  }
View Full Code Here

    DataValueDescriptor      idOrderable;
    TabInfoImpl            ti = getNonCoreTI(SYSFILES_CATALOG_NUM);
    idOrderable = getIDValueAsCHAR(id);

    /* Set up the start/stop position for the scan */
    ExecIndexRow keyRow = exFactory.getIndexableRow(1);
    keyRow.setColumn(1, idOrderable);

    return (FileInfoDescriptor)
          getDescriptorViaIndex(
            SYSFILESRowFactory.SYSFILES_INDEX2_ID,
            keyRow,
View Full Code Here

    nameOrderable = new SQLVarchar(name);
    schemaIDOrderable = getIDValueAsCHAR(schemaId);

    /* Set up the start/stop position for the scan */
    ExecIndexRow keyRow = exFactory.getIndexableRow(2);
    keyRow.setColumn(1, nameOrderable);
    keyRow.setColumn(2, schemaIDOrderable);
    FileInfoDescriptor r = (FileInfoDescriptor)
          getDescriptorViaIndex(
            SYSFILESRowFactory.SYSFILES_INDEX1_ID,
            keyRow,
            (ScanQualifier [][]) null,
View Full Code Here

   */
  public void  dropFileInfoDescriptor(FileInfoDescriptor fid)
            throws StandardException
  {
    ConglomerateController  heapCC;
    ExecIndexRow      keyRow1 = null;
    DataValueDescriptor    idOrderable;
    TabInfoImpl          ti = getNonCoreTI(SYSFILES_CATALOG_NUM);
    TransactionController   tc = getTransactionExecute();
   
    /* Use tableIdOrderable and schemaIdOrderable in both start
     * and stop position for index 1 scan.
     */
    idOrderable = getIDValueAsCHAR(fid.getUUID());

    /* Set up the start/stop position for the scan */
    keyRow1 = (ExecIndexRow) exFactory.getIndexableRow(1);
    keyRow1.setColumn(1, idOrderable);
    ti.deleteRow( tc, keyRow1, SYSFILESRowFactory.SYSFILES_INDEX2_ID );
  }
View Full Code Here

     * and stop position for scan.
     */
    stmtIDOrderable = new SQLChar(stmtUUID);

    /* Set up the start/stop position for the scan */
    ExecIndexRow keyRow = exFactory.getIndexableRow(1);
    keyRow.setColumn(1, stmtIDOrderable);

    SPSDescriptor spsd = (SPSDescriptor)
          getDescriptorViaIndex(
            SYSSTATEMENTSRowFactory.SYSSTATEMENTS_INDEX1_ID,
            keyRow,
View Full Code Here

     */
    stmtNameOrderable = new SQLVarchar(stmtName);
    schemaIDOrderable = new SQLChar(schemaUUID);

    /* Set up the start/stop position for the scan */
    ExecIndexRow keyRow = exFactory.getIndexableRow(2);
    keyRow.setColumn(1, stmtNameOrderable);
    keyRow.setColumn(2, schemaIDOrderable);

    SPSDescriptor spsd = (SPSDescriptor)
          getDescriptorViaIndex(
            SYSSTATEMENTSRowFactory.SYSSTATEMENTS_INDEX2_ID,
            keyRow,
View Full Code Here

      boolean          updateParamDescriptors,
      boolean          wait,
      boolean                 firstCompilation)
            throws StandardException
  {
    ExecIndexRow        keyRow1 = null;
    ExecRow              row;
    DataValueDescriptor      idOrderable;
    DataValueDescriptor      columnNameOrderable;
    TabInfoImpl            ti = getNonCoreTI(SYSSTATEMENTS_CATALOG_NUM);
    SYSSTATEMENTSRowFactory  rf = (SYSSTATEMENTSRowFactory) ti.getCatalogRowFactory();
    int[] updCols;
    if (recompile)
    {
      if(firstCompilation)
      {
        updCols = new int[] {SYSSTATEMENTSRowFactory.SYSSTATEMENTS_VALID,
                   SYSSTATEMENTSRowFactory.SYSSTATEMENTS_LASTCOMPILED,
                   SYSSTATEMENTSRowFactory.SYSSTATEMENTS_USINGTEXT,
                   SYSSTATEMENTSRowFactory.SYSSTATEMENTS_CONSTANTSTATE,
                   SYSSTATEMENTSRowFactory.SYSSTATEMENTS_INITIALLY_COMPILABLE};
      }else
      {

        updCols = new int[] {SYSSTATEMENTSRowFactory.SYSSTATEMENTS_VALID,
                     SYSSTATEMENTSRowFactory.SYSSTATEMENTS_LASTCOMPILED,
                     SYSSTATEMENTSRowFactory.SYSSTATEMENTS_USINGTEXT,
                     SYSSTATEMENTSRowFactory.SYSSTATEMENTS_CONSTANTSTATE };
      }
    }
    else
    {
      updCols = new int[]  {SYSSTATEMENTSRowFactory.SYSSTATEMENTS_VALID} ;
    }
     
    idOrderable = getIDValueAsCHAR(spsd.getUUID());

    /* Set up the start/stop position for the scan */
    keyRow1 = (ExecIndexRow) exFactory.getIndexableRow(1);
    keyRow1.setColumn(1, idOrderable);

    row = rf.makeSYSSTATEMENTSrow(false,   // don't compile
                    spsd);

    /*
 
View Full Code Here

    TabInfoImpl          ti = getNonCoreTI(SYSSTATEMENTS_CATALOG_NUM);

    stmtIdOrderable = getIDValueAsCHAR(uuid);

    /* Set up the start/stop position for the scan */
    ExecIndexRow keyRow = (ExecIndexRow) exFactory.getIndexableRow(1);
    keyRow.setColumn(1, stmtIdOrderable);

    ti.deleteRow( tc, keyRow, SYSSTATEMENTSRowFactory.SYSSTATEMENTS_INDEX1_ID );

    /* drop all columns in SYSCOLUMNS */ 
    dropAllColumnDescriptors(uuid, tc);
View Full Code Here

TOP

Related Classes of org.apache.derby.iapi.sql.execute.ExecIndexRow

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.