{"id":95,"date":"2020-06-09T10:20:19","date_gmt":"2020-06-09T02:20:19","guid":{"rendered":"http:\/\/www.gbase8.cn\/?p=95"},"modified":"2021-04-25T15:13:00","modified_gmt":"2021-04-25T07:13:00","slug":"gbase8a-%e9%9b%86%e7%be%a4%e6%9f%a5%e7%9c%8b%e5%93%aa%e4%ba%9b%e8%87%aa%e5%ae%9a%e4%b9%89%e5%87%bd%e6%95%b0%e5%92%8c%e5%ad%98%e5%82%a8%e8%bf%87%e7%a8%8b","status":"publish","type":"post","link":"https:\/\/www.gbase8.cn\/en\/95","title":{"rendered":"\u5357\u5927\u901a\u7528GBase8a \u96c6\u7fa4\u67e5\u770b\u54ea\u4e9b\u81ea\u5b9a\u4e49\u51fd\u6570\u548c\u5b58\u50a8\u8fc7\u7a0b"},"content":{"rendered":"\n<p>GBase 8a\u6570\u636e\u5e93\u96c6\u7fa4\uff0c\u63d0\u4f9b\u4e86\u5143\u6570\u636e\u8868 gbase.proc \u67e5\u770b\u5b58\u50a8\u8fc7\u7a0b\u7684\u60c5\u51b5\uff0c \u4e5f\u53ef\u4ee5\u7528show\u7684\u5feb\u6377\u65b9\u5f0f\u67e5\u770b\u540d\u5b57\u7b49\u3002<\/p>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_84 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">\u76ee\u5f55\u5bfc\u822a<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-6a2ae6ef67ba2\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-6a2ae6ef67ba2\"  aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.gbase8.cn\/en\/95\/#gbaseproc_%E8%A1%A8%E7%BB%93%E6%9E%84\" >gbase.proc \u8868\u7ed3\u6784<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.gbase8.cn\/en\/95\/#%E5%AD%98%E5%82%A8%E8%BF%87%E7%A8%8B%E6%9F%A5%E8%AF%A2%E6%A0%B7%E4%BE%8B\" >\u5b58\u50a8\u8fc7\u7a0b\u67e5\u8be2\u6837\u4f8b<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.gbase8.cn\/en\/95\/#%E8%87%AA%E5%AE%9A%E4%B9%89%E5%87%BD%E6%95%B0%E6%9F%A5%E8%AF%A2%E6%A0%B7%E4%BE%8B\" >\u81ea\u5b9a\u4e49\u51fd\u6570\u67e5\u8be2\u6837\u4f8b<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.gbase8.cn\/en\/95\/#show_%E6%96%B9%E5%BC%8F%E6%98%BE%E7%A4%BA\" >show \u65b9\u5f0f\u663e\u793a<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"gbaseproc_%E8%A1%A8%E7%BB%93%E6%9E%84\"><\/span>gbase.proc \u8868\u7ed3\u6784<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>\u5176\u4e2d\u8bf7\u5173\u6ce8<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>\u5b57\u6bb5<\/td><td>\u542b\u4e49<\/td><\/tr><tr><td>name<br>specific_name<\/td><td>\u5b58\u50a8\u8fc7\u7a0b\u540d\u5b57<\/td><\/tr><tr><td>db<\/td><td>\u5e93\u540d<\/td><\/tr><tr><td>type<\/td><td>\u7c7b\u578b <br>procedure\u662f\u5b58\u50a8\u8fc7\u7a0b<br>function \u662f\u81ea\u5b9a\u4e49\u51fd\u6570<\/td><\/tr><tr><td>ROUTINE_DEFINITION<\/td><td>\u5b9a\u4e49\u7684\u4e3b\u4f53<\/td><\/tr><tr><td>param_list<\/td><td>\u53c2\u6570\u5217\u8868<\/td><\/tr><tr><td>returns<\/td><td>\u8fd4\u56de\u7c7b\u578b<\/td><\/tr><tr><td>body<\/td><td>\u4e3b\u4f53<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E5%AD%98%E5%82%A8%E8%BF%87%E7%A8%8B%E6%9F%A5%E8%AF%A2%E6%A0%B7%E4%BE%8B\"><\/span> \u5b58\u50a8\u8fc7\u7a0b\u67e5\u8be2\u6837\u4f8b<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>\ngbase> select * from gbase.proc where db='testdb' and name='executeSQL'\\G;\n*************************** 1. row ***************************\n                  db: testdb\n                name: executeSQL\n                type: PROCEDURE\n       specific_name: executeSQL\n            language: SQL\n     sql_data_access: CONTAINS_SQL\n    is_deterministic: NO\n       security_type: DEFINER\n          param_list:\n S_SQL_TMP VARCHAR(21000)\n\n             returns:\n                body: BEGIN\n    set @sql = S_SQL_TMP;\n  PREPARE s1 FROM @sql;\n EXECUTE s1;\n DEALLOCATE PREPARE s1;\nEND\n             definer: root@%\n             created: 2020-09-03 18:59:45\n            modified: 2020-09-03 18:59:45\n            sql_mode: PIPES_AS_CONCAT,ANSI_QUOTES,\u3002\u3002\u3002\u3002\u3002\u3002\n             comment:\ncharacter_set_client: utf8\ncollation_connection: utf8_general_ci\n        db_collation: utf8_general_ci\n           body_utf8: BEGIN\n    set @sql = S_SQL_TMP;\n  PREPARE s1 FROM @sql;\n EXECUTE s1;\n DEALLOCATE PREPARE s1;\nEND\n1 row in set (Elapsed: 00:00:00.00)\n\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E8%87%AA%E5%AE%9A%E4%B9%89%E5%87%BD%E6%95%B0%E6%9F%A5%E8%AF%A2%E6%A0%B7%E4%BE%8B\"><\/span>\u81ea\u5b9a\u4e49\u51fd\u6570\u67e5\u8be2\u6837\u4f8b<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>gbase> select * from proc where db='testdb' and name='f_test'\\G;\n*************************** 1. row ***************************\n                  db: testdb\n                name: f_test\n                type: FUNCTION\n       specific_name: f_test\n            language: SQL\n     sql_data_access: CONTAINS_SQL\n    is_deterministic: NO\n       security_type: DEFINER\n          param_list: inDate datetime\n             returns: datetime\n                body: begin\n  return date_add(inDate, interval 1 day);\nend\n             definer: root@%\n             created: 2020-09-03 21:12:19\n            modified: 2020-09-03 21:12:19\n            sql_mode: PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE\u3002\u3002\u3002\u3002\u3002\n             comment:\ncharacter_set_client: utf8\ncollation_connection: utf8_general_ci\n        db_collation: utf8_general_ci\n           body_utf8: begin\n  return date_add(inDate, interval 1 day);\nend\n1 row in set (Elapsed: 00:00:00.00)\n<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"show_%E6%96%B9%E5%BC%8F%E6%98%BE%E7%A4%BA\"><\/span>show \u65b9\u5f0f\u663e\u793a<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>show function status [where ...]<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>gbase&gt; show function status;\n+------------------------------------------------------------------+------------------------------------------------------------------+----------+-------------------------------------------------------------------------------+---------------------+---------------------+---------------+------------------------------------------------------------------+----------------------------------+----------------------------------+----------------------------------+\n| Db                                                               | Name                                                             | Type     | Definer                                                                       | Modified            | Created             | Security_type | Comment                                                          | character_set_client             | collation_connection             | Database Collation               |\n+------------------------------------------------------------------+------------------------------------------------------------------+----------+-------------------------------------------------------------------------------+---------------------+---------------------+---------------+------------------------------------------------------------------+----------------------------------+----------------------------------+----------------------------------+\n| testdb                                                           | f_test                                                           | FUNCTION | root@%                                                                        | 2020-09-03 21:12:19 | 2020-09-03 21:12:19 | DEFINER       |                                                                  | utf8                             | utf8_general_ci                  | utf8_general_ci                  |\n+------------------------------------------------------------------+------------------------------------------------------------------+----------+-------------------------------------------------------------------------------+---------------------+---------------------+---------------+------------------------------------------------------------------+----------------------------------+----------------------------------+----------------------------------+\n1 row in set (Elapsed: 00:00:00.00)\n<\/code><\/pre>\n\n\n\n<p>\u5e26where\u7684<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>gbase&gt; show function status where name='f_test';\n+------------------------------------------------------------------+------------------------------------------------------------------+----------+-------------------------------------------------------------------------------+---------------------+---------------------+---------------+------------------------------------------------------------------+----------------------------------+----------------------------------+----------------------------------+\n| Db                                                               | Name                                                             | Type     | Definer                                                                       | Modified            | Created             | Security_type | Comment                                                          | character_set_client             | collation_connection             | Database Collation               |\n+------------------------------------------------------------------+------------------------------------------------------------------+----------+-------------------------------------------------------------------------------+---------------------+---------------------+---------------+------------------------------------------------------------------+----------------------------------+----------------------------------+----------------------------------+\n| testdb                                                           | f_test                                                           | FUNCTION | root@%                                                                        | 2020-09-03 21:12:19 | 2020-09-03 21:12:19 | DEFINER       |                                                                  | utf8                             | utf8_general_ci                  | utf8_general_ci                  |\n+------------------------------------------------------------------+------------------------------------------------------------------+----------+-------------------------------------------------------------------------------+---------------------+---------------------+---------------+------------------------------------------------------------------+----------------------------------+----------------------------------+----------------------------------+\n<\/code><\/pre>\n\n\n\n<p>show procedure status [where ...];<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>gbase&gt; show procedure  status where name='ptest';\n+------------------------------------------------------------------+------------------------------------------------------------------+-----------+-------------------------------------------------------------------------------+---------------------+---------------------+---------------+------------------------------------------------------------------+----------------------------------+----------------------------------+----------------------------------+\n| Db                                                               | Name                                                             | Type      | Definer                                                                       | Modified            | Created             | Security_type | Comment                                                          | character_set_client             | collation_connection             | Database Collation               |\n+------------------------------------------------------------------+------------------------------------------------------------------+-----------+-------------------------------------------------------------------------------+---------------------+---------------------+---------------+------------------------------------------------------------------+----------------------------------+----------------------------------+----------------------------------+\n| testdb                                                           | ptest                                                            | PROCEDURE | root@%                                                                        | 2020-07-13 10:45:54 | 2020-07-13 10:45:54 | DEFINER       |                                                                  | utf8                             | utf8_general_ci                  | utf8_general_ci                  |\n+------------------------------------------------------------------+------------------------------------------------------------------+-----------+-------------------------------------------------------------------------------+---------------------+---------------------+---------------+------------------------------------------------------------------+----------------------------------+----------------------------------+----------------------------------+\n1 row in set (Elapsed: 00:00:00.00)\n\n<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<p>\u5176\u5b83\u5143\u6570\u636e\u4fe1\u606f\uff0c\u8bf7\u53c2\u8003 <\/p>\n\n\n\n<p><a href=\"http:\/\/www.gbase8.cn\/?tag=%e5%85%83%e6%95%b0%e6%8d%ae\">http:\/\/www.gbase8.cn\/?tag=%e5%85%83%e6%95%b0%e6%8d%ae<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5357\u5927\u901a\u7528GBase 8a\u6570\u636e\u5e93\u96c6\u7fa4\uff0c\u63d0\u4f9b\u4e86\u5143\u6570\u636e\u8868 gbase.proc \u67e5\u770b\u5b58\u50a8\u8fc7\u7a0b\u7684\u60c5\u51b5\uff0c \u4e5f\u53ef\u4ee5\u7528show\u7684\u5feb\u6377\u65b9\u5f0f\u67e5\u770b\u540d\u5b57\u7b49\u3002<\/p>","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[69,36,92],"class_list":["post-95","post","type-post","status-publish","format-standard","hentry","category-gbase8a","tag-69","tag-36","tag-92"],"_links":{"self":[{"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/posts\/95","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/comments?post=95"}],"version-history":[{"count":5,"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/posts\/95\/revisions"}],"predecessor-version":[{"id":4951,"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/posts\/95\/revisions\/4951"}],"wp:attachment":[{"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/media?parent=95"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/categories?post=95"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/tags?post=95"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}