How do I find out what the error code is returned from executed sql statement. I dont want python to exit when a sql statement returns an error but I want to do some processing when a error occurs
It would be nice if we could get more granular control over logging levels. I like INFO level as a default but when running batch INSERTS with thousands of rows this actually logs every row passed to the INSERT statement resulting in a very large log file. I created my own logger and tried to change logging level to WARNING just for the INSERT using Python standard logger.setlevel function but that doesn't seem to work. Setlevel executes successfully but it does not seem to affect what is actually logged by Teradata module.
It would be great if there was an option to override session logging level through a parameter to Execute/Executemany.
Would it possible to make UdaExecConnection importable? A use case would be to have the connect object passed between functions. e.g.
def teradata_connect(configFile='udaexec.ini', logLevel='CRITICAL') :
@seabull - You can import it using "from teradata.udaexec import UdaExecConnection", but I would not recommend it as its not part of the interface exposed by UdaExec and could change at any time in the future. Its not clear why you would even want to do that, Python's duck typing makes it so you shouldn't need to care what the underlying type is, you can pass the connection object to different methods without importing UdaExecConnection. In your example, it appears you want to check if its a UdaExecConnection instance to test wheter to call close. A more pythonic way to do that, assuming any old object will be passed to the disconnect method would be to test for the existence of a close method on the passed in object. E.g.
closeOp = getattr(session, "close", None)