This code shows how to run basic SQL from Python to query InterSystems IRIS databases using the Python DB-API.
This sample is used in Querying InterSystems IRIS with the Python DB-API.
- Prepare a running instance of InterSystems IRIS, or launch a lab from the exercise associated with this repository.
- Install the
intersystems-irispythonlibrary in your Python environment using the following command:
pip install intersystems-irispython
- Update connection information in the
DBAPIQuickstart.pyfile to match your InterSystems IRIS instance. For example:
HOST = "localhost"
PORT = 1972
USER = "tech"
PASSWORD = "demo"
NAMESPACE = "USER"
- You can run the
DBAPIQuickstart.pyfile to query the InterSystems IRIS database via the Python DB-API.
cd src
python DBAPIQuickstart.py
To continue with a video about Python development strategies, see Evaluating Python Development Strategies.