CData Python Connector for Facebook Ads

Build 21.0.8137

Calling Stored Procedures

You can execute stored procedures using either the execute() or callproc() method of the connection.

Call Stored Procedures Using the Execute Method

Stored procedures can be called by issuing EXECUTE commands. The stored procedures parameters are parameterized, as in the following example:

cmd = "EXECUTE GetOAuthAccessToken AuthMode = ?"
params = ["APP"]
conn.execute(cmd, params)

Call Stored Procedures Using the Callproc Method

Rather than using "execute()", one can also use the callproc() method to execute the procedure. The method takes a procedure name and a list of parameters as its arguments:

cur = conn.cursor()
params = ["APP"]
cur.callproc("GetOAuthAccessToken", params)

Copyright (c) 2022 CData Software, Inc. - All rights reserved.
Build 21.0.8137