You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

An ODB API file cannot be changed in place. Instead, a new version of the file can be created with desired modifications.

Sometimes all we need to do is to add a constant column. This is often needed before archiving or transferring the file to a different organization, as we want to make the data on file self-describing, and so we need to include in it constants representing experiment version, origin, etc. For this the simplest solution is to use the 'odb sql' command line tool, for example:

Create a new version of a file with an added constant column using command line odb tool
$ odb sql 'select *, 1 as mf_vertco_type' -i in.odb -o out.odb -f odb

will create a new version of file in.odb with added constant column mf_vertco_type and save it in file out.odb.

In case we want the new file to be of type INTEGER, rather then the default REAL, we can do:

Create a new version of a file with an added constant integer column using command line odb tool
$ odb sql 'select *, int(1) as mf_vertco_type' -i in.odb -o out.odb -f odb
  • No labels