How to Build Apps Using Visual Studio Code, Python and Oracle Database

Veronica Dumitriu
Oracle Developers
Published in
2 min readMay 30, 2023

If you are an developer and you are using VS Code and your preferred programming language to create applications with Oracle Database, check the demo in the video that my colleague Christian Shay created, using Python as an example.

The demo walks you through:

  1. Cloning a GitHub repository with sample code:

~ PL/SQL scripts to create a schema in the database and stored functions that return table data as JSON objects or JSON array

~ a Python script to connect to an Oracle Database from Python, using the python-oracledb driver, which has been previously installed from a Terminal window (python -m pip install oracledb)

~ The Python script is using Flask, calling the stored functions in the PL/SQL script and exposing a couple of web services that are returning Oracle table data in JSON format;

The advantage of running Python from VS Code is that you may use the debugger and setup break points to step from Python into PL/SQL for debugging, and step out back into Python

2. Testing the Python code and run SQL code in an Oracle Database using VS Code

3. Pushing the code into GitHub, which will trigger a GitHub Action to build the app into a container, and push it into Oracle Container Registry (OCR). The container can then be used in an Oracle Cloud Service.

Additionally, the demo shows how to use the Oracle Developer Tools for VS Code to connect to a local Oracle Database Express Edition. However, if you have an Oracle Cloud Account, connecting to an Oracle Autonomous Database works in a similar way. Check: https://www.oracle.com/database/technologies/appdev/odtvscodecloudsetup.html to find out more on how to connect to an Oracle Autonomous Database. When you create a new connection in Database Explorer, you’d need to download the Wallet in a local directory, and use the saved wallet file location.

Give it a try and drop me a comment with what other content at the intersection of VS Code, Python and Oracle Database would you like to be covered in our next demos.

--

--

Veronica Dumitriu
Oracle Developers

Oracle Product Manager with a strong background in Analytics, currently focused on solving business decision-makers’ challenges using Python and Oracle Database