One of the problems that comes with age is that there is so much 'baggage' filling valuable brain area that it sometimes requires a mental sweeping before trying to learn a new skill. I am still getting rid of FORTRAN and COBOL factoids but need to come up to speed on extending MySQL for some talks I am giving. So away with the PROCEDURE DIVISION stuff...
The MySQL Shell or Mysqlsh is very extensible and it is easy to create a plugin for some handy routines. Your routines can go in functions and there are examples below. The tricky part is that you have to tell Mysqlsh that you are creating an extension and then hook up your function(s) to that extension object. Finally that extension object has to be registered with the shell.
So below are two functions which query the MySQL World Database for the contents of the world.city and the world.country tables. The first thing for both of these …
[Read more]