[ODBC question] I have a question about ODBC connection

Hi everyone

I am writing to you to help about connecting Oracle using the ODBC.

I have to connect to an Oracle Database that is RAC Environment using a SID.

I currently try to connect to an Oracle database using ODBC in C, linux.

I just need a ODBC connection string in C.

I use below connect string. (I have to need a SID due to distinguish of database in RAC Environment)

*char connect_string = "Driver={/lib/libsqora.so};Server=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.192.192.192)(PORT=1521))(CONNECT_DATA=(SID=ORASID)));Uid=test;Pwd=test;";

or

*char connect_string = "Driver={/lib/libsqora.so};Server=192.192.192.192:1521@ORASID;Uid=test;Pwd=test;";

is that wrong? cannot connect to an Oracle.

Error Msg is HY000:1:12162:[unixODBC][Oracle][ODBC][Ora]ORA-12162: TNS:net service name is
incorrectly specified.

Please help me.

I look forward to your reply.

0 answers