Toad World® Forums

Mass Update in Automation


#1

Hello is there anyway to mass update certain elements of an automation script?

An example of this would be connections. Recently I have been working on a file to monitor the database update procedure, this was written pointing to the test database but now it is ready to go I would like to be able to change all the connections that point to test to now point to the live environment. Each have their own connection saved in the connection manager.

I am aware that I could just change the connection credentials for the test environment to which the script is pointing to but this would then affect all other scripts using these connections.

It would also be helpful to mass update a specific property of all matching activities, but I realise this would probably be more difficult to achieve and used less often.

Thank you
Glenn


#2

Sure. I use the Find and Replace in files feature of TDA. You can tag the changes before making them to see what it will change. And it will drill into directories looking for what you want to replace in the files also. See screenshot.

Debbie
FindAndReplaceInFiles.png


#3

Hi Debbie

Sorry I had forgot about this function, however I do not seem to be able to actually get this to work for changing connections.

Firstly I tried changing just the names over (i.e. swap MERLIVE for MERTEST), then I opened the file (automation script) in Textpad to have a look and found it holds more info than this so I tried changing the whole “ConnectionDescription” line.

However in both instances when I try and open the resulting file I get the below error message and the file refuses to open. Is there anything I can do?

Thanks
Glenn

Error Message:

System.InvalidOperationException
There is an error in XML document (0, 0).
Stack Trace:
at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events)
at System.Xml.Serialization.XmlSerializer.Deserialize(Stream stream)
at Quest.Toad.Automation.AutomationForm.DoFileOpen(String file)
at Quest.Toad.Gui.MainForm.OpenFile(String file, PredefinedParameterCollection predefinedParameters)
at Quest.Toad.Gui.MainForm.openFileButton_ItemClick(Object sender, ItemClickEventArgs e)
at DevExpress.XtraBars.BarItem.OnClick(BarItemLink link)
at DevExpress.XtraBars.BarBaseButtonItem.OnClick(BarItemLink link)
at DevExpress.XtraBars.BarItemLink.OnLinkClick()
at DevExpress.XtraBars.BarItemLink.OnLinkAction(BarLinkAction action, Object actionArgs)
at DevExpress.XtraBars.BarButtonItemLink.OnLinkAction(BarLinkAction action, Object actionArgs)
at DevExpress.XtraBars.BarItemLink.OnLinkActionCore(BarLinkAction action, Object actionArgs)
at DevExpress.XtraBars.ViewInfo.BarSelectionInfo.ClickLink(BarItemLink link)
at DevExpress.XtraBars.ViewInfo.BarSelectionInfo.UnPressLink(BarItemLink link)
at DevExpress.XtraBars.Controls.CustomLinksControl.OnMouseUp(MouseEventArgs e)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at DevExpress.XtraBars.Controls.DockedBarControl.WndProc(Message& msg)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

System.Xml.XmlException
There is no Unicode byte order mark. Cannot switch to Unicode.
Stack Trace:
   at System.Xml.XmlTextReaderImpl.Throw(Exception e)
   at System.Xml.XmlTextReaderImpl.ThrowWithoutLineInfo(String res)
   at System.Xml.XmlTextReaderImpl.CheckEncoding(String newEncodingName)
   at System.Xml.XmlTextReaderImpl.ParseXmlDeclaration(Boolean isTextDecl)
   at System.Xml.XmlTextReaderImpl.Read()
   at System.Xml.XmlTextReader.Read()
   at System.Xml.XmlReader.MoveToContent()
   at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderScriptDocument.Read4_ToadAutomationScript()

#4

That’s a real bummer. It appears that the automation script files have encoding of BigEndian. Go to the option shown above and change to Big Endian while doing this Find and Replace.

I entered CR75,662 to fix so you don’t have to change this setting.

P.S. Hope you are making this changes on backed copies

Debbie
BigEndianEncoding.png


#5

Thanks Debbie that is a great help, this will prove invaluable.

Don’t worry yes I was testing this on duplicated copies of my automation script, I have spent far too long on this to ruin it now!

Thank you
Glenn