sysbldback.sql 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. -- This script is for backward compatability with old DataBlade modules.
  2. -- The bld_* and bldi_* tables have been depreciated in favor of the sysbld prefix.
  3. -- Note that these work the first time through, but fail harmlessly on subsequent
  4. -- invocations.
  5. -- Duplicate data from old style tables.
  6. insert into sysbldmodules select * from bld_modules;
  7. insert into sysbldscripts select * from bld_scripts;
  8. insert into sysblddescription select * from bld_desc;
  9. insert into sysbldclientfiles select * from client_files;
  10. insert into sysbldclientfileos select * from clntfile_os_rel;
  11. insert into sysbldinterfaces select * from bld_interfaces;
  12. insert into sysbldifacprovided select * from dbi_provided;
  13. insert into sysbldifacrequired select * from dbi_required;
  14. merge into sysbldvendors as old using bld_vendors as new
  15. on old.bvendor_id = new.bvendor_id
  16. when not matched then insert (bvendor_id, bvendor_name, blocale_id, bvendor_format, bvendor_desc)
  17. VALUES (new.bvendor_id, new.bvendor_name, new.blocale_id, new.bvendor_format, new.bvendor_desc);
  18. -- bld_registered upgrade.
  19. create view if not exists bld_registered as select * from sysbldregistered;
  20. merge into sysbldregistered as old using bld_registered as new
  21. on old.bld_id = new.bld_id
  22. when not matched then insert (bld_id)
  23. values (new.bld_id);
  24. -- bldi_required upgrade.
  25. create view if not exists bldi_required as select * from sysbldirequired;
  26. merge into sysbldirequired as old using bldi_required as new
  27. on old.bld_id = new.bld_id and old.bldi_id = new.bldi_id
  28. when not matched then insert (bldi_id, bld_id)
  29. values (new.bldi_id, new.bld_id);
  30. -- bldi_provided upgrade.
  31. create view if not exists bldi_provided as select * from sysbldiprovided;
  32. merge into sysbldiprovided as old using bldi_provided as new
  33. on old.bldi_id = new.bldi_id
  34. when not matched then insert (bldi_id, bld_id)
  35. values (new.bldi_id, new.bld_id);