Saturday, May 11, 2019

ODBC driver Linux instructions

It is possible to connect to NetSuite ODBC interface from Linux. This article brings instructions specific for Red Hat Linux.

Requirements:

  1. ODBC driver - can be downloaded from links in SuiteArticle Alternative way of installing NetSuite ODBC on Linux
  2. Red Hat Linux system
Instructions:
  1. Create a user that will own the odbc driver (root privileges needed)
    # useradd -d /home/netsuiteodbc netsuiteodbc
  2. Assign a password to the netsuiteodbc user
    # passwd netsuiteodbc
  3. Copy the downloaded odbc driver files to netsuiteodbc home directory /home/netsuiteodbc as user netsuiteodbc home
  4. Log in to the Linux system as user netsuiteodbc
  5. Replace all paths beginning "/usr" with "/home/netsuiteodbc" in files:
    • /home/netsuiteodbc/oaodbc60/odbc.ini
    • /home/netsuiteodbc/oaodbc60/odbcinst.ini
    • /home/netsuiteodbc/oaodbc60/oaodbc.sh
  6. In /home/netsuiteodbc/oaodbc60/odbc.ini change "Host" from "odbcserver.netsuite.com" to "odbcserver.na1.netsuite.com"
  7. Make the driver application executable
    $ chmod 700 /home/netsuiteodbc/oaodbc60/tools/odbcisql
  8. Adjust environment with driver variables
    $ source /home/netsuiteodbc/oaodbc60/oaodbc.sh
  9. Run the odbc application
    $ /home/netsuiteodbc/oaodbc60/tools/odbcisql -m 0
  10. Connect to NetSuite (connection string is in form "email"*"password"@netsuite)
    ISQL> connect "john.doe@gmail.com"*"mypassword"@netsuite

Example - connect to NetSuite:
source /home/netsuiteodbc/oaodbc60/oaodbc.sh/home/netsuiteodbc/oaodbc60/tools/odbcisql -m 0ISQL> connect "john.doe@gmail.com"*"mypassword"@netsuiteISQL> select count(*) from transaction_lines;COUNT(*)75011Rows selected = 1SQL: Operation successful.Elapsed time 903 ms.Elapsed time: Prepare 136 ms.    Execute 185 ms.         Fetch results 582 ms.ISQL>

No comments:

Post a Comment