ODBC Driver for SurveyMonkey

Build 23.0.8839

データのクエリ

接続 後、SQL ステートメントを実行して結果を取得できます。

SELECT プロシージャ

SQL を実行する前にカーソルを取得する必要があります。取得したら、カーソルのexecute メソッドを使用できます。

cursor = cnxn.cursor()
cursor.execute("SELECT RespondentId, ChoiceId FROM MySurvey_Responses WHERE ChoiceText = 'blue'")

結果の反復処理

for loop を使用して、結果セットの行を反復することができます。各行はカラム値を含むタプルとして表示されます。

for (RespondentId, ChoiceId) in cursor:
    print("RespondentId = {}, ChoiceId = {}".format(RespondentId, ChoiceId))

Copyright (c) 2024 CData Software, Inc. - All rights reserved.
Build 23.0.8839