linux teradata ODBC SQLConnect Error

Connectivity

linux teradata ODBC SQLConnect Error


 


I can successfully connect to DB2 using my odbc files. But when I try it with Teradata I get the following error:

$ /opt/teradata/client/13.10/odbc_64/samples/C/adhoc
/opt/teradata/client/13.10/odbc_64/samples/C/adhoc: /usr/lib64/libodbc.so: no version information available (required by /opt/teradata/client/13.10/odb c_64/samples/C/adhoc)

Enter Data Source Name: TDProd
Enter UserID: <username>
Enter Password: *****

Connecting with SQLConnect(DSN=TDProd,UID=walkera,PWD=*)...

adhoc: SQLError() couldn't find text, RC=100

ODBC connection closed.

In my odbc.ini file I have the following entries:

[ODBC]
InstallDir=/opt/teradata/client/13.10/odbc_64
Trace=0
TraceDll=/opt/teradata/client/13.10/odbc_64/lib/odbctrac.so
TraceFile=/usr/joe/odbcusr/trace.log
TraceAutoStop=0

[ODBC Data Sources]
testdsn=tdata.so

[testdsn]
Driver=/opt/teradata/client/13.10/odbc_64/lib/tdata.so
Description=Teradata running Teradata V1R5.2
DBCName=*******
LastUser=
Username=
Password=
Database=
DefaultDatabase=

And in my odbcinst.ini file I have this entry for Teradata:

[ODBC DRIVERS]
Teradata=Installed

# Example driver definitions

# Driver for Teradata
[Teradata]
Driver=/opt/teradata/client/13.10/odbc_64/lib/tdata.so
APILevel=CORE
ConnectFunctions=YYY
DriverODBCVer=3.51
SQLLevel=1

Any idea what I'm doing wrong here? BTEQ works fine

BTEQ 13.10.00.06 Tue Jul 28 17:12:52 2015

+---------+---------+---------+---------+---------+---------+---------+----

.RUN FILE /home/<username>/TDlogin;
+---------+---------+---------+---------+---------+---------+---------+----
.logmech ldap
+---------+---------+---------+---------+---------+---------+---------+----
.LOGON ****/<username>,

*** Logon successfully completed.
*** Teradata Database Release is 14.00.04.09
*** Teradata Database Version is 14.00.04.09
*** Transaction Semantics are BTET.
*** Session Character Set Name is 'ASCII'.

*** Total elapsed time was 1 second.

+---------+---------+---------+---------+---------+---------+---------+----
*** Warning: EOF on INPUT stream.
+---------+---------+---------+---------+---------+---------+---------+----

.EXPORT DATA FILE=/home/<username>/output;
*** To reset export, type .EXPORT RESET
+---------+---------+---------+---------+---------+---------+---------+----
.set RECORDMODE OFF;
+---------+---------+---------+---------+---------+---------+---------+----
.set separator ","
+---------+---------+---------+---------+---------+---------+---------+----
.set heading '';
+---------+---------+---------+---------+---------+---------+---------+----
.set footing '';
+---------+---------+---------+---------+---------+---------+---------+----
.set titledashes off;
+---------+---------+---------+---------+---------+---------+---------+----
.set quiet on;
*** Type QUIET OFF; to resume output.

+---------+---------+---------+---------+---------+---------+---------+----

HELP COLUMN ESA_VIEWS.VDDA_FACT.*;
*** Total elapsed time was 2 seconds.

+---------+---------+---------+---------+---------+---------+---------+----

.EXPORT RESET
*** Output returned to console.
+---------+---------+---------+---------+---------+---------+---------+----

.LOGOFF
*** You are now logged off from the DBC.
+---------+---------+---------+---------+---------+---------+---------+----

.EXIT
*** Exiting BTEQ...
*** RC (return code) = 0




Tags (4)
5 REPLIES
Junior Contributor

Re: linux teradata ODBC SQLConnect Error

What's your ODBC driver release?

The first thing I would do is upgrading to a newer ODBC-version: ODBC Linux

Even the latest release 15.10.00.00 is still compatible with TD14.

Re: linux teradata ODBC SQLConnect Error

