CData Python Connector for Stripe

Build 23.0.8839

データの変更

"execute()" を呼び出してセッションで個別にコマンドを実行できます。

テーブルオブジェクトの取得

このメソッドに提供されるクエリは、マップされたクラスの関連するTable オブジェクトを使用して構築されます。このTable オブジェクトは、以下のように、マップされたクラスのメタデータフィールドから取得されます。

Customers_table = Customers.metadata.tables["Customers"]

テーブルオブジェクトが取得されると、次の方法で書き込み操作が実行されます。クエリは"commit()" を呼び出すことなく即座に実行されます。

Insert

次の例では、テーブルに新しいレコードを追加します。

session.execute(Customers_table.insert(), {"Discount": "sales@northwind.net", "Email": "sales@grandhotels.com"})

Update

次の例では、テーブル内の既存のレコードを変更します。

session.execute(Customers_table.update().where(Customers_table.c.Id == "123456").values(Discount="sales@northwind.net", Email="sales@grandhotels.com"))

Delete

次の例では、テーブルから既存のレコードを削除します。

session.execute(Customers_table.delete().where(Customers_table.c.Id == "123456"))

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