Teradata Python Module

Tools
Tools covers the tools and utilities you use to work with Teradata and its supporting ecosystem. You'll find information on everything from the Teradata Eclipse plug-in to load/extract tools.
Teradata Employee

Re: Teradata Python Module

@dn186005 - The Teradata Python module looks for the config file relative to the working directory and not the directory the script is located in.   Try changing to the directory where your script is located before running it.

@MH186045 - The way you get column names is defined as part of the Python Database API 2.0 specification.  Here is an example:

cursor = conn.execute("SELECT * FROM Whatever")
for rowMetaData in cursor.description:
print("Column Name: " + rowMetaData[0])
Enthusiast

Re: Teradata Python Module

Hi Eric,

 I have python 2.6 (default location /usr/bin) and python 2.7 (/usr/local/bin)

 I'm getting following error, while tryign to install Teradata module. can you please help?

$ python2.7 ./setup.py install

Traceback (most recent call last):

  File "./setup.py", line 24, in <module>

    from setuptools import setup

ImportError: No module named setuptools

Teradata Employee

Re: Teradata Python Module

@aagrawal - Looks like you are missing the setuptools module.  Instructions to install it can be found here:  https://pypi.python.org/pypi/setuptools

Enthusiast

Re: Teradata Python Module

Thanks Eric,

    I got the modeule installed. Now I'm running my first 'HelloWorld" example and got followign error.

  File "build/bdist.linux-x86_64/egg/teradata/__init__.py", line 22, in <module>

  File "build/bdist.linux-x86_64/egg/teradata/udaexec.py", line 41, in <module>

  File "build/bdist.linux-x86_64/egg/teradata/tdrest.py", line 29, in <module>

  File "/usr/local/lib/python2.7/ssl.py", line 97, in <module>

    import _ssl             # if we can't import it, let the error propagate

ImportError: No module named _ssl

Teradata Employee

Re: Teradata Python Module

@aagrawal - If you're building python from source, make sure you are building it with SSL support.   For Python to be built with SSL support, the openssl header files need to be installed (e.g. install openssl-devel package).

Enthusiast

Re: Teradata Python Module

perfect. Thanks Eric. its working. great job.

Teradata Employee

Re: Teradata Python Module

Hi Eric,

As suggested by you,i tried to changing the directory but I am still facing the same error.

teradata.api.InterfaceError: ('CONFIG_ERROR', 'appName is a required field, it must be passed in as a parameter or specified in a config file.')





 





For some reason the config file is not being read.Please help.
 

Fan

Re: Teradata Python Module

How do you update the config file? I'm trying to build a gui and I want to allow the user to change the config file settings. 

Thanks,

Teradata Employee

Re: Teradata Python Module

Hi Eric.

I've been hapilly using your excellent module for a few months now. However, today I hit a snag and I'm unable to resolve.

I am using some simple code:

   for resultRow in DBSession.execute(sSQLStatement,ignoreErrors=[3807]):
if resultRow[0] is not None:
sDDL = resultRow[0]

to run a simple SHOW VIEW statement:

SHOW VIEW P1V_INP.TX030007_01_BD_BKKG_ACCNT_SA;

This is returning only 21333 characters of the view DDL, the full size being 26273 chars.

I'm stumped as to why this is happening.

The result set only has a single row, single column.

Can you give any pointers to help diagnose the reason for the truncation?

Thanks

E

Teradata Employee

Re: Teradata Python Module

Hi Eric.

I've been hapilly using your excellent module for a few months now. However, today I hit a snag and I'm unable to resolve.

I am using some simple code:

   for resultRow in DBSession.execute(sSQLStatement,ignoreErrors=[3807]):
if resultRow[0] is not None:
sDDL = resultRow[0]

to run a simple SHOW VIEW statement:

SHOW VIEW P1V_INP.TX030007_01_BD_BKKG_ACCNT_SA;

This is returning only 21333 characters of the view DDL, the full size being 26273 chars.

I'm stumped as to why this is happening.

The result set only has a single row, single column.

Can you give any pointers to help diagnose the reason for the truncation?

Thanks

E