Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Using ODBC to connect to Oracle under Linux

Re: Using ODBC to connect to Oracle under Linux

From: Maxim Demenko <mdemenko_at_gmail.com>
Date: Mon, 19 Sep 2005 14:54:20 +0200
Message-ID: <dgmcds$15a$05$1@news.t-online.com>


Leandro Dardini schrieb:
> Hi,
> installing the latest Oracle 10 client on Linux I install also the ODBC
> driver. My purpose is to use (unix)ODBC to connect to Oracle from a wide
> range of application running under Linux, from php to simple CLI using isql.
> Oracle 10 client fills my odbcinst.ini with the following data:
>
> [Oracle]
> Description = ODBC for Oracle
> Driver = /usr1/oracle/product/10.2.0/client_1/lib/hsdb_odbc.so
> Setup =
> FileUsage = 1
> CPTimeout =
> CPReuse =
>
> But I don't know what data to put in the odbc.ini to let my applications
> to connect to my database. I have a correctly filled tnsnames.ora who
> let me to connect to database with sqlplus.
>
> ORCL_DBSVILUPPO =
> (DESCRIPTION =
> (ADDRESS_LIST =
> (ADDRESS = (PROTOCOL = TCP)(HOST = DBSVILUPPO)(PORT = 1521))
> )
> (CONNECT_DATA = (SID = ORCL)(SERVER = DEDICATED))
> )
>
> Is there anyone who know how to fill odbc.ini and can provide me an example?
>
> Thank you
>
> Leandro

You may be interested to have a look in delivered documentation: http://download-uk.oracle.com/docs/cd/B19306_01/install.102/b15662/post_inst_task.htm#sthref378

There is an example of odbc.ini as well odbcinst.ini, i've tried these settings ( only two things i had to customize was path to shared library   and tnsnames.ora entry) and it worked out of the box.

oracle_at_col-fc1-01:/opt/oracle/product/10gR2/network/admin >isql Oracle10gODBCDriver scott/tiger

+---------------------------------------+
| Connected!                            |
|                                       |
| sql-statement                         |
| help [tablename]                      |
| quit                                  |
|                                       |
+---------------------------------------+
SQL> select table_name from tabs;
+-------------------------------+
| TABLE_NAME                    |
+-------------------------------+
| DEPT                          |
| EMP                           |
| BONUS                         |
| SALGRADE                      |
+-------------------------------+

4 rows returned
SQL> Btw, according to documentation, the delivered odbc driver is not hsdb_odbc.so, but libsqora.so.10.1

Best regards

Maxim Received on Mon Sep 19 2005 - 07:54:20 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US