{"id":15927,"date":"2023-12-04T23:48:51","date_gmt":"2023-12-04T15:48:51","guid":{"rendered":"https:\/\/wx.kaifamiao.info\/?p=15927"},"modified":"2023-12-05T00:06:08","modified_gmt":"2023-12-04T16:06:08","slug":"oracle-zhong-function-he-procedure-de-qu-bie-2","status":"publish","type":"post","link":"http:\/\/wx.kaifamiao.info\/index.php\/2023\/12\/04\/oracle-zhong-function-he-procedure-de-qu-bie-2\/","title":{"rendered":"Oracle \u4e2d function \u548c procedure \u7684\u533a\u522b\uff1f"},"content":{"rendered":"<p>\u5728 Oracle \u6570\u636e\u5e93\u4e2d\uff0cFunction\uff08\u51fd\u6570\uff09\u548c Procedure\uff08\u5b58\u50a8\u8fc7\u7a0b\uff09\u662f\u4e24\u79cd\u4e0d\u540c\u7c7b\u578b\u7684 PL\/SQL \u5b58\u50a8\u8fc7\u7a0b\uff0c\u5b83\u4eec\u6709\u4e00\u4e9b\u5173\u952e\u7684\u533a\u522b\uff1a<\/p>\n<ol>\n<li>\n<strong>\u8fd4\u56de\u503c\uff1a<\/strong><\/p>\n<ul>\n<li><strong>Function\uff1a<\/strong> \u5fc5\u987b\u8fd4\u56de\u4e00\u4e2a\u503c\u3002\u51fd\u6570\u901a\u8fc7 <code>RETURN<\/code> \u8bed\u53e5\u8fd4\u56de\u4e00\u4e2a\u7ed3\u679c\u7ed9\u8c03\u7528\u8005\u3002<\/li>\n<li><strong>Procedure\uff1a<\/strong> \u4e0d\u9700\u8981\u8fd4\u56de\u503c\u3002\u5b58\u50a8\u8fc7\u7a0b\u901a\u5e38\u7528\u4e8e\u6267\u884c\u4e00\u7cfb\u5217\u64cd\u4f5c\uff0c\u800c\u4e0d\u8fd4\u56de\u5355\u4e00\u7684\u7ed3\u679c\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<strong>\u8c03\u7528\u65b9\u5f0f\uff1a<\/strong><\/p>\n<ul>\n<li><strong>Function\uff1a<\/strong> \u53ef\u4ee5\u5728 SQL \u67e5\u8be2\u4e2d\u76f4\u63a5\u8c03\u7528\uff0c\u4e5f\u53ef\u4ee5\u5728 PL\/SQL \u5757\u4e2d\u8c03\u7528\u3002<\/li>\n<li><strong>Procedure\uff1a<\/strong> \u901a\u5e38\u5728 PL\/SQL \u5757\u4e2d\u8c03\u7528\uff0c\u4e0d\u80fd\u5728 SQL \u67e5\u8be2\u4e2d\u76f4\u63a5\u4f7f\u7528\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<strong>\u7528\u9014\uff1a<\/strong><\/p>\n<ul>\n<li><strong>Function\uff1a<\/strong> \u7528\u4e8e\u6267\u884c\u8ba1\u7b97\u5e76\u8fd4\u56de\u5355\u4e00\u503c\uff0c\u7c7b\u4f3c\u4e8e SQL \u4e2d\u7684\u8868\u8fbe\u5f0f\u3002<\/li>\n<li><strong>Procedure\uff1a<\/strong> \u7528\u4e8e\u6267\u884c\u4e00\u7cfb\u5217\u64cd\u4f5c\uff0c\u53ef\u4ee5\u5305\u542b\u8f93\u5165\u53c2\u6570\u548c\u8f93\u51fa\u53c2\u6570\uff0c\u4f46\u901a\u5e38\u6ca1\u6709\u76f4\u63a5\u8fd4\u56de\u503c\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<strong>\u4e8b\u52a1\u5904\u7406\uff1a<\/strong><\/p>\n<ul>\n<li><strong>Function\uff1a<\/strong> \u53ef\u80fd\u4f1a\u5f15\u8d77\u4e8b\u52a1\u7684\u4e0d\u7a33\u5b9a\u6027\uff0c\u56e0\u4e3a\u5b83\u53ef\u80fd\u5305\u542b\u4e00\u4e9b\u4e0d\u53ef\u56de\u6eda\u7684\u64cd\u4f5c\u3002<\/li>\n<li><strong>Procedure\uff1a<\/strong> \u66f4\u9002\u5408\u5305\u542b\u4e8b\u52a1\u5904\u7406\u903b\u8f91\uff0c\u53ef\u4ee5\u5305\u542b\u63d0\u4ea4\uff08<code>COMMIT<\/code>\uff09\u6216\u56de\u6eda\uff08<code>ROLLBACK<\/code>\uff09\u4e8b\u52a1\u7684\u64cd\u4f5c\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<strong>\u7528\u6cd5\uff1a<\/strong><\/p>\n<ul>\n<li><strong>Function\uff1a<\/strong> \u901a\u5e38\u7528\u4e8e\u8ba1\u7b97\u548c\u8fd4\u56de\u4e00\u4e2a\u503c\uff0c\u5982\u8ba1\u7b97\u603b\u548c\u3001\u5e73\u5747\u503c\u7b49\u3002<\/li>\n<li><strong>Procedure\uff1a<\/strong> \u901a\u5e38\u7528\u4e8e\u6267\u884c\u4e00\u7cfb\u5217\u7684\u64cd\u4f5c\uff0c\u5982\u66f4\u65b0\u591a\u4e2a\u8868\u3001\u63d2\u5165\u6570\u636e\u7b49\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<strong>\u8fd4\u56de\u7c7b\u578b\uff1a<\/strong><\/p>\n<ul>\n<li><strong>Function\uff1a<\/strong> \u5fc5\u987b\u58f0\u660e\u8fd4\u56de\u7c7b\u578b\uff0c\u53ef\u4ee5\u662f\u4efb\u4f55\u6709\u6548\u7684\u6570\u636e\u7c7b\u578b\u3002<\/li>\n<li><strong>Procedure\uff1a<\/strong> \u4e0d\u9700\u8981\u58f0\u660e\u8fd4\u56de\u7c7b\u578b\uff0c\u56e0\u4e3a\u5b83\u901a\u5e38\u6ca1\u6709\u660e\u786e\u7684\u8fd4\u56de\u503c\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p>\u603b\u7684\u6765\u8bf4\uff0cFunction \u4e3b\u8981\u7528\u4e8e\u8ba1\u7b97\u5e76\u8fd4\u56de\u4e00\u4e2a\u503c\uff0c\u800c Procedure \u4e3b\u8981\u7528\u4e8e\u6267\u884c\u4e00\u7cfb\u5217\u7684\u64cd\u4f5c\u3002\u9009\u62e9\u4f7f\u7528\u54ea\u79cd\u53d6\u51b3\u4e8e\u4efb\u52a1\u7684\u6027\u8d28\u548c\u9700\u8981\u7684\u529f\u80fd\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5728 Oracle \u6570\u636e\u5e93\u4e2d\uff0cFunction\uff08\u51fd\u6570\uff09\u548c Procedure\uff08\u5b58\u50a8\u8fc7\u7a0b\uff09\u662f\u4e24\u79cd\u4e0d\u540c\u7c7b\u578b\u7684 PL\/ [&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-15927","post","type-post","status-publish","format-standard","hentry","category-oracel"],"_links":{"self":[{"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/posts\/15927","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=15927"}],"version-history":[{"count":1,"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/posts\/15927\/revisions"}],"predecessor-version":[{"id":15928,"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/posts\/15927\/revisions\/15928"}],"wp:attachment":[{"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/media?parent=15927"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/categories?post=15927"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/tags?post=15927"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}