I'm using Macro Scheduler 8.01 to update a MySql database in batch mode.
I use it to upload a file with insert and update statements to a server, then connect in with SSH (using putty) then run the file. everything works great! My question - errors!
For instance, for a duplicate record a message will be on the screen, like "ERROR 1062 at line 2: Duplicate entry".
Is it possible to "read the screen" to see if there is an error message, and if so stop the macro?
Help with MySql
Moderators: Dorian (MJT support), JRL
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
The quick answer is YES.
Use the IfWindowOpen command to break out and process the contents
====================================
NOTE: the syntax above is not correct, just a quick sample of how this might be handled with some of Macro Scheduler's commands.
Use the IfWindowOpen command to break out and process the contents
Code: Select all
Label>DoStuff
DoStuff
IfWindowOpen>ErrorWindowName*,ReadErrorMsg,DoStuff
Label>ReadErrorMsg
Process contents of window, depending on content. Pehaps use a group of
FindWindowWithText>Error 1,1,Error1
If>Error1<>"NOT FOUND",%Error1%,DoOtherStuff
Label>Error1
Do stuff reacting to error code1
Goto>DoStuff
Label>DoOtherStuff
NOTE: the syntax above is not correct, just a quick sample of how this might be handled with some of Macro Scheduler's commands.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!
Bob
A humble man and PROUD of it!
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Why don't you install the MySQL ODBC drivers and then you can do all the SQL within the script directly and will not need to manipulate SSH.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?