third_party_content:sprezz_blog:16470.7104166667

DBT vs Attach_Table Redux

Published 02 FEB 2013 at 05:03:00PM by Sprezz

An accusation once (correctly) levelled at your author is that he frequently neglects to read the ReadMe files that accompany each upgrade of OpenInsight. Despite having made this oversight the subject of a New Year's Resolution it seems that they still aren't being read with quite the right degree of attention otherwise this little snippet might have been noticed in the 9.2.1 readme…

   RTI_LOAD_DATABASE - Can Load a different DBT programmatically.    Usage:    Call RTI_Load_Database("MYDB") to load MYDB.DBT This will swap the DBT without all the initialisation we mentioned in our last blog post. It will even leave the inheritance chain in @APPID intact so that you can load a database which doesn't inherit from the existing database. In fact the only thing that changes is @DBID which changes to the new database value.

As if that weren't enough (and thanks to RTI for this information) there is an additional boolean parameter to the routine (the second parameter) that will leave @DBID at its previous value. To quote the RTI source "a flag named buseAppIdforDBid. If true, then @DBID will remain as @APPID, preventing some problems".

So depending on desired behaviour it may be even quicker to use RTI_LOAD_DATABASE in place of SWAP_DATABASE. The performance improvements just keep on coming :).

Comments

Original ID: post-3550004920325603695
  • third_party_content/sprezz_blog/16470.7104166667.txt
  • Last modified: 2024/01/17 19:45
  • by 127.0.0.1