{"id":230096,"date":"2020-12-20T09:10:15","date_gmt":"2020-12-20T01:10:15","guid":{"rendered":"http:\/\/4563.org\/?p=230096"},"modified":"2020-12-20T09:10:15","modified_gmt":"2020-12-20T01:10:15","slug":"%e6%b1%82%e4%b8%80%e4%b8%aa-python-%e8%bf%9e%e6%8e%a5-oracle-%e7%9a%84%e8%8c%83%e4%be%8b%ef%bc%8c%e6%9c%89%e7%ba%a2%e5%8c%85%e5%a5%89%e4%b8%8a%ef%bc%81","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=230096","title":{"rendered":"\u6c42\u4e00\u4e2a Python \u8fde\u63a5 Oracle \u7684\u8303\u4f8b\uff0c\u6709\u7ea2\u5305\u5949\u4e0a\uff01"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  \u6c42\u4e00\u4e2a Python \u8fde\u63a5 Oracle \u7684\u8303\u4f8b\uff0c\u6709\u7ea2\u5305\u5949\u4e0a\uff01               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : LeeReamond <\/span>  <span><i><\/i> 6<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<p>\u4e1a\u52a1\u9700\u8981\u8bd5\u7740\u4f7f\u7528 python \u5f02\u6b65\u8fde\u63a5 oracle\uff0c\u6298\u817e\u4e86\u534a\u5929\u6ca1\u8fde\u4e0a\u3002<\/p>\n<p>\u6709\u6ca1\u6709\u5927\u4f6c\u63d0\u4f9b\u4e00\u4e9b\u8303\u4f8b\u811a\u672c\uff1f<\/p>\n<p>\uff08\u6709 mysql \u57fa\u7840\uff0c\u6ca1\u7528\u8fc7 oracle\uff0c\u76ee\u524d\u5df2\u7ecf\u5b89\u88c5\u5b8c\u6bd5 oracle 11gR2\uff0c\u5728 navicat \u4e2d\u6210\u529f\u8fde\u63a5\u3002\u7531\u4e8e\u4e1a\u52a1\u9700\u8981\u5f02\u6b65\u8fde\u63a5\uff0c\u89c2\u5bdf python \u6709 odbc \u5e93\u652f\u6301\u5f02\u6b65\u8fde\u63a5 oracle\uff0c\u8bd5\u4e86\u8bd5\u6ca1\u6709\u8c03\u8bd5\u6210\u529f\uff09<\/p>\n<p>\u6709\u6ca1\u6709\u5927\u4f6c\u52a0 QQ \u6559\u5b66\u4e00\u4e0b\u8fde\u63a5\u914d\u7f6e+\u5199\u51e0\u53e5\u8303\u4f8b\u811a\u672c\u7684\uff1f<\/p>\n<p>\u6211\u9700\u8981\u521b\u5efa\u8868\u3001\u5220\u9664\u8868\u3001\u6279\u91cf\u589e\u3001\u6279\u91cf\u5220\u3001\u6279\u91cf\u6539\uff0c\u67e5\u8be2\uff08\u53c2\u6570\u9700\u8981\u7ecf\u8fc7\u6807\u51c6\u5316\uff09\u8fd9\u516d\u6761\u8bed\u53e5\u7684\u8303\u4f8b\u3002(\u5b9e\u5728\u4e0d\u884c\u540c\u6b65\u4e5f\u884c\uff0c\u6211\u81ea\u5df1\u505a\u4e00\u4e9b\u5f02\u6b65\u5c01\u88c5\uff0c\u4f46\u6700\u597d\u662f\u7528\u6807\u51c6\u5e93\u91cc\u7684\u90a3\u4e2a\u5f02\u6b65 odbc)\u3002<\/p>\n<p>\u6709\u507f\uff01\u6709\u5c0f\u7ea2\u5305\u5949\u4e0a\uff01<\/p>\n<p>QQ\uff1aMzA5NzE1NDQyMQ==<\/p>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>4<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"4718208\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : WEAlex <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             import cx_Oracle;<\/p>\n<p>db=cx_Oracle.connect(&#8216;username&#8217;,&#8217;password&#8217;,&#8217;host\/orcl&#8217;);<\/p>\n<p>cr = db.cursor();<\/p>\n<p>sql=&#8217;select sysdate from dual&#8217;;<\/p>\n<p>cr.execute(sql);<\/p>\n<p>rs = cr.fetchall();<\/p>\n<p>db.close();                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4718209\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : black11black <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @WEAlex \u4f60\u597d\uff0c\u8bf7\u7528\u8fd9\u4e2a\u5e93 https:\/\/github.com\/mkleehammer\/pyodbc\uff0c\u641c\u4e86\u641c\u5176\u4ed6\u5e93\u6ca1\u6709\u5f02\u6b65\u7248\u672c                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4718210\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : black11black <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u4e3b\u8fd9\u4e2a\u9700\u6c42\u6211\u8fde\u4e86\u4e00\u4e0b\u4e5f\u6ca1\u8fde\u4e0a\uff0c\u54c8\u54c8                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4718211\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : fub2020 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u8bf4\u4e2a\u601d\u8def\u5427<br \/>\u7528 C \u8bed\u8a00\u53bb\u5b9e\u73b0\u529f\u80fd\uff0c\u5728\u8ba9 python \u53bb\u8c03\u7528                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>\u6c42\u4e00\u4e2a Python \u8fde\u63a5 Ora&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/230096"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=230096"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/230096\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=230096"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=230096"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=230096"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}