debugging sql stored procedure and view creation in python code