How to change the database link for a number of objects
Posted: Thu Jan 05, 2012 6:41 pm
I'd like to write a program that replaces an old database link with a new database link for all of the link objects in my workfile.
We just changed our server databases and I have hundreds of links to update to the new database.
Basically i have a bunch of series that were constructed along the lines of:
Link ABC.LINKTO OLD_DB1::XYZ1234
Link DEF.LINKTO OLD_DB2::XYZ9876
Now I want to write a program that pulls out the "OLD_DB?" parts and replaces it with NEW_DB and then put this in a loop so it does this for all of my links in the workfile.
The 'OLD_DB1::XYZ1234' part shows up when I click on Properties->Values under 'Database link' and it also shows up under [History]. Trouble is, I don't know how I can pull it out from either of those locations using a program.
Also, I'm not sure how to create a group that only contains 'link objects'. I tried using @detailedtype, but somehow that seems to return only 'SERIES' and I don't seem to be able to use it in a 'genr' command or as part of an if-statement.
I'm using EV 7.1 Enterprise (Nov 3, 2010) and don't stand a chance in having this upgraded any time soon.
Thanks for the help. -BU
We just changed our server databases and I have hundreds of links to update to the new database.
Basically i have a bunch of series that were constructed along the lines of:
Link ABC.LINKTO OLD_DB1::XYZ1234
Link DEF.LINKTO OLD_DB2::XYZ9876
Now I want to write a program that pulls out the "OLD_DB?" parts and replaces it with NEW_DB and then put this in a loop so it does this for all of my links in the workfile.
The 'OLD_DB1::XYZ1234' part shows up when I click on Properties->Values under 'Database link' and it also shows up under [History]. Trouble is, I don't know how I can pull it out from either of those locations using a program.
Also, I'm not sure how to create a group that only contains 'link objects'. I tried using @detailedtype, but somehow that seems to return only 'SERIES' and I don't seem to be able to use it in a 'genr' command or as part of an if-statement.
I'm using EV 7.1 Enterprise (Nov 3, 2010) and don't stand a chance in having this upgraded any time soon.
Thanks for the help. -BU