{"id":411168,"date":"2024-06-29T21:48:46","date_gmt":"2024-06-29T21:48:46","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=411168"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=411168","title":{"rendered":"<span>Oracle Call Interface: \u043a\u0430\u043a \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 \u0421\u0438<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0425\u0430\u0431\u0440, \u043f\u0440\u0438\u0432\u0435\u0442! \u0412\u043e\u043e\u0431\u0449\u0435-\u0442\u043e \u044f \u043d\u0435 \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0438\u0439 <s>\u0441\u0432\u0430\u0440\u0449\u0438\u043a<\/s> \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442, \u044f \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0439 \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440 \u0438 \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440 \u0411\u0414. \u041f\u043e\u044d\u0442\u043e\u043c\u0443, \u043a\u043e\u0433\u0434\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043b\u0435\u0442 \u043d\u0430\u0437\u0430\u0434 \u043f\u0435\u0440\u0435\u0434\u043e \u043c\u043d\u043e\u0439 \u0432\u0441\u0442\u0430\u043b\u0430 \u0437\u0430\u0434\u0430\u0447\u0430 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u043a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u0440\u0443\u0442\u0438\u043d\u043d\u044b\u0445 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440, \u044f \u043f\u043e\u0442\u0440\u0430\u0442\u0438\u043b \u043d\u0435\u043c\u0430\u043b\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u0447\u0442\u043e\u0431\u044b \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0432 \u044d\u0442\u043e\u043c \u0432\u043e\u043f\u0440\u043e\u0441\u0435. \u0415\u0441\u043b\u0438 \u0432\u0434\u0440\u0443\u0433 \u0443 \u0432\u0430\u0441 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a\u0430\u044f \u0436\u0435 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f, \u043d\u0430\u0434\u0435\u044e\u0441\u044c, \u044d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u0441\u044d\u043a\u043e\u043d\u043e\u043c\u0438\u0442 \u0432\u0430\u0448\u0435 \u0432\u0440\u0435\u043c\u044f \u0438 \u0441\u0438\u043b\u044b.<\/p>\n<h2>\u0427\u0442\u043e \u043d\u0443\u0436\u043d\u043e?<\/h2>\n<p>\u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0432\u0448\u0438\u0441\u044c \u0441 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f\u043c\u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435.<\/p>\n<p><strong>\u0416\u0435\u043b\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0434\u043b\u044f \u0431\u0438\u043d\u0430\u0440\u043d\u0438\u043a\u0430:<\/strong><\/p>\n<ul>\n<li>\n<p>\u041d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0440\u0430\u0437\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430.<\/p>\n<\/li>\n<li>\n<p>\u041a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u0430\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0441\u043b\u0443\u0447\u0430\u0435\u0432, \u043a\u043e\u0433\u0434\u0430 OCI-\u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u043d\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430 <\/p>\n<\/li>\n<\/ul>\n<p><strong>\u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0434\u043b\u044f \u0431\u0438\u043d\u0430\u0440\u043d\u0438\u043a\u0430:<\/strong><\/p>\n<ul>\n<li>\n<p>\u0420\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0443\u0442\u0438\u043b\u0438\u0442\u0430 \u0434\u043e\u043b\u0436\u043d\u0430 \u043d\u0430 \u043b\u044e\u0431\u043e\u043c \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0435 \u0441 \u041e\u0421 Windows \u0432\u044b\u0448\u0435 Windows 7 \u0438\u043b\u0438 Windows Server 2008 \u0431\u0435\u0437 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u043a\u0430\u043a\u0438\u0445-\u043b\u0438\u0431\u043e \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u043e\u0432 \u0438 Runtime Environment. \u0414\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d \u0442\u043e\u043b\u044c\u043a\u043e \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u0438\u0437 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u043e\u0432 Oracle, \u0432\u043a\u043b\u044e\u0447\u0430\u044e\u0449\u0438\u0439 OCI-\u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443.<\/p>\n<\/li>\n<\/ul>\n<p><strong>\u041e\u0447\u0435\u043d\u044c \u0436\u0435\u043b\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0434\u043b\u044f \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u043e\u0432:<\/strong><\/p>\n<ul>\n<li>\n<p>\u0427\u0442\u043e\u0431\u044b \u0433\u043e\u0442\u043e\u0432\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u0435\u0437 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0430 \u0434\u0440\u0443\u0433\u043e\u043c \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0435 \u0431\u0435\u0437 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u043a\u0430\u043a\u0438\u0445-\u043b\u0438\u0431\u043e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a. \u0422\u0430\u043a \u043a\u0430\u043a \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u043f\u043e\u0445\u043e\u0436\u0438\u0439 legacy \u043f\u0440\u043e\u0435\u043a\u0442, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043b\u0435\u0442 20 \u043d\u0430\u0437\u0430\u0434 \u043f\u0438\u0441\u0430\u043b \u0434\u0430\u0432\u043d\u043e \u0443\u0448\u0435\u0434\u0448\u0438\u0439 \u0441\u043e\u0442\u0440\u0443\u0434\u043d\u0438\u043a. \u0415\u0433\u043e \u0440\u0430\u0431\u043e\u0447\u0443\u044e \u0441\u0442\u0430\u043d\u0446\u0438\u044e \u043c\u044b \u0445\u0440\u0430\u043d\u0438\u043c \u0432 \u0432\u0438\u0434\u0435 \u043e\u0431\u0440\u0430\u0437\u0430 \u0412\u041c, \u0442\u0430\u043a \u043a\u0430\u043a \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u0442\u044c \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 \u043d\u043e\u0432\u043e\u0439 \u0440\u0430\u0431\u043e\u0447\u0435\u0439 \u0441\u0442\u0430\u043d\u0446\u0438\u0438 &#8212; \u0437\u0430\u0434\u0430\u0447\u0430 \u043a\u0440\u0430\u0439\u043d\u0435 \u043d\u0435\u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u0430\u044f.<\/p>\n<\/li>\n<\/ul>\n<h2>\u041a\u0430\u043a\u0443\u044e \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u044e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c?<\/h2>\n<p>Oracle \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b:<\/p>\n<ul>\n<li>\n<p><strong>Pro*C\/C++<\/strong> &#8212; \u041f\u0440\u0435\u0434\u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 Oracle. \u0418\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0432\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u044b SQL \u0432 \u0445\u043e\u0441\u0442-\u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443 \u0432\u044b\u0441\u043e\u043a\u043e\u0433\u043e \u0443\u0440\u043e\u0432\u043d\u044f. \u041f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u043e\u0441\u043d\u043e\u0432\u043d\u0443\u044e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0432\u0445\u043e\u0434\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445, \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u0442 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 SQL \u0432 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435 \u0432\u044b\u0437\u043e\u0432\u044b \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 Oracle \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0438 \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u0438\u0441\u0445\u043e\u0434\u043d\u0443\u044e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u0441\u0432\u044f\u0437\u0430\u0442\u044c \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c. \u0420\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0441 \u044d\u0442\u0438\u043c \u0443 \u043c\u0435\u043d\u044f \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0438\u0447\u0435\u0433\u043e \u043a \u044d\u0442\u043e\u043c\u0443 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044e \u044f \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u0435 \u043c\u043e\u0433\u0443<\/p>\n<\/li>\n<li>\n<p><strong>C++ Call Interface (OCCI)<\/strong> &#8212; API, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u043c C++ \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0434\u0430\u043d\u043d\u044b\u043c \u0432 \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 Oracle. OCCI \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u0430\u043c \u043d\u0430 C++ \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u0435\u0441\u044c \u0441\u043f\u0435\u043a\u0442\u0440 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0441 \u0431\u0430\u0437\u0430\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 Oracle, \u0432\u043a\u043b\u044e\u0447\u0430\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0439 SQL \u0438 \u043c\u0430\u043d\u0438\u043f\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u043c\u0438. \u0422\u0430\u043a \u043a\u0430\u043a \u044f \u0421++ \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b, \u044d\u0442\u043e\u0442 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u043c\u043d\u0435 \u044f\u0432\u043d\u043e \u043d\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u043b <\/p>\n<\/li>\n<li>\n<p><strong>Oracle Call Interface (OCI)<\/strong> &#8212; API, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0438\u0435 \u0432\u044b\u0437\u043e\u0432\u044b \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0434\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 Oracle \u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0432\u0441\u0435\u043c\u0438 \u044d\u0442\u0430\u043f\u0430\u043c\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0439 SQL. OCI \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0442\u0438\u043f\u044b \u0434\u0430\u043d\u043d\u044b\u0445, \u0441\u043e\u0433\u043b\u0430\u0448\u0435\u043d\u0438\u044f \u043e \u0432\u044b\u0437\u043e\u0432\u0430\u0445, \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u0438 \u0441\u0435\u043c\u0430\u043d\u0442\u0438\u043a\u0443 C \u0438 C++. \u041e\u043d \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u043f\u043e\u0438\u0441\u043a\u0430 \u0432 \u0432\u0438\u0434\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0441\u0440\u0435\u0434\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f (\u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 OCI), \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0441\u0432\u044f\u0437\u0430\u043d\u0430 \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f. \u0422\u0430\u043a\u0436\u0435 \u0432 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0438 \u0443\u043a\u0430\u0437\u0430\u043d\u043e, \u0447\u0442\u043e \u0432\u0441\u0435 \u043e\u0440\u0430\u043a\u043b\u043e\u0432\u044b\u0435 \u0443\u0442\u0438\u043b\u0438\u0442\u044b (\u0442\u0438\u043f\u0430 sqlplus, exp, imp \u0438 \u043f\u0440\u043e\u0447\u0438\u0435) \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u044b \u0438\u043c\u0435\u043d\u043d\u043e \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c OCI. \u0427\u0442\u043e \u0436\u0435 \u0435\u0449\u0435 \u043d\u0443\u0436\u043d\u043e?<\/p>\n<\/li>\n<li>\n<p><strong>Oracle Database Programming Interface for C (ODPI-C)<\/strong> &#8212; \u044d\u0442\u043e C-\u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0441 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0443\u043f\u0440\u043e\u0449\u0430\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043e\u0431\u0449\u0438\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u0432\u044b\u0437\u043e\u0432\u043e\u0432 Oracle (OCI) \u0434\u043b\u044f \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u043e\u0432 \u0431\u0430\u0437 \u0434\u0430\u043d\u043d\u044b\u0445 Oracle \u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439. DPIC \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043f\u043e\u0432\u0435\u0440\u0445 OCI \u0438 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u0438\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a Oracle. \u041f\u0440\u043e\u0435\u043a\u0442 \u043b\u0435\u0436\u0438\u0442 \u043d\u0430 <a href=\"https:\/\/github.com\/oracle\/odpi\" rel=\"noopener noreferrer nofollow\">\u0413\u0438\u0442\u0445\u0430\u0431\u0435<\/a>. \u041f\u0440\u043e \u044d\u0442\u043e\u0442 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u044f \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u043b \u0442\u043e\u043b\u044c\u043a\u043e \u043a\u043e\u0433\u0434\u0430 \u043f\u0438\u0441\u0430\u043b \u044d\u0442\u0443 \u0441\u0442\u0430\u0442\u044c\u044e. \u041d\u043e, \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0432 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c, \u044f \u043d\u0438\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043d\u0435 \u043f\u043e\u0436\u0430\u043b\u0435\u043b, \u0447\u0442\u043e \u0432\u044b\u0431\u0440\u0430\u043b OCI. \u041c\u043e\u0436\u0435\u0442, \u044d\u0442\u043e \u0432\u043e\u043f\u0440\u043e\u0441 \u043f\u0440\u0438\u0432\u044b\u0447\u043a\u0438 \u0438 \u043e\u043f\u044b\u0442\u0430, \u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u044d\u0442\u0430 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u043c\u043d\u0435 \u043d\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u0430\u0441\u044c.<\/p>\n<\/li>\n<\/ul>\n<h2>\u041f\u0438\u0448\u0435\u043c \u043f\u0440\u043e\u0441\u0442\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435<\/h2>\n<h3>\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438<\/h3>\n<p>\u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c OCI \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432 \u0441\u0432\u043e\u0435\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0435, \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0430\u0434\u0440\u0435\u0441\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0439:<\/p>\n<details class=\"spoiler\">\n<summary>\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0439 \u0430\u0434\u0440\u0435\u0441\u043e\u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0439<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"cpp\">\/\/\u043f\u043e\u0434\u043a\u043b\u043b\u044e\u0447\u0430\u0435\u043c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u0432 Windows hOCIDll = LoadLibraryW(L\"oci.dll\"); \/\/\u0438\u043b\u0438 \u0432 \u041b\u0438\u043d\u0443\u043a\u0441 ocimodule = dlopen(\"libclntsh.so\", RTLD_LAZY);  \/\/\u041e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c \u0442\u0438\u043f \u0434\u043b\u044f \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438 typedef sword(*pOCIEnvCreate)(OCIEnv **hOraEnvp, ub4           mode, const void    *ctxp, const void    *(*malocfp) (void  *ctxp, size_t size), const void    *(*ralocfp) (void  *ctxp, void  *memptr, size_t newsize), const void(*mfreefp) (void  *ctxp, void  *memptr), size_t         xtramemsz, void           **usrmempp);  \/\/\u0432\u044b\u0434\u0435\u043b\u044f\u0435\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u0434\u043b\u044f \u0430\u0434\u0440\u0435\u0441\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 pOCIEnvCreate OCIEnvCreate;  \/\/\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0430\u0434\u0440\u0435\u0441 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043d\u0430 Windows OCIEnvCreate = (pOCIEnvCreate)GetProcAddress(hOCIDll, \"OCIEnvCreate\"); \/\/ \u0418\u043b\u0438 \u043d\u0430 Linux OCIEnvCreate = (pOCIEnvCreate)dlsym(ocilib,\"OCIEnvCreate\"); <\/code><\/pre>\n<\/div>\n<\/details>\n<p>\u0422\u0430\u043a\u043e\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0430\u0434\u0440\u0435\u0441\u0430 \u0432\u0441\u0435\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u043d\u0430\u0448\u0435\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0435.<\/p>\n<p>\u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u043b\u0438\u0431\u043e \u043d\u0430 <a href=\"https:\/\/docs.oracle.com\" rel=\"noopener noreferrer nofollow\">https:\/\/docs.oracle.com<\/a> \u0432 Call Interface Programmer&#8217;s Guide \u0434\u043b\u044f \u0432\u0430\u0448\u0435\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043b\u0438\u0431\u043e \u0432 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u0447\u043d\u043e\u043c \u0444\u0430\u0439\u043b\u0435 %ORACLE_HOME%\\OCI\\include\\ociap.h<\/p>\n<h3>\u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f<\/h3>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b OCIEnv (\u0445\u0435\u043d\u0434\u043b \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f) \u0438 OCIError (\u0445\u0435\u043d\u0434\u043b \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043e\u0448\u0438\u0431\u043e\u043a). <\/p>\n<details class=\"spoiler\">\n<summary>\u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"cpp\">OCIEnv *hOraEnv = NULL; OCIError *hOraErr = NULL;   OCIEnvCreate((OCIEnv **)&amp;hOraEnv, (ub4)OCI_DEFAULT | OCI_OBJECT, (const void  *)0, (const void  * (*)(void  *, size_t))0, (const void  * (*)(void  *, void  *, size_t))0, (const void(*)(void  *, void  *))0, (size_t)0, (void  **)0));   OCIHandleAlloc((const void *)hOraEnv, (void **)&amp;hOraErr, OCI_HTYPE_ERROR, (size_t)0, (void **)0)); <\/code><\/pre>\n<\/div>\n<\/details>\n<h3>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0441\u0435\u0441\u0441\u0438\u0438<\/h3>\n<p>\u0414\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0441\u0435\u0441\u0441\u0438\u0438 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0445\u0435\u043d\u0434\u043b OCISvcCtx, \u0438\u043c\u0435\u043d\u043d\u043e \u043e\u043d \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f sql-\u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439. \u042f, \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0443\u044f\u0441\u044c \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u043c\u0438 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u043c\u0438 \u043e\u0442 Oracle, \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u043b \u0441\u0435\u0441\u0441\u0438\u0438 \u0442\u0430\u043a:<\/p>\n<details class=\"spoiler\">\n<summary>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0441\u0435\u0441\u0441\u0438\u0438<\/summary>\n<div class=\"spoiler__content\">\n<pre><code>OCIServer *hOraServer = NULL; OCISvcCtx *hOraSvcCtxOCI = NULL; OCISession *hOraSession = NULL;   \/\/\u0410\u043b\u043b\u043e\u0446\u0438\u0440\u0443\u0435\u043c \u0445\u0435\u043d\u0434\u043b OCIServer OCIHandleAlloc((const void *)hOraEnv, (void **)&amp;hOraServer,         OCI_HTYPE_SERVER, (size_t)0, (dvoid **)0);  char *dbconnectstring = \"servername:1521\/ORCL\"; \/\/\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c\u0441\u044f \u043a \u0441\u0435\u0440\u0432\u0435\u0440\u0443 OCIServerAttach(hOraServer, hOraErr, (const OraText *)dbconnectstring,                  (sb4)strlen(dbconnectstring), (ub4)OCI_DEFAULT);  \/\/\u0410\u043b\u043b\u043e\u0446\u0438\u0440\u0443\u0435\u043c \u0445\u0435\u043d\u0434\u043b \u0441\u0435\u0440\u0432\u0438\u0441\u043d\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 OCIHandleAlloc((const void *)hOraEnv, (void **)&amp;hOraSvcCtx,         OCI_HTYPE_SVCCTX, (size_t)0, (dvoid **)0);  \/\/\u041f\u043e\u043c\u0435\u0449\u0430\u0435\u043c \u0445\u0435\u043d\u0434\u043b \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0432 \u0441\u0435\u0440\u0432\u0438\u0441\u043d\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 OCIAttrSet((void *)hOraSvcCtx, OCI_HTYPE_SVCCTX, (void *)hOraServer,             (ub4)0, OCI_ATTR_SERVER, (OCIError *)hOraErr));           \/\/\u0410\u043b\u043b\u043e\u0446\u0438\u0440\u0443\u0435\u043c \u0445\u0435\u043d\u0434\u043b \u0434\u043b\u044f \u0441\u0435\u0441\u0441\u0438\u0438 OCIHandleAlloc((const void *)hOraEnv, (void **)&amp;hOraSession,                 (ub4)OCI_HTYPE_SESSION, (size_t)0, (void **)0);  char * username = \"SCOTT\";     \/\/\u041f\u043e\u043c\u0435\u0449\u0430\u0435\u043c \u0438\u043c\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0432 \u0445\u0435\u043d\u0434\u043b \u0441\u0435\u0441\u0441\u0438\u0438 OCIAttrSet((void *)hOraSession, (ub4)OCI_HTYPE_SESSION,             (void *)username, (ub4)strlen(username),             (ub4)OCI_ATTR_USERNAME, hOraErr);  char *password = \"tiger\"; \/\/\u041f\u043e\u043c\u0435\u0449\u0430\u0435\u043c \u043f\u0430\u0440\u043e\u043b\u044c \u0432 \u0445\u0435\u043d\u0434\u043b \u0441\u0435\u0441\u0441\u0438\u0438     OCIAttrSet((void *)hOraSession, (ub4)OCI_HTYPE_SESSION,             (void *)password, (ub4)strlen(password),             (ub4)OCI_ATTR_PASSWORD, hOraErr);  \/\/\u0444\u043b\u0430\u0433 \u0434\u043b\u044f \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u044f, \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043b\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c sysdba bool assysdba = 1; \/\/\u041d\u0430\u0447\u0438\u043d\u0430\u0435\u043c \u0441\u0435\u0441\u0441\u0438\u044e OCISessionBegin(hOraSvcCtx, hOraErr,                  hOraSession, OCI_CRED_RDBMS,                  (ub4)(OCI_DEFAULT | (assysdba ? OCI_SYSDBA : 0)));      \/\/\u041f\u043e\u043c\u0435\u0449\u0430\u0435\u043c \u0441\u0435\u0441\u0441\u0438\u044e \u0432 \u0441\u0435\u0440\u0432\u0438\u0441\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 OCIAttrSet((void *)hOraSvcCtx, (ub4)OCI_HTYPE_SVCCTX,             (void *)hOraSession, (ub4)0, (ub4)OCI_ATTR_SESSION,             hOraErr); <\/code><\/pre>\n<\/div>\n<\/details>\n<p>\u0423\u0436\u0435 \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u044c\u0438, \u044f \u0443\u0432\u0438\u0434\u0435\u043b, \u0447\u0442\u043e \u0434\u043b\u044f \u044d\u0442\u0438\u0445 \u0436\u0435 \u0446\u0435\u043b\u0435\u0439 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c  \u0444\u0443\u043d\u043a\u0446\u0438\u044e OCILogon2. \u0421\u0443\u0434\u044f \u043f\u043e \u0432\u0441\u0435\u043c\u0443, \u044d\u0442\u043e \u043d\u0430\u043c\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0449\u0435 \u0438 \u0443\u0434\u043e\u0431\u043d\u0435\u0435. \u0410 \u0433\u043b\u0430\u0432\u043d\u043e\u0435, \u043d\u0443\u0436\u043d\u043e \u043c\u0435\u043d\u044c\u0448\u0435 \u043f\u0438\u0441\u0430\u0442\u044c \u043a\u043e\u0434\u0430. \u041d\u043e \u043c\u044b \u0443\u0436\u0435 \u043e\u0441\u0442\u0430\u0432\u0438\u043c \u0432\u0441\u0435, \u043a\u0430\u043a \u0435\u0441\u0442\u044c.<\/p>\n<h3>\u0412\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435<\/h3>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0434\u043b\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u0431\u0430\u0437\u0443:<\/p>\n<details class=\"spoiler\">\n<summary>\u0412\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c Insert<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"cpp\">char * insert_statement = \"INSERT INTO simple_table\\ (id, textfield)\\ VALUES\\ (:id, :string)\";  sword status;  int id; char stringBuffer[100];  OCIStmt *hOraPlsqlStatement = NULL; \/\/\u0410\u043b\u043b\u043e\u0446\u0438\u0440\u0443\u0435\u043c \u0445\u0435\u043d\u0434\u043b \u0434\u043b\u044f sql-\u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f OCIHandleAlloc((const void *)hOraEnv,                 (void **)&amp;hOraPlsqlStatement, OCI_HTYPE_STMT,                 (size_t)0, (void **)0);  \/\/\u041f\u043e\u0434\u0433\u043e\u0442\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u0435\u0433\u043e OCIStmtPrepare(hOraPlsqlStatement, hOraErr,                 (const OraText *)insert_statement,                 (ub4)strlen(insert_statement),                 (ub4)OCI_NTV_SYNTAX, (ub4)OCI_DEFAULT);  \/\/\u0411\u0438\u043d\u0434\u0438\u043c \u043d\u0430\u0448\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 id \u0438 stringBuffer \u0432 sql-\u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 OCIBind  *bnd1p = NULL; OCIBind  *bnd2p = NULL; OCIBindByName(hOraPlsqlStatement, &amp;bnd1p,                hOraErr, (text *)\":id\", -1, (void *)&amp;id,                (sb4)sizeof(id), SQLT_INT, (void *)0,                (ub2 *)0, (ub2 *)0, (ub4)0, (ub4 *)0, OCI_DEFAULT); OCIBindByName(hOraPlsqlStatement, &amp;bnd2p,                hOraErr, (text *)\":string\", -1,                (void *)stringBuffer, (sb4)(sizeof(stringBuffer)),                SQLT_STR, (void *)0, (ub2 *)0, (ub2 *)0,                (ub4)0, (ub4 *)0, OCI_DEFAULT);  \/\/\u0432\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u0446\u0438\u043a\u043b\u0435 for (id = 1; id &lt; 10; id++) { sprintf(stringBuffer, \"This is the %d string\", id);  status = OCIStmtExecute(hOraSvcCtx, hOraPlsqlStatement, hOraErr, (ub4)1, (ub4)0, (CONST OCISnapshot *) NULL, (OCISnapshot *)NULL, OCI_DEFAULT); if (status != OCI_SUCCESS &amp;&amp; status != OCI_SUCCESS_WITH_INFO) { checkerr(hOraErr, status); OCIHandleFree(hOraPlsqlStatement, OCI_HTYPE_STMT); return FALSE; } }  \/\/\u043e\u0441\u0432\u043e\u0431\u043e\u0436\u0434\u0430\u0435\u043c \u0445\u0435\u043d\u0434\u043b OCIHandleFree(hOraPlsqlStatement, OCI_HTYPE_STMT); <\/code><\/pre>\n<\/div>\n<\/details>\n<p>\u0412 \u0446\u0435\u043b\u044f\u0445 \u0443\u0432\u0435\u043b\u0438\u0447\u0435\u043d\u0438\u044f \u0431\u044b\u0441\u0442\u0440\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0438 \u044d\u043a\u043e\u043d\u043e\u043c\u0438\u0438 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u0431\u0430\u0437\u044b \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0445 \u0438\u043d\u0441\u0435\u0440\u0442\u043e\u0432 \u043d\u0443\u0436\u043d\u043e \u0432\u043d\u0430\u0447\u0430\u043b\u0435 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u0442\u044c \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0441 \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044f\u043c\u0438 \u0442\u0438\u043f\u0430 :id \u0438 :string, \u0441\u0432\u044f\u0437\u0430\u0442\u044c \u0438\u0445 \u0441 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u043c\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c\u0438, \u0438 \u0437\u0430\u0442\u0435\u043c \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435.<\/p>\n<h3>\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435<\/h3>\n<p>\u041a\u043e\u0434 \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437 \u0431\u0430\u0437\u044b:<\/p>\n<details class=\"spoiler\">\n<summary>\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"cpp\">char * select_statement = \"select id, textfield from simple_table order by id\";  sword status;  int id; char stringBuffer[100];  OCIStmt *hOraPlsqlStatement = NULL; OCIHandleAlloc((const void *)hOraEnv,                 (void **)&amp;hOraPlsqlStatement, OCI_HTYPE_STMT,                 (size_t)0, (void **)0);   OCIStmtPrepare(hOraPlsqlStatement, hOraErr,                 (const OraText *)select_statement,                 (ub4)strlen(select_statement),                 (ub4)OCI_NTV_SYNTAX, (ub4)OCI_DEFAULT);   OCIDefine *OraIdDefine = NULL; \/\/\u041f\u0440\u0438\u0432\u044f\u0437\u044b\u0432\u0430\u0435\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e id \u043a \u043f\u0435\u0440\u0432\u043e\u043c\u0443 \u043f\u043e\u043b\u044e \u0432 \u0437\u0430\u043f\u0440\u043e\u0441\u0435 OCIDefineByPos(hOraPlsqlStatement, &amp;OraIdDefine,                 hOraErr, 1, (void *)&amp;id, (sword)sizeof(id),                 SQLT_INT, (void *)0, (ub2 *)0, (ub2 *)0,                 OCI_DEFAULT);   OCIDefine *OraStringDefine = NULL; \/\/\u041f\u0440\u0438\u0432\u044f\u0437\u044b\u0432\u0430\u0435\u043c stringBuffer \u043a\u043e \u0432\u0442\u043e\u0440\u043e\u043c\u0443 \u043f\u043e\u043b\u044e \u0432 \u0437\u0430\u043f\u0440\u043e\u0441\u0435 OCIDefineByPos(hOraPlsqlStatement, &amp;OraStringDefine,                 hOraErr, 2, (void *)stringBuffer,                 (sword)sizeof(stringBuffer),                 SQLT_STR, (void *)0, (ub2 *)0,                 (ub2 *)0, OCI_DEFAULT);  \/\/\u0412\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0437\u0430\u043f\u0440\u043e\u0441, \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u044f \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 status = OCIStmtExecute(hOraSvcCtx, hOraPlsqlStatement, hOraErr, (ub4)0, (ub4)0, (CONST OCISnapshot *) NULL, (OCISnapshot *)NULL, OCI_DEFAULT); if (status != OCI_SUCCESS &amp;&amp; status != OCI_SUCCESS_WITH_INFO) { checkerr(hOraErr, status); OCIHandleFree(hOraPlsqlStatement, OCI_HTYPE_STMT); return FALSE; }  printf(\"id | textfield\\n\"); \/\/\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u0446\u0438\u043a\u043b\u0435 while ((status = OCIStmtFetch2(hOraPlsqlStatement, hOraErr, 1, OCI_DEFAULT, 0, OCI_DEFAULT)) == OCI_SUCCESS || status == OCI_SUCCESS_WITH_INFO) { printf(\"%d | %s\\n\", id, stringBuffer); }  OCIHandleFree(hOraPlsqlStatement, OCI_HTYPE_STMT); <\/code><\/pre>\n<\/div>\n<\/details>\n<p>\u041f\u0440\u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u043e\u0441\u0442\u0443\u043f\u0430\u0435\u043c \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e, \u043f\u0440\u0438\u0432\u044f\u0437\u044b\u0432\u0430\u0435\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0441 \u0437\u0430\u043f\u0440\u043e\u0448\u0435\u043d\u043d\u044b\u043c\u0438 \u043f\u043e\u043b\u044f\u043c\u0438 \u0432 \u0441\u0435\u043b\u0435\u043a\u0442\u0435, \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0438 \u0437\u0430\u0442\u0435\u043c \u0432 \u0446\u0438\u043a\u043b\u0435 \u043e\u0434\u043d\u0443 \u0437\u0430 \u0434\u0440\u0443\u0433\u043e\u0439 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0441\u0442\u0440\u043e\u043a\u0438<\/p>\n<h3>\u0417\u0430\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u0441\u0435\u0441\u0441\u0438\u044e<\/h3>\n<p>\u041f\u043e\u0441\u043b\u0435 \u043d\u0443\u0436\u043d\u044b\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u043a\u0440\u044b\u0442\u044c \u0441\u0435\u0441\u0441\u0438\u044e:<\/p>\n<details class=\"spoiler\">\n<summary>\u0417\u0430\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u0441\u0435\u0441\u0441\u0438\u044e<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"cpp\">OCISessionEnd(hOraSvcCtx, hOraErr, hOraSession, OCI_DEFAULT);  OCIHandleFree(hOraSession, OCI_HTYPE_SESSION);  OCIHandleFree(hOraSvcCtx, OCI_HTYPE_SVCCTX);  OCIServerDetach(hOraServer, hOraErr, (ub4)OCI_DEFAULT);  OCIHandleFree(hOraServer, OCI_HTYPE_SERVER);<\/code><\/pre>\n<\/div>\n<\/details>\n<h3>\u0417\u0430\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0435<\/h3>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0441 \u0431\u0430\u0437\u043e\u0439 \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435 \u043d\u0443\u0436\u043d\u043e, \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0435:<\/p>\n<details class=\"spoiler\">\n<summary>\u0417\u0430\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0435<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"cpp\">OCIHandleFree(hOraErr, OCI_HTYPE_ERROR);  OCIHandleFree(hOraEnv, OCI_HTYPE_ENV);  OCITerminate(OCI_DEFAULT);<\/code><\/pre>\n<\/div>\n<\/details>\n<h2>\u0418\u0442\u043e\u0433\u0438 \u0440\u0430\u0431\u043e\u0442\u044b<\/h2>\n<p>\u0412\u043e\u0442 \u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u044b \u043d\u0430 \u0433\u0438\u0442\u0445\u0430\u0431\u0435 \u0434\u043b\u044f <a href=\"https:\/\/github.com\/Johnny-the-cat\/simple_Oracle_client_application_win\" rel=\"noopener noreferrer nofollow\">Windows<\/a>(Visual Studio) \u0438 <a href=\"https:\/\/github.com\/Johnny-the-cat\/simple_Oracle_client_application_lin\" rel=\"noopener noreferrer nofollow\">Linux<\/a>(NetBeans)<\/p>\n<p><strong>\u041e \u0444\u0430\u0439\u043b\u0430\u0445 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435<br \/><\/strong><br \/>\u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u0447\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b <em>oci.h, ocidem.h, ocidfn.h, ocikpr.h, oratypes.h, orl.h<\/em> \u0432\u0437\u044f\u0442\u044b \u0438\u0437 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0430 %ORACLE_HOME%\\OCI\\include (\u041c\u043e\u0436\u0435\u0442, \u044f \u0438\u0445 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043c\u043e\u0434\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u043b, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0431\u044b\u043b\u043e \u043d\u0435\u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u043d\u044b\u0445 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439, \u043d\u043e \u044d\u0442\u043e\u0433\u043e \u044f \u0443\u0436\u0435 \u0442\u043e\u0447\u043d\u043e \u043d\u0435 \u043f\u043e\u043c\u043d\u044e)<br \/><em>ocipfndfn.h<\/em> &#8212; \u044d\u0442\u043e\u0442 \u0444\u0430\u0439\u043b \u0441 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f\u043c\u0438 \u0442\u0438\u043f\u043e\u0432 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0435\u0439 \u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d \u043c\u043d\u043e\u0439, \u0442\u0443\u0442 \u0442\u0435 OCI \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u0432 \u0441\u0432\u043e\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445.<br \/><em>OraFunction.c<\/em> &#8212; \u041e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0444\u0430\u0439\u043b \u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u0442\u0443\u0442 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0411\u0414.<br \/><em>OraFunction.h<\/em> &#8212; \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u0447\u043d\u044b\u0439 \u0444\u0430\u0439\u043b \u0441  \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u044f\u043c\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438.<br \/><em>ParseCmdLine.c<\/em> &#8212; \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0434\u043b\u044f \u043f\u0430\u0440\u0441\u0438\u043d\u0433\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438, \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043b\u043e\u0433\u0438\u043d\u0430, \u043f\u0430\u0440\u043e\u043b\u044f \u0438 \u0441\u0442\u0440\u043e\u043a\u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a \u0431\u0430\u0437\u0435. \u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0442\u0441\u044f \u0432 \u0443\u0442\u0438\u043b\u0438\u0442\u0443 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u043c \u0434\u043b\u044f \u041e\u0440\u0430\u043a\u043b\u043e\u0432\u044b\u0445 \u0443\u0442\u0438\u043b\u0438\u0442 \u0444\u043e\u0440\u043c\u0430\u0442\u043e\u043c login\/pass@dbconnect.<br \/><em>main.c<\/em> &#8212; \u0444\u0443\u043d\u043a\u0446\u0438\u044f main.<\/p>\n<p><strong>\u0427\u0442\u043e \u0443\u0442\u0438\u043b\u0438\u0442\u0430 \u0434\u0435\u043b\u0430\u0435\u0442<br \/><\/strong><br \/>\u0423\u0442\u0438\u043b\u0438\u0442\u0430 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u043a \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445, \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 <em>simple_table,<\/em> \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0435\u0435 \u0434\u0430\u043d\u043d\u044b\u043c\u0438, \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u0438\u0437 \u043d\u0435\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0438 \u0443\u0434\u0430\u043b\u044f\u0435\u0442 \u0442\u0430\u0431\u043b\u0438\u0446\u0443.<\/p>\n<p><strong>\u041a\u0430\u043a \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c<br \/><\/strong><br \/>\u041a\u0430\u043a \u0438 \u0431\u044b\u043b\u043e \u0437\u0430\u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u043e \u0441 \u0441\u0430\u043c\u043e\u0433\u043e \u043d\u0430\u0447\u0430\u043b\u0430, \u0434\u043b\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u0443\u0442\u0438\u043b\u0438\u0442\u044b \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u043e\u0432 \u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a. \u0414\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b, \u0441\u0430\u043c\u043e \u0441\u043e\u0431\u043e\u0439, \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0439 Oracle Client \u043b\u0438\u0431\u043e Instant Oracle Cllient, \u0433\u043b\u0430\u0432\u043d\u043e\u0435, \u0447\u0442\u043e\u0431\u044b \u0431\u044b\u043b\u0430 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430 OCI-\u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/587492\/\"> https:\/\/habr.com\/ru\/articles\/587492\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0425\u0430\u0431\u0440, \u043f\u0440\u0438\u0432\u0435\u0442! \u0412\u043e\u043e\u0431\u0449\u0435-\u0442\u043e \u044f \u043d\u0435 \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0438\u0439 <s>\u0441\u0432\u0430\u0440\u0449\u0438\u043a<\/s> \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442, \u044f \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0439 \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440 \u0438 \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440 \u0411\u0414. \u041f\u043e\u044d\u0442\u043e\u043c\u0443, \u043a\u043e\u0433\u0434\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043b\u0435\u0442 \u043d\u0430\u0437\u0430\u0434 \u043f\u0435\u0440\u0435\u0434\u043e \u043c\u043d\u043e\u0439 \u0432\u0441\u0442\u0430\u043b\u0430 \u0437\u0430\u0434\u0430\u0447\u0430 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u043a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u0440\u0443\u0442\u0438\u043d\u043d\u044b\u0445 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440, \u044f \u043f\u043e\u0442\u0440\u0430\u0442\u0438\u043b \u043d\u0435\u043c\u0430\u043b\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u0447\u0442\u043e\u0431\u044b \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0432 \u044d\u0442\u043e\u043c \u0432\u043e\u043f\u0440\u043e\u0441\u0435. \u0415\u0441\u043b\u0438 \u0432\u0434\u0440\u0443\u0433 \u0443 \u0432\u0430\u0441 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a\u0430\u044f \u0436\u0435 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f, \u043d\u0430\u0434\u0435\u044e\u0441\u044c, \u044d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u0441\u044d\u043a\u043e\u043d\u043e\u043c\u0438\u0442 \u0432\u0430\u0448\u0435 \u0432\u0440\u0435\u043c\u044f \u0438 \u0441\u0438\u043b\u044b.<\/p>\n<h2>\u0427\u0442\u043e \u043d\u0443\u0436\u043d\u043e?<\/h2>\n<p>\u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0432\u0448\u0438\u0441\u044c \u0441 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f\u043c\u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435.<\/p>\n<p><strong>\u0416\u0435\u043b\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0434\u043b\u044f \u0431\u0438\u043d\u0430\u0440\u043d\u0438\u043a\u0430:<\/strong><\/p>\n<ul>\n<li>\n<p>\u041d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0440\u0430\u0437\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430.<\/p>\n<\/li>\n<li>\n<p>\u041a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u0430\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0441\u043b\u0443\u0447\u0430\u0435\u0432, \u043a\u043e\u0433\u0434\u0430 OCI-\u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u043d\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430 <\/p>\n<\/li>\n<\/ul>\n<p><strong>\u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0434\u043b\u044f \u0431\u0438\u043d\u0430\u0440\u043d\u0438\u043a\u0430:<\/strong><\/p>\n<ul>\n<li>\n<p>\u0420\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0443\u0442\u0438\u043b\u0438\u0442\u0430 \u0434\u043e\u043b\u0436\u043d\u0430 \u043d\u0430 \u043b\u044e\u0431\u043e\u043c \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0435 \u0441 \u041e\u0421 Windows \u0432\u044b\u0448\u0435 Windows 7 \u0438\u043b\u0438 Windows Server 2008 \u0431\u0435\u0437 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u043a\u0430\u043a\u0438\u0445-\u043b\u0438\u0431\u043e \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u043e\u0432 \u0438 Runtime Environment. \u0414\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d \u0442\u043e\u043b\u044c\u043a\u043e \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u0438\u0437 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u043e\u0432 Oracle, \u0432\u043a\u043b\u044e\u0447\u0430\u044e\u0449\u0438\u0439 OCI-\u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443.<\/p>\n<\/li>\n<\/ul>\n<p><strong>\u041e\u0447\u0435\u043d\u044c \u0436\u0435\u043b\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0434\u043b\u044f \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u043e\u0432:<\/strong><\/p>\n<ul>\n<li>\n<p>\u0427\u0442\u043e\u0431\u044b \u0433\u043e\u0442\u043e\u0432\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u0435\u0437 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0430 \u0434\u0440\u0443\u0433\u043e\u043c \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0435 \u0431\u0435\u0437 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u043a\u0430\u043a\u0438\u0445-\u043b\u0438\u0431\u043e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a. \u0422\u0430\u043a \u043a\u0430\u043a \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u043f\u043e\u0445\u043e\u0436\u0438\u0439 legacy \u043f\u0440\u043e\u0435\u043a\u0442, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043b\u0435\u0442 20 \u043d\u0430\u0437\u0430\u0434 \u043f\u0438\u0441\u0430\u043b \u0434\u0430\u0432\u043d\u043e \u0443\u0448\u0435\u0434\u0448\u0438\u0439 \u0441\u043e\u0442\u0440\u0443\u0434\u043d\u0438\u043a. \u0415\u0433\u043e \u0440\u0430\u0431\u043e\u0447\u0443\u044e \u0441\u0442\u0430\u043d\u0446\u0438\u044e \u043c\u044b \u0445\u0440\u0430\u043d\u0438\u043c \u0432 \u0432\u0438\u0434\u0435 \u043e\u0431\u0440\u0430\u0437\u0430 \u0412\u041c, \u0442\u0430\u043a \u043a\u0430\u043a \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u0442\u044c \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 \u043d\u043e\u0432\u043e\u0439 \u0440\u0430\u0431\u043e\u0447\u0435\u0439 \u0441\u0442\u0430\u043d\u0446\u0438\u0438 &#8212; \u0437\u0430\u0434\u0430\u0447\u0430 \u043a\u0440\u0430\u0439\u043d\u0435 \u043d\u0435\u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u0430\u044f.<\/p>\n<\/li>\n<\/ul>\n<h2>\u041a\u0430\u043a\u0443\u044e \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u044e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c?<\/h2>\n<p>Oracle \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b:<\/p>\n<ul>\n<li>\n<p><strong>Pro*C\/C++<\/strong> &#8212; \u041f\u0440\u0435\u0434\u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 Oracle. \u0418\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0432\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u044b SQL \u0432 \u0445\u043e\u0441\u0442-\u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443 \u0432\u044b\u0441\u043e\u043a\u043e\u0433\u043e \u0443\u0440\u043e\u0432\u043d\u044f. \u041f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u043e\u0441\u043d\u043e\u0432\u043d\u0443\u044e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0432\u0445\u043e\u0434\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445, \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u0442 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 SQL \u0432 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435 \u0432\u044b\u0437\u043e\u0432\u044b \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 Oracle \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0438 \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u0438\u0441\u0445\u043e\u0434\u043d\u0443\u044e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u0441\u0432\u044f\u0437\u0430\u0442\u044c \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c. \u0420\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0441 \u044d\u0442\u0438\u043c \u0443 \u043c\u0435\u043d\u044f \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0438\u0447\u0435\u0433\u043e \u043a \u044d\u0442\u043e\u043c\u0443 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044e \u044f \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u0435 \u043c\u043e\u0433\u0443<\/p>\n<\/li>\n<li>\n<p><strong>C++ Call Interface (OCCI)<\/strong> &#8212; API, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u043c C++ \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0434\u0430\u043d\u043d\u044b\u043c \u0432 \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 Oracle. OCCI \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u0430\u043c \u043d\u0430 C++ \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u0435\u0441\u044c \u0441\u043f\u0435\u043a\u0442\u0440 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0441 \u0431\u0430\u0437\u0430\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 Oracle, \u0432\u043a\u043b\u044e\u0447\u0430\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0439 SQL \u0438 \u043c\u0430\u043d\u0438\u043f\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u043c\u0438. \u0422\u0430\u043a \u043a\u0430\u043a \u044f \u0421++ \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b, \u044d\u0442\u043e\u0442 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u043c\u043d\u0435 \u044f\u0432\u043d\u043e \u043d\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u043b <\/p>\n<\/li>\n<li>\n<p><strong>Oracle Call Interface (OCI)<\/strong> &#8212; API, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0438\u0435 \u0432\u044b\u0437\u043e\u0432\u044b \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0434\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 Oracle \u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0432\u0441\u0435\u043c\u0438 \u044d\u0442\u0430\u043f\u0430\u043c\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0439 SQL. OCI \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0442\u0438\u043f\u044b \u0434\u0430\u043d\u043d\u044b\u0445, \u0441\u043e\u0433\u043b\u0430\u0448\u0435\u043d\u0438\u044f \u043e \u0432\u044b\u0437\u043e\u0432\u0430\u0445, \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u0438 \u0441\u0435\u043c\u0430\u043d\u0442\u0438\u043a\u0443 C \u0438 C++. \u041e\u043d \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u043f\u043e\u0438\u0441\u043a\u0430 \u0432 \u0432\u0438\u0434\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0441\u0440\u0435\u0434\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f (\u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 OCI), \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0441\u0432\u044f\u0437\u0430\u043d\u0430 \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f. \u0422\u0430\u043a\u0436\u0435 \u0432 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0438 \u0443\u043a\u0430\u0437\u0430\u043d\u043e, \u0447\u0442\u043e \u0432\u0441\u0435 \u043e\u0440\u0430\u043a\u043b\u043e\u0432\u044b\u0435 \u0443\u0442\u0438\u043b\u0438\u0442\u044b (\u0442\u0438\u043f\u0430 sqlplus, exp, imp \u0438 \u043f\u0440\u043e\u0447\u0438\u0435) \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u044b \u0438\u043c\u0435\u043d\u043d\u043e \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c OCI. \u0427\u0442\u043e \u0436\u0435 \u0435\u0449\u0435 \u043d\u0443\u0436\u043d\u043e?<\/p>\n<\/li>\n<li>\n<p><strong>Oracle Database Programming Interface for C (ODPI-C)<\/strong> &#8212; \u044d\u0442\u043e C-\u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0441 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0443\u043f\u0440\u043e\u0449\u0430\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043e\u0431\u0449\u0438\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u0432\u044b\u0437\u043e\u0432\u043e\u0432 Oracle (OCI) \u0434\u043b\u044f \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u043e\u0432 \u0431\u0430\u0437 \u0434\u0430\u043d\u043d\u044b\u0445 Oracle \u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439. DPIC \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043f\u043e\u0432\u0435\u0440\u0445 OCI \u0438 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u0438\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a Oracle. \u041f\u0440\u043e\u0435\u043a\u0442 \u043b\u0435\u0436\u0438\u0442 \u043d\u0430 <a href=\"https:\/\/github.com\/oracle\/odpi\" rel=\"noopener noreferrer nofollow\">\u0413\u0438\u0442\u0445\u0430\u0431\u0435<\/a>. \u041f\u0440\u043e \u044d\u0442\u043e\u0442 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u044f \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u043b \u0442\u043e\u043b\u044c\u043a\u043e \u043a\u043e\u0433\u0434\u0430 \u043f\u0438\u0441\u0430\u043b \u044d\u0442\u0443 \u0441\u0442\u0430\u0442\u044c\u044e. \u041d\u043e, \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0432 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c, \u044f \u043d\u0438\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043d\u0435 \u043f\u043e\u0436\u0430\u043b\u0435\u043b, \u0447\u0442\u043e \u0432\u044b\u0431\u0440\u0430\u043b OCI. \u041c\u043e\u0436\u0435\u0442, \u044d\u0442\u043e \u0432\u043e\u043f\u0440\u043e\u0441 \u043f\u0440\u0438\u0432\u044b\u0447\u043a\u0438 \u0438 \u043e\u043f\u044b\u0442\u0430, \u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u044d\u0442\u0430 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u043c\u043d\u0435 \u043d\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u0430\u0441\u044c.<\/p>\n<\/li>\n<\/ul>\n<h2>\u041f\u0438\u0448\u0435\u043c \u043f\u0440\u043e\u0441\u0442\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435<\/h2>\n<h3>\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438<\/h3>\n<p>\u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c OCI \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432 \u0441\u0432\u043e\u0435\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0435, \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0430\u0434\u0440\u0435\u0441\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0439:<\/p>\n<details class=\"spoiler\">\n<summary>\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0439 \u0430\u0434\u0440\u0435\u0441\u043e\u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0439<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"cpp\">\/\/\u043f\u043e\u0434\u043a\u043b\u043b\u044e\u0447\u0430\u0435\u043c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u0432 Windows hOCIDll = LoadLibraryW(L\"oci.dll\"); \/\/\u0438\u043b\u0438 \u0432 \u041b\u0438\u043d\u0443\u043a\u0441 ocimodule = dlopen(\"libclntsh.so\", RTLD_LAZY);  \/\/\u041e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c \u0442\u0438\u043f \u0434\u043b\u044f \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438 typedef sword(*pOCIEnvCreate)(OCIEnv **hOraEnvp, ub4           mode, const void    *ctxp, const void    *(*malocfp) (void  *ctxp, size_t size), const void    *(*ralocfp) (void  *ctxp, void  *memptr, size_t newsize), const void(*mfreefp) (void  *ctxp, void  *memptr), size_t         xtramemsz, void           **usrmempp);  \/\/\u0432\u044b\u0434\u0435\u043b\u044f\u0435\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u0434\u043b\u044f \u0430\u0434\u0440\u0435\u0441\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 pOCIEnvCreate OCIEnvCreate;  \/\/\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0430\u0434\u0440\u0435\u0441 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043d\u0430 Windows OCIEnvCreate = (pOCIEnvCreate)GetProcAddress(hOCIDll, \"OCIEnvCreate\"); \/\/ \u0418\u043b\u0438 \u043d\u0430 Linux OCIEnvCreate = (pOCIEnvCreate)dlsym(ocilib,\"OCIEnvCreate\"); <\/code><\/pre>\n<\/div>\n<\/details>\n<p>\u0422\u0430\u043a\u043e\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0430\u0434\u0440\u0435\u0441\u0430 \u0432\u0441\u0435\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u043d\u0430\u0448\u0435\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0435.<\/p>\n<p>\u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u043b\u0438\u0431\u043e \u043d\u0430 <a href=\"https:\/\/docs.oracle.com\" rel=\"noopener noreferrer nofollow\">https:\/\/docs.oracle.com<\/a> \u0432 Call Interface Programmer&#8217;s Guide \u0434\u043b\u044f \u0432\u0430\u0448\u0435\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043b\u0438\u0431\u043e \u0432 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u0447\u043d\u043e\u043c \u0444\u0430\u0439\u043b\u0435 %ORACLE_HOME%\\OCI\\include\\ociap.h<\/p>\n<h3>\u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f<\/h3>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b OCIEnv (\u0445\u0435\u043d\u0434\u043b \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f) \u0438 OCIError (\u0445\u0435\u043d\u0434\u043b \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043e\u0448\u0438\u0431\u043e\u043a). <\/p>\n<details class=\"spoiler\">\n<summary>\u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"cpp\">OCIEnv *hOraEnv = NULL; OCIError *hOraErr = NULL;   OCIEnvCreate((OCIEnv **)&amp;hOraEnv, (ub4)OCI_DEFAULT | OCI_OBJECT, (const void  *)0, (const void  * (*)(void  *, size_t))0, (const void  * (*)(void  *, void  *, size_t))0, (const void(*)(void  *, void  *))0, (size_t)0, (void  **)0));   OCIHandleAlloc((const void *)hOraEnv, (void **)&amp;hOraErr, OCI_HTYPE_ERROR, (size_t)0, (void **)0)); <\/code><\/pre>\n<\/div>\n<\/details>\n<h3>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0441\u0435\u0441\u0441\u0438\u0438<\/h3>\n<p>\u0414\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0441\u0435\u0441\u0441\u0438\u0438 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0445\u0435\u043d\u0434\u043b OCISvcCtx, \u0438\u043c\u0435\u043d\u043d\u043e \u043e\u043d \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f sql-\u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439. \u042f, \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0443\u044f\u0441\u044c \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u043c\u0438 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u043c\u0438 \u043e\u0442 Oracle, \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u043b \u0441\u0435\u0441\u0441\u0438\u0438 \u0442\u0430\u043a:<\/p>\n<details class=\"spoiler\">\n<summary>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0441\u0435\u0441\u0441\u0438\u0438<\/summary>\n<div class=\"spoiler__content\">\n<pre><code>OCIServer *hOraServer = NULL; OCISvcCtx *hOraSvcCtxOCI = NULL; OCISession *hOraSession = NULL;   \/\/\u0410\u043b\u043b\u043e\u0446\u0438\u0440\u0443\u0435\u043c \u0445\u0435\u043d\u0434\u043b OCIServer OCIHandleAlloc((const void *)hOraEnv, (void **)&amp;hOraServer,         OCI_HTYPE_SERVER, (size_t)0, (dvoid **)0);  char *dbconnectstring = \"servername:1521\/ORCL\"; \/\/\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c\u0441\u044f \u043a \u0441\u0435\u0440\u0432\u0435\u0440\u0443 OCIServerAttach(hOraServer, hOraErr, (const OraText *)dbconnectstring,                  (sb4)strlen(dbconnectstring), (ub4)OCI_DEFAULT);  \/\/\u0410\u043b\u043b\u043e\u0446\u0438\u0440\u0443\u0435\u043c \u0445\u0435\u043d\u0434\u043b \u0441\u0435\u0440\u0432\u0438\u0441\u043d\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 OCIHandleAlloc((const void *)hOraEnv, (void **)&amp;hOraSvcCtx,         OCI_HTYPE_SVCCTX, (size_t)0, (dvoid **)0);  \/\/\u041f\u043e\u043c\u0435\u0449\u0430\u0435\u043c \u0445\u0435\u043d\u0434\u043b \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0432 \u0441\u0435\u0440\u0432\u0438\u0441\u043d\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 OCIAttrSet((void *)hOraSvcCtx, OCI_HTYPE_SVCCTX, (void *)hOraServer,             (ub4)0, OCI_ATTR_SERVER, (OCIError *)hOraErr));           \/\/\u0410\u043b\u043b\u043e\u0446\u0438\u0440\u0443\u0435\u043c \u0445\u0435\u043d\u0434\u043b \u0434\u043b\u044f \u0441\u0435\u0441\u0441\u0438\u0438 OCIHandleAlloc((const void *)hOraEnv, (void **)&amp;hOraSession,                 (ub4)OCI_HTYPE_SESSION, (size_t)0, (void **)0);  char * username = \"SCOTT\";     \/\/\u041f\u043e\u043c\u0435\u0449\u0430\u0435\u043c \u0438\u043c\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0432 \u0445\u0435\u043d\u0434\u043b \u0441\u0435\u0441\u0441\u0438\u0438 OCIAttrSet((void *)hOraSession, (ub4)OCI_HTYPE_SESSION,             (void *)username, (ub4)strlen(username),             (ub4)OCI_ATTR_USERNAME, hOraErr);  char *password = \"tiger\"; \/\/\u041f\u043e\u043c\u0435\u0449\u0430\u0435\u043c \u043f\u0430\u0440\u043e\u043b\u044c \u0432 \u0445\u0435\u043d\u0434\u043b \u0441\u0435\u0441\u0441\u0438\u0438     OCIAttrSet((void *)hOraSession, (ub4)OCI_HTYPE_SESSION,             (void *)password, (ub4)strlen(password),             (ub4)OCI_ATTR_PASSWORD, hOraErr);  \/\/\u0444\u043b\u0430\u0433 \u0434\u043b\u044f \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u044f, \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043b\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c sysdba bool assysdba = 1; \/\/\u041d\u0430\u0447\u0438\u043d\u0430\u0435\u043c \u0441\u0435\u0441\u0441\u0438\u044e OCISessionBegin(hOraSvcCtx, hOraErr,                  hOraSession, OCI_CRED_RDBMS,                  (ub4)(OCI_DEFAULT | (assysdba ? OCI_SYSDBA : 0)));      \/\/\u041f\u043e\u043c\u0435\u0449\u0430\u0435\u043c \u0441\u0435\u0441\u0441\u0438\u044e \u0432 \u0441\u0435\u0440\u0432\u0438\u0441\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 OCIAttrSet((void *)hOraSvcCtx, (ub4)OCI_HTYPE_SVCCTX,             (void *)hOraSession, (ub4)0, (ub4)OCI_ATTR_SESSION,             hOraErr); <\/code><\/pre>\n<\/div>\n<\/details>\n<p>\u0423\u0436\u0435 \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u044c\u0438, \u044f \u0443\u0432\u0438\u0434\u0435\u043b, \u0447\u0442\u043e \u0434\u043b\u044f \u044d\u0442\u0438\u0445 \u0436\u0435 \u0446\u0435\u043b\u0435\u0439 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c  \u0444\u0443\u043d\u043a\u0446\u0438\u044e OCILogon2. \u0421\u0443\u0434\u044f \u043f\u043e \u0432\u0441\u0435\u043c\u0443, \u044d\u0442\u043e \u043d\u0430\u043c\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0449\u0435 \u0438 \u0443\u0434\u043e\u0431\u043d\u0435\u0435. \u0410 \u0433\u043b\u0430\u0432\u043d\u043e\u0435, \u043d\u0443\u0436\u043d\u043e \u043c\u0435\u043d\u044c\u0448\u0435 \u043f\u0438\u0441\u0430\u0442\u044c \u043a\u043e\u0434\u0430. \u041d\u043e \u043c\u044b \u0443\u0436\u0435 \u043e\u0441\u0442\u0430\u0432\u0438\u043c \u0432\u0441\u0435, \u043a\u0430\u043a \u0435\u0441\u0442\u044c.<\/p>\n<h3>\u0412\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435<\/h3>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0434\u043b\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u0431\u0430\u0437\u0443:<\/p>\n<details class=\"spoiler\">\n<summary>\u0412\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c Insert<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"cpp\">char * insert_statement = \"INSERT INTO simple_table\\ (id, textfield)\\ VALUES\\ (:id, :string)\";  sword status;  int id; char stringBuffer[100];  OCIStmt *hOraPlsqlStatement = NULL; \/\/\u0410\u043b\u043b\u043e\u0446\u0438\u0440\u0443\u0435\u043c \u0445\u0435\u043d\u0434\u043b \u0434\u043b\u044f sql-\u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f OCIHandleAlloc((const void *)hOraEnv,                 (void **)&amp;hOraPlsqlStatement, OCI_HTYPE_STMT,                 (size_t)0, (void **)0);  \/\/\u041f\u043e\u0434\u0433\u043e\u0442\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u0435\u0433\u043e OCIStmtPrepare(hOraPlsqlStatement, hOraErr,                 (const OraText *)insert_statement,                 (ub4)strlen(insert_statement),                 (ub4)OCI_NTV_SYNTAX, (ub4)OCI_DEFAULT);  \/\/\u0411\u0438\u043d\u0434\u0438\u043c \u043d\u0430\u0448\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 id \u0438 stringBuffer \u0432 sql-\u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 OCIBind  *bnd1p = NULL; OCIBind  *bnd2p = NULL; OCIBindByName(hOraPlsqlStatement, &amp;bnd1p,                hOraErr, (text *)\":id\", -1, (void *)&amp;id,                (sb4)sizeof(id), SQLT_INT, (void *)0,                (ub2 *)0, (ub2 *)0, (ub4)0, (ub4 *)0, OCI_DEFAULT); OCIBindByName(hOraPlsqlStatement, &amp;bnd2p,                hOraErr, (text *)\":string\", -1,                (void *)stringBuffer, (sb4)(sizeof(stringBuffer)),                SQLT_STR, (void *)0, (ub2 *)0, (ub2 *)0,                (ub4)0, (ub4 *)0, OCI_DEFAULT);  \/\/\u0432\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u0446\u0438\u043a\u043b\u0435 for (id = 1; id &lt; 10; id++) { sprintf(stringBuffer, \"This is the %d string\", id);  status = OCIStmtExecute(hOraSvcCtx, hOraPlsqlStatement, hOraErr, (ub4)1, (ub4)0, (CONST OCISnapshot *) NULL, (OCISnapshot *)NULL, OCI_DEFAULT); if (status != OCI_SUCCESS &amp;&amp; status != OCI_SUCCESS_WITH_INFO) { checkerr(hOraErr, status); OCIHandleFree(hOraPlsqlStatement, OCI_HTYPE_STMT); return FALSE; } }  \/\/\u043e\u0441\u0432\u043e\u0431\u043e\u0436\u0434\u0430\u0435\u043c \u0445\u0435\u043d\u0434\u043b OCIHandleFree(hOraPlsqlStatement, OCI_HTYPE_STMT); <\/code><\/pre>\n<\/div>\n<\/details>\n<p>\u0412 \u0446\u0435\u043b\u044f\u0445 \u0443\u0432\u0435\u043b\u0438\u0447\u0435\u043d\u0438\u044f \u0431\u044b\u0441\u0442\u0440\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0438 \u044d\u043a\u043e\u043d\u043e\u043c\u0438\u0438 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u0431\u0430\u0437\u044b \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0445 \u0438\u043d\u0441\u0435\u0440\u0442\u043e\u0432 \u043d\u0443\u0436\u043d\u043e \u0432\u043d\u0430\u0447\u0430\u043b\u0435 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u0442\u044c \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0441 \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044f\u043c\u0438 \u0442\u0438\u043f\u0430 :id \u0438 :string, \u0441\u0432\u044f\u0437\u0430\u0442\u044c \u0438\u0445 \u0441 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u043c\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c\u0438, \u0438 \u0437\u0430\u0442\u0435\u043c \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435.<\/p>\n<h3>\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435<\/h3>\n<p>\u041a\u043e\u0434 \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437 \u0431\u0430\u0437\u044b:<\/p>\n<details class=\"spoiler\">\n<summary>\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"cpp\">char * select_statement = \"select id, textfield from simple_table order by id\";  sword status;  int id; char stringBuffer[100];  OCIStmt *hOraPlsqlStatement = NULL; OCIHandleAlloc((const void *)hOraEnv,                 (void **)&amp;hOraPlsqlStatement, OCI_HTYPE_STMT,                 (size_t)0, (void **)0);   OCIStmtPrepare(hOraPlsqlStatement, hOraErr,                 (const OraText *)select_statement,                 (ub4)strlen(select_statement),                 (ub4)OCI_NTV_SYNTAX, (ub4)OCI_DEFAULT);   OCIDefine *OraIdDefine = NULL; \/\/\u041f\u0440\u0438\u0432\u044f\u0437\u044b\u0432\u0430\u0435\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e id \u043a<\/code><\/pre>\n<\/div>\n<\/details>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-411168","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/411168","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=411168"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/411168\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=411168"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=411168"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=411168"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}