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: FillColumn Up: Column methods Previous: InsertColumn

RenameColumn

NAME RenameColumn

PROTOTYPE

#include "ISTable.h"
int ISTable::RenameColumn(const char * oldColumnName,
                          const char * newColumnName);

EXAMPLE

#include "ISTable.h"

...
ISTable * pTable = new ISTable();
ReVarCifArray<CifString> last_column;
CifString cs;

while (tokenizer.hasMoreTokens()) {
  cs = (char *) tokenizer.GetNextToken();
  last_column.Add(cs);
  cs.Clear();
}

// put a column in 1st position ...
pTable->InsertColumn("FirstColumn", 0);
pTable->InsertColumn(last_column, "LastColumn",
  pTable->GetNumColumns());
pTable->InsertColumn("MiddleColumn", pTable->GetNumColumns()/2,
  ISTable::DT_INTEGER);
pTable->RenameColumn("FirstColumn", "Column1");
PURPOSE

RenameColumn renames existing column defined by oldColumnName and this column will have new name defined by newColumnName;

RECEIVES

InsertColumn(const char *, const char *)
oldColumnName The name of the columnthat will be renamed.
newColumnName New name of the column. The column name must be unique to the table.

RETURN VALUE

A negative value indicates an error or warning.

REMARKS

It is safe to use this method after index creation.

See also: FillColumn
  Column Option Constants



Olivera Tosic
6/12/2002

 

© RCSB PDB