{"id":15404,"date":"2023-12-04T19:55:15","date_gmt":"2023-12-04T11:55:15","guid":{"rendered":"https:\/\/wx.kaifamiao.info\/?p=15404"},"modified":"2023-12-04T19:58:20","modified_gmt":"2023-12-04T11:58:20","slug":"oracle-zhong-function-he-procedure-de-qu-bie","status":"publish","type":"post","link":"http:\/\/wx.kaifamiao.info\/index.php\/2023\/12\/04\/oracle-zhong-function-he-procedure-de-qu-bie\/","title":{"rendered":"Oracle \u4e2d function \u548c procedure \u7684\u533a\u522b\uff1f"},"content":{"rendered":"<p>\u5728 Oracle \u4e2d\uff0cFunction \u548c Procedure \u662f\u4e24\u79cd\u4e0d\u540c\u7c7b\u578b\u7684 PL\/SQL \u5b58\u50a8\u8fc7\u7a0b\uff0c\u5b83\u4eec\u6709\u4ee5\u4e0b\u533a\u522b\uff1a<\/p>\n<ol>\n<li>\n<strong>\u8fd4\u56de\u503c\uff1a<\/strong><\/p>\n<ul>\n<li>Function \u5fc5\u987b\u8fd4\u56de\u4e00\u4e2a\u503c\u7ed9\u8c03\u7528\u8005\uff0c\u53ef\u4ee5\u8fd4\u56de\u4e00\u4e2a\u5355\u4e00\u7684\u503c\u6216\u8005\u4e00\u4e2a\u8868\u3002<\/li>\n<li>Procedure \u53ef\u4ee5\u8fd4\u56de\u96f6\u4e2a\u6216\u591a\u4e2a\u53c2\u6570\uff0c\u4f46\u6ca1\u6709\u8fd4\u56de\u503c\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<strong>\u7528\u6cd5\uff1a<\/strong><\/p>\n<ul>\n<li>Function \u53ef\u4ee5\u88ab\u7528\u5728 SQL \u8bed\u53e5\u4e2d\uff0c\u53ef\u4ee5\u4f5c\u4e3a\u8868\u8fbe\u5f0f\u7684\u4e00\u90e8\u5206\u8fdb\u884c\u8c03\u7528\uff0c\u4e5f\u53ef\u4ee5\u7528\u4e8e SELECT \u8bed\u53e5\u4e2d\u8fd4\u56de\u7ed3\u679c\u3002<\/li>\n<li>Procedure \u4e0d\u80fd\u5728 SQL \u8bed\u53e5\u4e2d\u76f4\u63a5\u8c03\u7528\uff0c\u5b83\u4e3b\u8981\u7528\u4e8e\u6267\u884c\u7279\u5b9a\u7684\u64cd\u4f5c\uff0c\u800c\u4e0d\u662f\u8fd4\u56de\u7ed3\u679c\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<strong>\u8c03\u7528\u65b9\u5f0f\uff1a<\/strong><\/p>\n<ul>\n<li>Function \u53ef\u4ee5\u76f4\u63a5\u5728 SQL \u8bed\u53e5\u4e2d\u8c03\u7528\uff0c\u4e5f\u53ef\u4ee5\u5728 PL\/SQL \u5757\u4e2d\u88ab\u8c03\u7528\u3002<\/li>\n<li>Procedure \u53ea\u80fd\u901a\u8fc7 PL\/SQL \u5757\u6216\u8005\u5176\u4ed6\u5b58\u50a8\u8fc7\u7a0b\u8fdb\u884c\u8c03\u7528\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<strong>\u53c2\u6570\u4f20\u9012\uff1a<\/strong><\/p>\n<ul>\n<li>Function \u548c Procedure \u90fd\u53ef\u4ee5\u63a5\u6536\u53c2\u6570\uff0c\u5e76\u4e14\u53ef\u4ee5\u6709\u8f93\u5165\u53c2\u6570\u3001\u8f93\u51fa\u53c2\u6570\u548c\u8f93\u5165\u8f93\u51fa\u53c2\u6570\u3002<\/li>\n<li>Function \u5fc5\u987b\u8fd4\u56de\u4e00\u4e2a\u503c\uff0c\u901a\u5e38\u901a\u8fc7 RETURN \u8bed\u53e5\u8fd4\u56de\uff0c\u800c Procedure \u53ef\u4ee5\u901a\u8fc7\u53c2\u6570\u3001OUT \u53c2\u6570\u6216\u8005\u4e0d\u8fd4\u56de\u503c\u6765\u5b9e\u73b0\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<strong>\u4e8b\u52a1\u5904\u7406\uff1a<\/strong><\/p>\n<ul>\n<li>Function \u53ef\u80fd\u5305\u542b DML \u8bed\u53e5\uff0c\u4f46\u4e0d\u80fd\u76f4\u63a5\u63d0\u4ea4\u6216\u56de\u6eda\u4e8b\u52a1\u3002\u5982\u679c\u9700\u8981\u63d0\u4ea4\u6216\u56de\u6eda\u4e8b\u52a1\uff0c\u5e94\u8be5\u5728\u8c03\u7528 Function \u7684\u7a0b\u5e8f\u4e2d\u5904\u7406\u3002<\/li>\n<li>Procedure \u53ef\u4ee5\u5305\u542b DML \u8bed\u53e5\uff0c\u5e76\u4e14\u53ef\u4ee5\u5728\u8fc7\u7a0b\u5185\u90e8\u63d0\u4ea4\u6216\u56de\u6eda\u4e8b\u52a1\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p>\u8fd9\u4e9b\u662f Function \u548c Procedure \u5728 Oracle \u4e2d\u7684\u4e00\u4e9b\u4e3b\u8981\u533a\u522b\uff0c\u5b83\u4eec\u5404\u81ea\u6709\u7740\u4e0d\u540c\u7684\u7528\u9014\u548c\u9002\u7528\u573a\u666f\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5728 Oracle \u4e2d\uff0cFunction \u548c Procedure \u662f\u4e24\u79cd\u4e0d\u540c\u7c7b\u578b\u7684 PL\/SQL \u5b58\u50a8\u8fc7\u7a0b\uff0c\u5b83\u4eec [&hellip;]<\/p>\n","protected":false},"author":11,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[120],"tags":[],"class_list":["post-15404","post","type-post","status-publish","format-standard","hentry","category-oracel"],"_links":{"self":[{"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/posts\/15404","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/users\/11"}],"replies":[{"embeddable":true,"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/comments?post=15404"}],"version-history":[{"count":1,"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/posts\/15404\/revisions"}],"predecessor-version":[{"id":15405,"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/posts\/15404\/revisions\/15405"}],"wp:attachment":[{"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/media?parent=15404"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/categories?post=15404"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/tags?post=15404"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}