This is the sql stuff for bug #7814.  This will upgrade old systems to work with the new stuff.
This adds the database piece to the code for bug #7814.
The base is in place for bug #7814.  It now has a [get|set]LocalParam to get/set local parameters.
This fixes #7814.