我可以使用我的odbc文件成功连接到DB2。但是当我用Teradata尝试时,我收到以下错误:
$ /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.
在我的odbc.ini文件中,我有以下条目:
[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=
在我的odbcinst.ini文件中,我有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
知道我在这里做错了吗? BTEQ工作正常
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
答案 0 :(得分:0)
当它加载位于/ usr / lib64而不是$ ODBCHOME / lib目录中的libodbc.so时会发生此问题。
来源:https://network.informatica.com/thread/20115
(在linux中)
它对我有用,更改LD_LIBRARY_PATH,使其查看/opt/teradata/client/XX.XX/lib64或/opt/teradata/client/XX.XX/lib32
你的程序makefile需要这个:-L / opt / teradata / client / 15.10 / lib64 -lodbc -lodbcinst -lddicuXX