RCSB PDB Protein Data Bank A Member of the wwPDB
An Information Portal to Biological Macromolecular Structures
PDB Home | Contact Us
next up previous contents
Next: SearchLessThan Up: Searching Methods Previous: FindFirst

Search

NAME Search

PROTOTYPE

#include "ISTable.h"

ReVarPCifArray<int> * ISTable::Search(
                                  ReVarCifArray<CifString> &targets, 
                                  ReVarCifArray<CifString> & colNames,
                                  int & errCode);

ReVarPCifArray<int> * ISTable::Search(
                                  ReVarCifArray<CifString> &targets, 
                                  ReVarPCifArray<int> & colIds,
                                  int & errCode);

ReVarPCifArray<int> * ISTable::Search(
                                  CifString indexName, 
                                  ReVarCifArray<CifString> &targets, 
                                  ReVarCifArray<CifString> & colNames,
                                  int & errCode);

ReVarPCifArray<int> * ISTable::Search(
                                  CifString indexName, 
                                  ReVarCifArray<CifString> &targets, 
                                  ReVarPCifArray<int> & colIds,
                                  int & errCode);

EXAMPLE

#include "ISTable.h"

ISTable s("MyTable");
...
CifString cs("Target"), col1("column1");
CifString newCS("New Value");
int errCode = 0;

ReVarPCifArray<int> * iArray;
ReVarCifArray<CifString> vals, names;
vals.Add(cs);
names.Add(col1); 
s->CreateIndex("index0",names);
iArray = s.Search(vals, names, errCode);
if (iArray) {
  // update each instance of "Target" with "New Value"
  int colIndex = s.GetColumnIndex(col1.Text());
  for (int i = 0; i < iArray->Length(); i++) {
    s.UpdateCell(newCS, colIndex, *iArray[i]);
  }
}
PURPOSE

Search returns the row indices of cells in a column that are equal to a target.

RECEIVES

Search(ReVarCifArray<CifString>&, ReVarCifArray<CifString>&, int &)

targets An array of target strings to search for.
colNames The names of the columns to search.
errCode A reference to an integer holding the error code resulting from this operation.

Search(ReVarCifArray<CifString>&, ReVarCifArray<int>&, int &)

targets An array of target strings to search for.
colIds The indices of the columns to search.
errCode A reference to an integer holding the error code resulting from this operation.

Search(CifString, ReVarCifArray<CifString>&,
ReVarCifArray<CifString>&, int &)

indexName Name of the index used for searching.
targets An array of target strings to search for.
colNames The names of the columns to search.
errCode A reference to an integer holding the error code resulting from this operation.

Search(CifString, ReVarCifArray<CifString>&, ReVarCifArray<int>&, int &)

indexName Name of the index used for searching.
targets An array of target strings to search for.
colIds The indices of the columns to search.
errCode A reference to an integer holding the error code resulting from this operation.

RETURN VALUE

A pointer to a ReVarPCifArray<int> holding the row indices of the cells containing the target string.
A NULL value indicates a possible error or an unsuccessful search.
A negative value in errCode indicates an error or warning.

REMARKS

See also: SearchLessThan
  SearchLessThanEqual
  SearchGreaterThan
  SearchGreaterThanEqual
  SearchBetween


next up previous contents
Next: SearchLessThan Up: Searching Methods Previous: FindFirst
Olivera Tosic
6/12/2002

 

© RCSB PDB