I think you just need to find or write a module to store the results using some sql. I found a reference to some oracle modules here
https://liquidat.wordpress.com/2017/02/17/ansible-community-modules-for-oracle-db-asm/ including a couple of modules for this interacting with database.
If you go with oracle, consider using Merge On syntax which would give you a sort of idempotent behavior. Mysql likely has something similar too, although I don't know what the syntax might be.
Hope thus helps,
Jon