Python Connector for Dynamics 365

Querying data - Python Connector for Dynamics 365

Querying data

Once connected to Dynamics 365, you can execute SQL queries to retrieve data from your Dynamics 365 data.

Execute a query

  1. Create a cursor object using the cursor() connection method.
    my_cursor = my_connection.cursor()
  2. Execute the SQL statement using the execute() cursor method.
    my_cursor.execute("SELECT * from product")
  3. Retrieve the result set using one of the fetch*() cursor methods.
    for row in my_cursor.fetchall(): 
        print(row)
© 2022-2026 Devart. All Rights Reserved. Request Support Python Connectors Forum Provide Feedback