SQL command for setting connection option to return generated keys

Database
sdc
N/A

SQL command for setting connection option to return generated keys

Hello,

I am setting the following parameter in a connection string:

ReturnGeneratedKeys="C"

Instead, I'd like to set this option via an SQL command after having made the connection.  What is the command to do so?

The reason I'd like to know is that I'd like to change my Python application (employing PyTd) to accept user-made connection objects and then set them up properly for the application, which requires ReturnGeneratedKeys="C".  This will relieve the user of the need to set up their connection according to the internal needs of my application.  Instead, they establish the connection, give it to my application, and the application will set the option as needed.

I've done extensive searching and found the following tidbits which may be relevevant, but which aren't leading me to the solution I want.

  1. Using the SQL_ATTR_AGKR connection attribute in a call to SQLSetConnectAttr
  2. Using the SQL_ATTR_AGKR statement attribute in a call to SQLSetStmtAttr
  3. SET RETURNGENERATEDKEYS COLUMN (doesn't work, SYNTAX ERROR)
2 REPLIES
sdc
N/A

Re: SQL command for setting connection option to return generated keys

Any insight, anyone? (Bump)

Teradata Employee

Re: SQL command for setting connection option to return generated keys

There is no SQL statement to change this option. And PyTd doesn't allow you to access a Statement object directly.

Have you considered using an external configuration file?