Calling a stored procedure from a macro

Calling a stored procedure from a macro

Whenever possible, I like to use stored procedures in macros when the process involves some sort of database update or manipulation.  This way it limits access to the code and reduces the chance of someone “accidentally” changing it within the macro dialog window.  Yes – they can still throw a wrench into the macros script  – but at least I can contain it.

Calling a stored procedure is relatively easy to do.

Here’s a walk through…

Keeping it simple, the following script will create a stored procedure (named SP_UpdateUDF) to update the USER_10 field for a part in the PART table.  The stored procedure has ONE parameter which is the part id to update.  The script also grants access to PUBLIC to give everyone permission to execute the store procedure.

Now here’s the VISUAL macro to call the stored procedure:

Copyright 2019 visualnuggets © All Rights Reserved