gpt4 book ai didi

linux teradata ODBC SQLConnect 错误

转载 作者:塔克拉玛干 更新时间:2023-11-03 01:27:52 26 4
gpt4 key购买 nike

我可以使用我的 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

最佳答案

当它加载/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

关于linux teradata ODBC SQLConnect 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31687278/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com