Help using Base SAS procedures

How to set up an ODBC connection to Oracle/DB2 from Unix

Accepted Solution Solved
Reply
Super Contributor
Super Contributor
Posts: 444
Accepted Solution

How to set up an ODBC connection to Oracle/DB2 from Unix

[ Edited ]

a copy of the  odbc.ini file which is saved in my unix home directory does not have anyhting that points to
odbc connection to db2 or  oracle.Only to SQL Server so i am wondering how i am able to
access databases  in oracle and db2 from UNIX?


Accepted Solutions
Solution
‎03-29-2017 08:51 PM
Super User
Posts: 3,261

Re: How to set up an ODBC connection to Oracle/DB2 from Unix

Well I know it is possible with some ODBC database connections to specify the connection completely in a connection string without storing definitions elsewhere. I do it with ODBC and SQL Server under Windows. However I don't have access to Unix and DB2 to try out.

 

If it is possible with ODBC DB2 under Unix then I would expect a complete connection string would look like this:

 

https://www.connectionstrings.com/ibm-db2-odbc/

 

How do you define a working ODBC DB2 connection? If it doesn't contain a connection string I can only assume it referencing a connection definition somewhere else like Oracle's TNSNAMES.ORA. 

View solution in original post


All Replies
Super User
Posts: 3,261

Re: How to set up an ODBC connection to Oracle/DB2 from Unix

Reading the recommendations for your post is a good start like this one.

 

https://communities.sas.com/t5/SAS-Communities-Library/A-quick-guide-to-connecting-to-Oracle-from-SA...

Super Contributor
Super Contributor
Posts: 444

Re: How to set up an ODBC connection to Oracle/DB2 from Unix

Thanks Reeza for editing my post. No clue  how i forgot the subject line and i aplogize about it.

SASKiwi thanks for the article.

What i was saying is i do have access to oracle and db2 with no problems but i dont see anyhting in the odbc.ini file that points to these 2 engines.

I mean ok i do have the tnsnames.ora saved in oracle/network/admin....and  i guess that takes  care of the oracle connection but what about the DB2? How come i am still able to read/write  from DB2 if i dont have those queries in  the odbc.ini

Solution
‎03-29-2017 08:51 PM
Super User
Posts: 3,261

Re: How to set up an ODBC connection to Oracle/DB2 from Unix

Well I know it is possible with some ODBC database connections to specify the connection completely in a connection string without storing definitions elsewhere. I do it with ODBC and SQL Server under Windows. However I don't have access to Unix and DB2 to try out.

 

If it is possible with ODBC DB2 under Unix then I would expect a complete connection string would look like this:

 

https://www.connectionstrings.com/ibm-db2-odbc/

 

How do you define a working ODBC DB2 connection? If it doesn't contain a connection string I can only assume it referencing a connection definition somewhere else like Oracle's TNSNAMES.ORA. 

Super Contributor
Super Contributor
Posts: 444

Re: How to set up an ODBC connection to Oracle/DB2 from Unix

I asked for an updated odbc.ini and again nothing that ponts to ibm db2 odbc...
I guess there must be some hidden script then..

Cheers
☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 4 replies
  • 360 views
  • 0 likes
  • 2 in conversation