[Antelope] Forcibly Adding Records with matching keys
danq at mac.com
Thu Dec 24 09:57:51 CST 2009
The usual way to avoid the consistency checks is to use dbadd or dbaddnull instead of dbaddv.
So for example, you might use dbaddnull to add a null record, then use dbputv to set the various
fields. Or write fields into the scratch record, then use dbadd to write the scratch record to the
Something like this:
db.record = dbaddnull(db);
result = dbputv (db, "field", value, ..., NULL) ;
( test result )
db.record = dbSCRATCH ;
result = dbputv ( db, "field", value, ..., NULL ) ;
(test result )
result = dbadd ( db, 0 ) ;
On Dec 17, 2009, at 2:45 PM, Hank Ratzesberger wrote:
> My question:
> I am copying tables from one database to another, with some
> transformations in the process.
> How can add records even when they break the primary/secondary keys?
> It's not clear to me if/how I can do this. A snippet would be great.
> It is not clear if calling dbaddv() for each column will format
> the data properly, and if dbput() will attempt to enforce the
> uniqueness checks.
> Thank you,
> P.S. If you are curious why I am doing this:
> I need to mash up a database so that the station names we collected under
> (GVA01, GVA02, etc) are all the same (GVDA). Along with various sensor
> and datalogger changes, this means that some records no longer fit the
> schema. But the location part of the channel is unique so I know I can
> do this for my limited purposes.
> Hank Ratzesberger
> NEES at UCSB
> Institute for Crustal Studies,
> University of California, Santa Barbara
> Antelope mailing list
> Antelope at brtt.net
More information about the Antelope