Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

oracle instant client OCCI runtime Error ORA-12162: TNS:net service name is incorrectly specified

jagdeep singhApr 13 2026

I m using oracle instant client 19 with C++ occi to connect to oracle 11g . I have setup the client on linux ubuntu 22.04 and setup all the enviournment and tns file exactly . When try with sqlplus connection is working perfectly . but when i try to run the c++ code it show runtime error ORA-12162: TNS:net service name is incorrectly specified. I have tried every single possible check setting enviournment in c++ code for tnsadmin and all possible sequence i have found. But still same error. Can anybody explain this. Why with same env same terminal sqlplus working but it is not in c++.

Comments
Post Details
Added on Apr 13 2026
1 comment
54 views