Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

Re^4: DBD::ODBC to Teradata

by DanEllison (Beadle)
on Nov 10, 2010 at 19:28 UTC ( #870656=note: print w/replies, xml ) Need Help??

in reply to Re^3: DBD::ODBC to Teradata
in thread DBD::ODBC to Teradata

I am 'making' unixODBC the same regardless of version. I am using the same DB2 driver (which I believe is 64bit) with both versions successfully.

I have both 32bit and 64bit drivers for Teradata, and where the 32bit driver works with isql, the 64bit complains about the 'magic' number in 2.2.11. In 2.3.0, both 32bit and 64bit cannot open and neither refer to the magic number.

As a side note my Teradata client is 13.0 and it comes with it's own libodbc.a, libodbcinst.a, and more. So, the order of Teradata to unixODBC in my LIBPATH also becomes important.

The last 50 of unixODBC.log follows:

[ODBC][749914][SQLDriverConnect.c][678] Entry: Connection = 20539e08 Window Hdl = 0 Str In = [nhitest][length = 7] Str Out = 2ff21c14 Str Out Max = 512 Str Out Ptr = 2ff21a10 Completion = 0 UNICODE Using encoding ASCII 'ISO8859-1' and UNICODE ' +UCS-2' [ODBC][749914][SQLDriverConnect.c][1258] Exit:[SQL_ERROR] [ODBC][749914][SQLError.c][424] Entry: Connection = 20539e08 SQLState = 2ff217a8 Native = 2ff217a4 Message Text = 2ff217b0 Buffer Length = 511 Text Len Ptr = 2ff217a0 [ODBC][749914][SQLError.c][461] Exit:[SQL_NO_DATA] [ODBC][749914][SQLConnect.c][3549] Entry: Connection = 20539e08 Server Name = [nhitest][length = 7] User Name = [delli28][length = 7] Authentication = [********][length = 8] UNICODE Using encoding ASCII 'ISO8859-1' and UNICODE ' +UCS-2' [ODBC][749914][SQLConnect.c][4123] Exit:[SQL_SUCCESS] [ODBC][749914][SQLSetConnectAttr.c][318] Entry: Connection = 20539e08 Attribute = SQL_ATTR_AUTOCOMMIT Value = 1 StrLen = 0 [ODBC][749914][SQLSetConnectAttr.c][671] Exit:[SQL_SUCCESS] [ODBC][749914][SQLGetInfo.c][214] Entry: Connection = 20539e08 Info Type = SQL_DRIVER_ODBC_VER (77) Info Value = 20537b84 Buffer Length = 20 StrLen = 2ff21980 [ODBC][749914][SQLGetInfo.c][501]Error: IM001

Replies are listed 'Best First'.
Re^5: DBD::ODBC to Teradata
by mje (Curate) on Nov 11, 2010 at 09:26 UTC
    the 64bit complains about the 'magic' number in 2.2.11

    To me that indicates the isql you are using with 2.2.11 is built 32bit.

    In 2.3.0, both 32bit and 64bit cannot open and neither refer to the magic number

    I have no idea what is. To my knowledge it is not something in unixODBC or DBD::ODBC.

    my Teradata client is 13.0 and it comes with it's own libodbc.a, libodbcinst.a

    But what are these archives? Are they teradata's builds of unixODBC?

    The log shows SQLGetInfo failing with IM001 which is "Driver does not support this function". An ODBC driver cannot not support SQLGetInfo or how can any application find out anything about how the driver works. This would indicate some other problem and I think you are best going back to Teradata with this problem or posting to the unixodbc help mailing list as I'm told some Teradata people hang out there.

    UPDATE: You can add "DisableGetFunctions = 1" to the driver entry in odbcinst.ini and that tells unixODBC to ignore SQLGetFunctions returned by the driver and just call the function. It may be Teradata here is saying it does not support SQLGetInfo when in fact it must.

    UPDATE: You could also try rerunning your Perl code with PERL_DL_NONLAZY environment variable set to 1. is the Teradata driver. I don't understand why 2.3.0 wouldn't be able to open it, when 2.2.11 is obviously using it.

      I find that the Teradata client ships with DataDirect ODBC with it. I found this document,, for configuring the DataDirect, but I get new errors. Still playing...

      The DisableGetFunctions didn't seem to have any effect.

      Okay! I got it going with the DataDirect ODBC that was shipped with the Teradata client. My first problem, although InstallDir pointed to a directory with my ini's and libs, it didn't have locale info which is why I wasn't getting my messages. Secondly, DataDirect apparently doesn't use the odbcinst.ini so I had to directly identify my driver in the .odbc.ini.

      After getting it to work with DataDirect, I went back to see if I could get it working with unixODBX. Under 2.2.11, was trying to open shared objects that existed in DataDirect and don't exist in unixODBC. 2.3.0 couldn't open the driver at all.

      To get the DBD-ODBC to compile with DataDirect, I had to make similar modifications to the Makefile.PL as were described in the document My diff looks like:

      diff Makefile.DataDirect Makefile.PL 448,450d447 < $myodbc = 'intersolve' < if !$myodbc && -f "$odbchome/include/sqlunx.h"; < 463a461,463 > $myodbc = 'intersolve' > if !$myodbc && -f "$odbchome/include/qeodbc.h"; > 627c627 < #print {$sqlhfh} qq{#include <qeodbc.h>\n}; --- > print {$sqlhfh} qq{#include <qeodbc.h>\n}; 631,632c631 < #print {$sqlhfh} qq{#include <sql.h>\n#include <sqltypes.h +>\n#include <sqlext.h>\n}; < print {$sqlhfh} qq{#include <sql.h>\n#include <sqltypes.h> +\n#include <sqlext.h>\n#include <sqlucode.h>\n}; --- > print {$sqlhfh} qq{#include <sql.h>\n#include <sqltypes.h> +\n#include <sqlext.h>\n};

      The Teradata client install builds a link /usr/odbc for ODBCHOME, but it didn't include includes or odbc_config so I found it better to set ODBCHOME directly to /opt/teradata/client/13.0/odbc_32 for building. InstallDir could still point to link /usr/odbc.

        Okay, I'm back...

        We've moved from the 32bit AIX environment to a 64bit Linux environment. I've followed my prescription from my previous troubles with no joy. DBD::ODBC compiles, but make test hangs in 05meth. If I install anyway and run, I get a Memory Fault.

        When I compiled, there are plenty of warnings of unused variables and differing signedness which makes me uneasy.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://870656]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (5)
As of 2018-05-26 12:17 GMT
Find Nodes?
    Voting Booth?