$ isql -v testdsn walkera *******
*** glibc detected *** isql: free(): invalid pointer: 0x00007fa48754ab34 ***
======= Backtrace: =========
/lib64/libc.so.6[0x3c9fe75e66]
/opt/teradata/client/15.10/lib64/tdata.so(OS_Catopen+0x93)[0x7fa4876334c3]
/opt/teradata/client/15.10/lib64/tdata.so(_Z8AllocEnvPPv+0x124)[0x7fa487550284]
/opt/teradata/client/15.10/lib64/tdata.so(SQLAllocHandle+0x222)[0x7fa4875521c2]
/usr/lib64/libodbc.so.2[0x3e1360ea94]
/usr/lib64/libodbc.so.2(SQLConnect+0x167)[0x3e1360f877]
isql[0x4037e9]
/lib64/libc.so.6(__libc_start_main+0xfd)[0x3c9fe1ed5d]
isql[0x4015d9]
======= Memory map: ========
00400000-00406000 r-xp 00000000 fd:00 159350                             /usr/bin/isql
00606000-00607000 rw-p 00006000 fd:00 159350                             /usr/bin/isql
00a25000-00a67000 rw-p 00000000 00:00 0                                  [heap]
3c9f600000-3c9f620000 r-xp 00000000 fd:00 159417                         /lib64/ld-2.12.so
3c9f81f000-3c9f820000 r--p 0001f000 fd:00 159417                         /lib64/ld-2.12.so
3c9f820000-3c9f821000 rw-p 00020000 fd:00 159417                         /lib64/ld-2.12.so
3c9f821000-3c9f822000 rw-p 00000000 00:00 0
3c9fa00000-3c9fa02000 r-xp 00000000 fd:00 159470                         /lib64/libdl-2.12.so
3c9fa02000-3c9fc02000 ---p 00002000 fd:00 159470                         /lib64/libdl-2.12.so
3c9fc02000-3c9fc03000 r--p 00002000 fd:00 159470                         /lib64/libdl-2.12.so
3c9fc03000-3c9fc04000 rw-p 00003000 fd:00 159470                         /lib64/libdl-2.12.so
3c9fe00000-3c9ff8a000 r-xp 00000000 fd:00 159418                         /lib64/libc-2.12.so
3c9ff8a000-3ca018a000 ---p 0018a000 fd:00 159418                         /lib64/libc-2.12.so
3ca018a000-3ca018e000 r--p 0018a000 fd:00 159418                         /lib64/libc-2.12.so
3ca018e000-3ca018f000 rw-p 0018e000 fd:00 159418                         /lib64/libc-2.12.so
3ca018f000-3ca0194000 rw-p 00000000 00:00 0
3ca0200000-3ca0217000 r-xp 00000000 fd:00 139609                         /lib64/libpthread-2.12.so
3ca0217000-3ca0417000 ---p 00017000 fd:00 139609                         /lib64/libpthread-2.12.so
3ca0417000-3ca0418000 r--p 00017000 fd:00 139609                         /lib64/libpthread-2.12.so
3ca0418000-3ca0419000 rw-p 00018000 fd:00 139609                         /lib64/libpthread-2.12.so
3ca0419000-3ca041d000 rw-p 00000000 00:00 0
3ca0600000-3ca0607000 r-xp 00000000 fd:00 159432                         /lib64/librt-2.12.so
3ca0607000-3ca0806000 ---p 00007000 fd:00 159432                         /lib64/librt-2.12.so
3ca0806000-3ca0807000 r--p 00006000 fd:00 159432                         /lib64/librt-2.12.so
3ca0807000-3ca0808000 rw-p 00007000 fd:00 159432                         /lib64/librt-2.12.so
3ca0e00000-3ca0e83000 r-xp 00000000 fd:00 159464                         /lib64/libm-2.12.so
3ca0e83000-3ca1082000 ---p 00083000 fd:00 159464                         /lib64/libm-2.12.so
3ca1082000-3ca1083000 r--p 00082000 fd:00 159464                         /lib64/libm-2.12.so
3ca1083000-3ca1084000 rw-p 00083000 fd:00 159464                         /lib64/libm-2.12.so
3ca1200000-3ca121d000 r-xp 00000000 fd:00 136569                         /lib64/libtinfo.so.5.7
3ca121d000-3ca141d000 ---p 0001d000 fd:00 136569                         /lib64/libtinfo.so.5.7
3ca141d000-3ca1421000 rw-p 0001d000 fd:00 136569                         /lib64/libtinfo.so.5.7
3ca2a00000-3ca2ae8000 r-xp 00000000 fd:00 159468                         /usr/lib64/libstdc++.so.6.0.13
3ca2ae8000-3ca2ce8000 ---p 000e8000 fd:00 159468                         /usr/lib64/libstdc++.so.6.0.13
3ca2ce8000-3ca2cef000 r--p 000e8000 fd:00 159468                         /usr/lib64/libstdc++.so.6.0.13
3ca2cef000-3ca2cf1000 rw-p 000ef000 fd:00 159468                         /usr/lib64/libstdc++.so.6.0.13
3ca2cf1000-3ca2d06000 rw-p 00000000 00:00 0
3ca3600000-3ca3616000 r-xp 00000000 fd:00 137568                         /lib64/libgcc_s-4.4.7-20120601.so.1
3ca3616000-3ca3815000 ---p 00016000 fd:00 137568                         /lib64/libgcc_s-4.4.7-20120601.so.1
3ca3815000-3ca3816000 rw-p 00015000 fd:00 137568                         /lib64/libgcc_s-4.4.7-20120601.so.1
3e12e00000-3e12e09000 r-xp 00000000 fd:00 139258                         /usr/lib64/libltdl.so.7.2.1
3e12e09000-3e13008000 ---p 00009000 fd:00 139258                         /usr/lib64/libltdl.so.7.2.1
3e13008000-3e13009000 rw-p 00008000 fd:00 139258                         /usr/lib64/libltdl.so.7.2.1
3e13600000-3e1365f000 r-xp 00000000 fd:00 152332                         /usr/lib64/libodbc.so.2.0.0
3e1365f000-3e1385e000 ---p 0005f000 fd:00 152332                         /usr/lib64/libodbc.so.2.0.0
3e1385e000-3e13866000 rw-p 0005e000 fd:00 152332                         /usr/lib64/libodbc.so.2.0.0
3e13866000-3e13867000 rw-p 00000000 00:00 0
3f5ca00000-3f5ca16000 r-xp 00000000 fd:00 142561                         /lib64/libnsl-2.12.so
3f5ca16000-3f5cc15000 ---p 00016000 fd:00 142561                         /lib64/libnsl-2.12.so
3f5cc15000-3f5cc16000 r--p 00015000 fd:00 142561                         /lib64/libnsl-2.12.so
3f5cc16000-3f5cc17000 rw-p 00016000 fd:00 142561                         /lib64/libnsl-2.12.so
3f5cc17000-3f5cc19000 rw-p 00000000 00:00 0
3f69800000-3f6983a000 r-xp 00000000 fd:00 142572                         /lib64/libreadline.so.6.0
3f6983a000-3f69a3a000 ---p 0003a000 fd:00 142572                         /lib64/libreadline.so.6.0
3f69a3a000-3f69a42000 rw-p 0003a000 fd:00 142572                         /lib64/libreadline.so.6.0
3f69a42000-3f69a43000 rw-p 00000000 00:00 0
7fa48635f000-7fa487144000 r-xp 00000000 fd:02 10653                      /opt/teradata/client/15.10/lib64/libddicu27.so
7fa487144000-7fa487243000 ---p 00de5000 fd:02 10653                      /opt/teradata/client/15.10/lib64/libddicu27.so
7fa487243000-7fa487254000 rw-p 00de4000 fd:02 10653                      /opt/teradata/client/15.10/lib64/libddicu27.so
7fa487254000-7fa487256000 rw-p 00000000 00:00 0
7fa487256000-7fa48735c000 r-xp 00000000 fd:02 10655                      /opt/teradata/client/15.10/lib64/libodbcinst.so
7fa48735c000-7fa48745c000 ---p 00106000 fd:02 10655                      /opt/teradata/client/15.10/lib64/libodbcinst.so
7fa48745c000-7fa487484000 rw-p 00106000 fd:02 10655                      /opt/teradata/client/15.10/lib64/libodbcinst.so
7fa487484000-7fa487485000 rw-p 00000000 00:00 0
7fa487485000-7fa487725000 r-xp 00000000 fd:02 10659                      /opt/teradata/client/15.10/lib64/tdata.so
7fa487725000-7fa487824000 ---p 002a0000 fd:02 10659                      /opt/teradata/client/15.10/lib64/tdata.so
7fa487824000-7fa48782d000 rw-p 0029f000 fd:02Aborted (core dumped)

Re: linux teradata ODBC SQLConnect Error

After upgrading like you suggested, I am now getting invalid pointer errors.

Re: linux teradata ODBC SQLConnect Error

I've run into the same problem when running the adhoc example supplied with the drivers. Is there a problem with this release? Or are we doing something wrong here?

Re: linux teradata ODBC SQLConnect Error

Running my the program tdxodbc64 through gdb, and I got that libc.so.6 was throwing the abort message. Doing some research on that, and I came across this article:

http://www-01.ibm.com/support/docview.wss?uid=swg21648395

Basically, the standard c library can be a bit buggy sometimes, and if the env variable $MALLOC_CHECK_ is not 0, it can cause some wonky behavior. This worked for me, but now I'm getting some SQL error that probably has to do with my host configuration, but I figured I'd put down my findings on this matter anyway.

Hope this helps!