tests.system.ibm.db2.example_db2¶
Example Dag demonstrating the Db2 Provider.
This Dag shows how to use the Db2 provider for common database operations:
Using SQLExecuteQueryOperator with Db2Hook for SQL execution
Using Db2Hook for programmatic queries
Creating tables and inserting data
Querying and processing results
Prerequisites:
Install the Db2 provider:
pip install apache-airflow-providers-ibm-db2Configure a Db2 connection in the Airflow UI or set the environment variable
AIRFLOW_CONN_DB2_DEFAULT='db2://user:password@host:port/database'
Attributes¶
Functions¶
Drop tables if they exist to ensure clean state. |