{"id":6143,"date":"2024-11-14T12:58:19","date_gmt":"2024-11-14T04:58:19","guid":{"rendered":"https:\/\/fwq.ai\/blog\/6143\/"},"modified":"2024-11-14T12:58:19","modified_gmt":"2024-11-14T04:58:19","slug":"%e5%a6%82%e4%bd%95%e7%94%a8navicat%e5%88%9b%e5%bb%ba%e5%ad%98%e5%82%a8%e8%bf%87%e7%a8%8b","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/6143\/","title":{"rendered":"\u5982\u4f55\u7528navicat\u521b\u5efa\u5b58\u50a8\u8fc7\u7a0b"},"content":{"rendered":"<blockquote><p>\n  \u53ef\u4f7f\u7528 navicat \u521b\u5efa\u5b58\u50a8\u8fc7\u7a0b\uff0c\u6b65\u9aa4\u5982\u4e0b\uff1a\u6253\u5f00\u6570\u636e\u5e93\u5bf9\u8c61\u5217\u8868\uff0c\u5c55\u5f00 &#8220;procedures&#8221; \u8282\u70b9\u3002\u53f3\u952e\u5355\u51fb &#8220;procedures&#8221; \u8282\u70b9\u5e76\u9009\u62e9 &#8220;create procedure&#8221;\u3002\u8f93\u5165\u5b58\u50a8\u8fc7\u7a0b\u540d\u79f0\u548c\u4e3b\u4f53\uff0c\u5e76\u8bbe\u7f6e\u53c2\u6570\uff08\u5982\u679c\u9700\u8981\uff09\u3002\u9009\u62e9 &#8220;file&#8221; \u83dc\u5355\u4e2d\u7684 &#8220;compile&#8221; \u5bf9\u5b58\u50a8\u8fc7\u7a0b\u8fdb\u884c\u7f16\u8bd1\u3002\u901a\u8fc7\u6267\u884c\u67e5\u8be2\u6216\u4f7f\u7528 &#8220;procedures&#8221; \u5217\u8868\u4e2d\u7684 &#8220;execute&#8221; \u6309\u94ae\u6267\u884c\u5b58\u50a8\u8fc7\u7a0b\u3002\n<\/p><\/blockquote>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/202406\/13\/2024061317062038028.jpg\" class=\"aligncenter\" title=\"\u5982\u4f55\u7528navicat\u521b\u5efa\u5b58\u50a8\u8fc7\u7a0b\u63d2\u56fe\" alt=\"\u5982\u4f55\u7528navicat\u521b\u5efa\u5b58\u50a8\u8fc7\u7a0b\u63d2\u56fe\" \/><\/p>\n<p><strong>\u5982\u4f55\u4f7f\u7528 Navicat \u521b\u5efa\u5b58\u50a8\u8fc7\u7a0b<\/strong><\/p>\n<p>Navicat \u662f\u4e00\u6b3e\u6570\u636e\u5e93\u7ba1\u7406\u5de5\u5177\uff0c\u53ef\u7528\u4e8e\u521b\u5efa\u548c\u7ba1\u7406\u5b58\u50a8\u8fc7\u7a0b\u3002\u672c\u6307\u5357\u5c06\u5206\u6b65\u4ecb\u7ecd\u5982\u4f55\u4f7f\u7528 Navicat \u521b\u5efa\u5b58\u50a8\u8fc7\u7a0b\u3002<\/p>\n<p><strong>\u5148\u51b3\u6761\u4ef6\uff1a<\/strong><\/p>\n<ul>\n<li>\u5df2\u5b89\u88c5 Navicat<\/li>\n<li>\u5df2\u8fde\u63a5\u5230\u6570\u636e\u5e93<\/li>\n<\/ul>\n<p><strong>\u6b65\u9aa4\uff1a<\/strong><\/p>\n<ol>\n<li> <strong>\u6253\u5f00\u6570\u636e\u5e93\u5bf9\u8c61\u5217\u8868\uff1a<\/strong>\u5728 Navicat \u4e2d\uff0c\u9009\u62e9\u8981\u521b\u5efa\u5b58\u50a8\u8fc7\u7a0b\u7684\u6570\u636e\u5e93\u3002\u53f3\u952e\u5355\u51fb\u6570\u636e\u5e93\u540d\u79f0\uff0c\u7136\u540e\u9009\u62e9 &#8220;Database Objects&#8221;\u3002<\/li>\n<li> <strong>\u521b\u5efa\u5b58\u50a8\u8fc7\u7a0b\uff1a<\/strong>\u5728 &#8220;Database Objects&#8221; \u5217\u8868\u4e2d\uff0c\u5c55\u5f00 &#8220;Procedures&#8221; \u8282\u70b9\u3002\u53f3\u952e\u5355\u51fb &#8220;Procedures&#8221; \u8282\u70b9\uff0c\u7136\u540e\u9009\u62e9 &#8220;Create Procedure&#8221;\u3002<\/li>\n<li> <strong>\u8f93\u5165\u5b58\u50a8\u8fc7\u7a0b\u8be6\u7ec6\u4fe1\u606f\uff1a<\/strong>\u5728 &#8220;New Procedure&#8221; \u5bf9\u8bdd\u6846\u4e2d\uff0c\u8f93\u5165\u5b58\u50a8\u8fc7\u7a0b\u540d\u79f0\u548c\u4e3b\u4f53\u3002\u4e3b\u4f53\u662f\u4f7f\u7528 SQL \u8bed\u53e5\u5b9a\u4e49\u7684\u5b58\u50a8\u8fc7\u7a0b\u7684\u4ee3\u7801\u3002<\/li>\n<li> <strong>\u8bbe\u7f6e\u53c2\u6570\uff08\u53ef\u9009\uff09\uff1a<\/strong>\u5982\u679c\u5b58\u50a8\u8fc7\u7a0b\u9700\u8981\u53c2\u6570\uff0c\u53ef\u4ee5\u5728 &#8220;Parameters&#8221; \u9009\u9879\u5361\u4e2d\u5b9a\u4e49\u5b83\u4eec\u3002\u8f93\u5165\u53c2\u6570\u540d\u79f0\u3001\u6570\u636e\u7c7b\u578b\u548c\u65b9\u5411\uff08\u5982\u8f93\u5165\u3001\u8f93\u51fa\u6216\u8f93\u5165\/\u8f93\u51fa\uff09\u3002<\/li>\n<li> <strong>\u7f16\u8bd1\u5b58\u50a8\u8fc7\u7a0b\uff1a<\/strong>\u8981\u6267\u884c\u5b58\u50a8\u8fc7\u7a0b\uff0c\u5fc5\u987b\u5148\u5bf9\u5176\u8fdb\u884c\u7f16\u8bd1\u3002\u5728 &#8220;File&#8221; \u83dc\u5355\u4e2d\uff0c\u9009\u62e9 &#8220;Compile&#8221;\u3002<\/li>\n<li> <strong>\u6267\u884c\u5b58\u50a8\u8fc7\u7a0b\uff1a<\/strong>\u7f16\u8bd1\u5b58\u50a8\u8fc7\u7a0b\u540e\uff0c\u53ef\u4ee5\u901a\u8fc7\u6267\u884c\u67e5\u8be2\u6216\u4f7f\u7528 &#8220;Procedures&#8221; \u5217\u8868\u4e2d\u7684 &#8220;Execute&#8221; \u6309\u94ae\u6267\u884c\u5b83\u3002<\/li>\n<\/ol>\n<p><strong>\u793a\u4f8b\uff1a<\/strong><\/p>\n<p>\u4ee5\u4e0b\u793a\u4f8b\u6f14\u793a\u4e86\u5982\u4f55\u521b\u5efa\u540d\u4e3a GetCustomerName \u7684\u5b58\u50a8\u8fc7\u7a0b\uff0c\u8be5\u5b58\u50a8\u8fc7\u7a0b\u63a5\u53d7\u4e00\u4e2a\u5ba2\u6237 ID \u5e76\u8fd4\u56de\u5ba2\u6237\u59d3\u540d\uff1a<\/p>\n<pre>CREATE PROCEDURE GetCustomerName\n(\n  IN customer_id INT\n)\nAS\nBEGIN\n  SELECT customer_name FROM customers WHERE customer_id = customer_id;\nEND;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>\u63d0\u793a\uff1a<\/strong><\/p>\n<ul>\n<li>\u4f7f\u7528\u5927\u5199\u5b57\u6bcd\u5bf9\u5b58\u50a8\u8fc7\u7a0b\u540d\u79f0\u8fdb\u884c\u547d\u540d\u3002<\/li>\n<li>\u786e\u4fdd\u5b58\u50a8\u8fc7\u7a0b\u4e3b\u4f53\u4e2d\u7684\u6240\u6709\u53d8\u91cf\u548c\u8868\u90fd\u4f7f\u7528\u9002\u5f53\u7684\u7c7b\u578b\u3002<\/li>\n<li>\u5728\u521b\u5efa\u590d\u6742\u7684\u5b58\u50a8\u8fc7\u7a0b\u4e4b\u524d\uff0c\u6700\u597d\u5148\u5bf9\u5176\u8fdb\u884c\u6d4b\u8bd5\u3002<\/li>\n<\/ul>\n<p>\u4ee5\u4e0a\u5c31\u662f\u5982\u4f55\u7528\u521b\u5efa\u5b58\u50a8\u8fc7\u7a0b\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u7f51\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u53ef\u4f7f\u7528 navicat \u521b\u5efa\u5b58\u50a8\u8fc7\u7a0b\uff0c\u6b65\u9aa4\u5982\u4e0b\uff1a\u6253\u5f00\u6570\u636e\u5e93\u5bf9\u8c61\u5217\u8868\uff0c\u5c55\u5f00 &#8220;procedures&#8221; \u8282\u70b9\u3002\u53f3\u952e\u5355\u51fb &#8220;procedures&#8221; \u8282\u70b9\u5e76\u9009\u62e9 &#8220;create procedure&#8221;\u3002\u8f93\u5165\u5b58\u50a8\u8fc7\u7a0b\u540d\u79f0\u548c\u4e3b\u4f53\uff0c\u5e76\u8bbe\u7f6e\u53c2\u6570\uff08\u5982\u679c\u9700\u8981\uff09\u3002\u9009\u62e9 &#8220;file&#8221; \u83dc\u5355\u4e2d\u7684 &#8220;compile&#8221; \u5bf9\u5b58\u50a8\u8fc7\u7a0b\u8fdb\u884c\u7f16\u8bd1\u3002\u901a\u8fc7\u6267\u884c\u67e5\u8be2\u6216\u4f7f\u7528 &#8220;procedures&#8221; \u5217\u8868\u4e2d\u7684 &#8220;execute&#8221; \u6309\u94ae\u6267\u884c\u5b58\u50a8\u8fc7\u7a0b\u3002 \u5982\u4f55\u4f7f\u7528 Navicat \u521b\u5efa\u5b58\u50a8\u8fc7\u7a0b Navicat \u662f\u4e00\u6b3e\u6570\u636e\u5e93\u7ba1\u7406\u5de5\u5177\uff0c\u53ef\u7528\u4e8e\u521b\u5efa\u548c\u7ba1\u7406\u5b58\u50a8\u8fc7\u7a0b\u3002\u672c\u6307\u5357\u5c06\u5206\u6b65\u4ecb\u7ecd\u5982\u4f55\u4f7f\u7528 Navicat \u521b\u5efa\u5b58\u50a8\u8fc7\u7a0b\u3002 \u5148\u51b3\u6761\u4ef6\uff1a \u5df2\u5b89\u88c5 Navicat \u5df2\u8fde\u63a5\u5230\u6570\u636e\u5e93 \u6b65\u9aa4\uff1a \u6253\u5f00\u6570\u636e\u5e93\u5bf9\u8c61\u5217\u8868\uff1a\u5728 Navicat \u4e2d\uff0c\u9009\u62e9\u8981\u521b\u5efa\u5b58\u50a8\u8fc7\u7a0b\u7684\u6570\u636e\u5e93\u3002\u53f3\u952e\u5355\u51fb\u6570\u636e\u5e93\u540d\u79f0\uff0c\u7136\u540e\u9009\u62e9 &#8220;Database Objects&#8221;\u3002 \u521b\u5efa\u5b58\u50a8\u8fc7\u7a0b\uff1a\u5728 &#8220;Database Objects&#8221; \u5217\u8868\u4e2d\uff0c\u5c55\u5f00 &#8220;Procedures&#8221; \u8282\u70b9\u3002\u53f3\u952e\u5355\u51fb &#8220;Procedures&#8221; \u8282\u70b9\uff0c\u7136\u540e\u9009\u62e9 &#8220;Create Procedure&#8221;\u3002 \u8f93\u5165\u5b58\u50a8\u8fc7\u7a0b\u8be6\u7ec6\u4fe1\u606f\uff1a\u5728 &#8220;New Procedure&#8221; \u5bf9\u8bdd\u6846\u4e2d\uff0c\u8f93\u5165\u5b58\u50a8\u8fc7\u7a0b\u540d\u79f0\u548c\u4e3b\u4f53\u3002\u4e3b\u4f53\u662f\u4f7f\u7528 SQL \u8bed\u53e5\u5b9a\u4e49\u7684\u5b58\u50a8\u8fc7\u7a0b\u7684\u4ee3\u7801\u3002 \u8bbe\u7f6e\u53c2\u6570\uff08\u53ef\u9009\uff09\uff1a\u5982\u679c\u5b58\u50a8\u8fc7\u7a0b\u9700\u8981\u53c2\u6570\uff0c\u53ef\u4ee5\u5728 &#8220;Parameters&#8221; \u9009\u9879\u5361\u4e2d\u5b9a\u4e49\u5b83\u4eec\u3002\u8f93\u5165\u53c2\u6570\u540d\u79f0\u3001\u6570\u636e\u7c7b\u578b\u548c\u65b9\u5411\uff08\u5982\u8f93\u5165\u3001\u8f93\u51fa\u6216\u8f93\u5165\/\u8f93\u51fa\uff09\u3002 \u7f16\u8bd1\u5b58\u50a8\u8fc7\u7a0b\uff1a\u8981\u6267\u884c\u5b58\u50a8\u8fc7\u7a0b\uff0c\u5fc5\u987b\u5148\u5bf9\u5176\u8fdb\u884c\u7f16\u8bd1\u3002\u5728 &#8220;File&#8221; [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-6143","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/6143","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=6143"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/6143\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=6143"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=6143"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=6143"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}