Currently you can add a query or stored procedure to the library in AF. From there you can retrieve data to be used in an attribute via table lookup.
What I am looking for however, is to be able to directly execute a stored procedure from an analysis in PI AF. This will allow me to make a calculation and execute a stored procedure as a result of the calculation.
Doing so you can trigger actions in other places via calculations.