My use case is the following: i developed a small python script which does some time-series analysis and then writes the output into a database table where it's used by an Oracle application. The script resides on the server and is run from the Oracle interface. All is working good but i want to be able to retrieve any potential errors from the script into a database table. Is this possible?
Yes, you can either:

wrap all of the script's main logic in a try: except Exception as exc: block, and then use the exception handler to post the traceback (traceback.format_traceback()) to your database
use a separate wrapper script that runs your script, and in case it fails (returncode != 0), post the stderr output to your database
Retrieving Python errors into an Oracle database