Can we install odbc.ini with ClientUserID, ClientAcctString parameter in linux.

The Windows ODBC driver data source configuration has options to configure the data source for information such as ClientUserID, ClientAcctString, etc. These columns are also stored in the query history database and the customized DSN data will be displayed. I would like to know if the same and / or similar parameters can be configured in the odbc configuration for the Netezza client on Linux?

+3


source to share


1 answer


Yes, you can. The same parameters can be set in the linux ODBC.ini file and these values ​​will be transferred to the history database.

Here is an odbc.ini example that works for me.

;
;  odbc.ini
;
[ODBC Data Sources]
NZSQL = NetezzaSQL

[NZSQL]
Driver                = /usr/local/nz/lib64/libnzodbc.so
Description           = NetezzaSQL ODBC
Servername            = 192.168.118.128
Port                  = 5480
Database              = TESTDB
Username              = admin
Password              = somepassword
ReadOnly              = false
ShowSystemTables      = false
LegacySQLTables       = false
LoginTimeout          = 0
QueryTimeout          = 0
DateFormat            = 1
NumericAsChar         = false
SQLBitOneZero         = false
StripCRLF             = false
ClientUserID=someuser
ClientWorkStnName=someworkstation
ClientApplName=someapplication
ClientAcctString=someacctstring

[ODBC]
IANAAppCodePage=4
InstallDir=/opt/odbc32v51
Trace=0
TraceDll=/opt/odbc32v51/lib/odbctrac.so
TraceFile=odbctrace.out
UseCursorLib=0

      

Note that this will only affect ODBC connections, which means it will not work with the nzsql CLI. Here are two sample queries, one that uses ODBC and one that doesn't.



./nzodbcsql -n NZSQL -q "select current_date ODBC_TEST"

 ODBC_TEST
------------
 2015-07-10

Rows Returned : 1

 ./nzsql -h 192.168.118.128 -d testdb -u admin -pw password -c "select current_date NOTODBC_TEST"

 NOTODBC_TEST
--------------
 2015-07-10
(1 row)

      

Here's a history database query that shows the values ​​being passed to the history database.

select CLIENT_USER_ID, CLIENT_APPLICATION_NAME, CLIENT_WORKSTATION_NAME, CLIENT_ACCOUNTING_STRING, query from "$v_hist_queries" where submittime > '2015-07-08' and dbname='TESTDB' and query like '%ODBC_TEST%';
 CLIENT_USER_ID | CLIENT_APPLICATION_NAME | CLIENT_WORKSTATION_NAME | CLIENT_ACCOUNTING_STRING |                  QUERY
----------------+-------------------------+-------------------------+--------------------------+-----------------------------------------
 someuser       | someapplication         | someworkstation         | someacctstring           | select current_date ODBC_TEST
                |                         |                         |                          | select current_date NOTODBC_TEST
(2 rows)

      

+2


source







All Articles