{"id":87904,"date":"2024-10-18T04:57:19","date_gmt":"2024-10-17T20:57:19","guid":{"rendered":"https:\/\/server.hk\/cnblog\/87904\/"},"modified":"2024-10-18T04:57:19","modified_gmt":"2024-10-17T20:57:19","slug":"ora-22371-%e8%a1%a8%e5%8c%85%e5%90%ab%e9%a1%9e%e5%9e%8b-string-string%e3%80%81%e7%89%88%e6%9c%ac-string-%e7%9a%84%e6%95%b8%e6%93%9a%ef%bc%8c%e8%a9%b2%e7%89%88%e6%9c%ac%e4%b8%8d%e5%ad%98%e5%9c%a8-orac","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/87904\/","title":{"rendered":"ORA-22371: \u8868\u5305\u542b\u985e\u578b string.string\u3001\u7248\u672c string \u7684\u6578\u64da\uff0c\u8a72\u7248\u672c\u4e0d\u5b58\u5728 ORACLE \u5831\u932f \u6545\u969c\u4fee\u5fa9 \u9060\u7a0b\u8655\u7406"},"content":{"rendered":"<h1 id=\"ora-22371-%e8%a1%a8%e5%8c%85%e5%90%ab%e9%a1%9e%e5%9e%8b-string-string%e3%80%81%e7%89%88%e6%9c%ac-string-%e7%9a%84%e6%95%b8%e6%93%9a%ef%bc%8c%e8%a9%b2%e7%89%88%e6%9c%ac%e4%b8%8d%e5%ad%98%e5%9c%a8-orac-UgyGTVAipQ\">ORA-22371: \u8868\u5305\u542b\u985e\u578b string.string\u3001\u7248\u672c string \u7684\u6578\u64da\uff0c\u8a72\u7248\u672c\u4e0d\u5b58\u5728 ORACLE \u5831\u932f \u6545\u969c\u4fee\u5fa9 \u9060\u7a0b\u8655\u7406<\/h1>\n<p>\u5728\u4f7f\u7528 Oracle \u6578\u64da\u5eab\u7684\u904e\u7a0b\u4e2d\uff0c\u958b\u767c\u8005\u548c\u6578\u64da\u5eab\u7ba1\u7406\u54e1\u53ef\u80fd\u6703\u9047\u5230\u5404\u7a2e\u932f\u8aa4\u4ee3\u78bc\uff0c\u5176\u4e2d\u4e4b\u4e00\u4fbf\u662f <code>ORA-22371<\/code>\u3002\u9019\u500b\u932f\u8aa4\u901a\u5e38\u8868\u793a\u6578\u64da\u8868\u4e2d\u5305\u542b\u4e86\u4e00\u500b\u7279\u5b9a\u985e\u578b\u7684\u6578\u64da\uff0c\u4f46\u8a72\u6578\u64da\u7684\u7248\u672c\u5728\u6578\u64da\u5eab\u4e2d\u4e26\u4e0d\u5b58\u5728\u3002\u672c\u6587\u5c07\u6df1\u5165\u63a2\u8a0e <code>ORA-22371<\/code> \u932f\u8aa4\u7684\u6210\u56e0\u3001\u5f71\u97ff\u4ee5\u53ca\u5982\u4f55\u9032\u884c\u6545\u969c\u4fee\u5fa9\u3002<\/p>\n<h2 id=\"%e9%8c%af%e8%aa%a4%e6%88%90%e5%9b%a0-UgyGTVAipQ\">\u932f\u8aa4\u6210\u56e0<\/h2>\n<p><code>ORA-22371<\/code> \u932f\u8aa4\u901a\u5e38\u51fa\u73fe\u5728\u4ee5\u4e0b\u5e7e\u7a2e\u60c5\u6cc1\u4e0b\uff1a<\/p>\n<ul>\n<li><strong>\u6578\u64da\u985e\u578b\u7248\u672c\u4e0d\u5339\u914d\uff1a<\/strong>\u7576\u4e00\u500b\u8868\u4e2d\u5b58\u5132\u4e86\u67d0\u500b\u5c0d\u8c61\u985e\u578b\u7684\u6578\u64da\uff0c\u4f46\u8a72\u5c0d\u8c61\u985e\u578b\u7684\u7248\u672c\u5728\u6578\u64da\u5eab\u4e2d\u5df2\u7d93\u88ab\u522a\u9664\u6216\u66f4\u6539\uff0c\u5247\u6703\u5c0e\u81f4\u6b64\u932f\u8aa4\u3002<\/li>\n<li><strong>\u6578\u64da\u5eab\u5347\u7d1a\u6216\u8b8a\u66f4\uff1a<\/strong>\u5728\u9032\u884c\u6578\u64da\u5eab\u5347\u7d1a\u6216\u5c0d\u5c0d\u8c61\u985e\u578b\u9032\u884c\u8b8a\u66f4\u6642\uff0c\u53ef\u80fd\u6703\u51fa\u73fe\u7248\u672c\u4e0d\u4e00\u81f4\u7684\u60c5\u6cc1\u3002<\/li>\n<li><strong>\u4e0d\u6b63\u78ba\u7684\u6578\u64da\u5c0e\u5165\uff1a<\/strong>\u5982\u679c\u5f9e\u5176\u4ed6\u6578\u64da\u5eab\u5c0e\u5165\u6578\u64da\u6642\uff0c\u672a\u80fd\u6b63\u78ba\u8655\u7406\u5c0d\u8c61\u985e\u578b\u7684\u7248\u672c\uff0c\u5247\u53ef\u80fd\u6703\u5c0e\u81f4\u6b64\u932f\u8aa4\u3002<\/li>\n<\/ul>\n<h2 id=\"%e5%bd%b1%e9%9f%bf%e7%af%84%e5%9c%8d-UgyGTVAipQ\">\u5f71\u97ff\u7bc4\u570d<\/h2>\n<p>\u7576 <code>ORA-22371<\/code> \u932f\u8aa4\u767c\u751f\u6642\uff0c\u5c07\u6703\u5f71\u97ff\u5230\u6578\u64da\u7684\u8b80\u53d6\u548c\u64cd\u4f5c\u3002\u9019\u53ef\u80fd\u5c0e\u81f4\u61c9\u7528\u7a0b\u5e8f\u7121\u6cd5\u6b63\u5e38\u904b\u884c\uff0c\u4e26\u5f71\u97ff\u5230\u7528\u6236\u7684\u9ad4\u9a57\u3002\u6b64\u5916\uff0c\u9019\u4e5f\u53ef\u80fd\u6703\u5f71\u97ff\u5230\u6578\u64da\u7684\u5b8c\u6574\u6027\u548c\u4e00\u81f4\u6027\uff0c\u7279\u5225\u662f\u5728\u591a\u7528\u6236\u74b0\u5883\u4e2d\u3002<\/p>\n<h2 id=\"%e6%95%85%e9%9a%9c%e4%bf%ae%e5%be%a9%e6%ad%a5%e9%a9%9f-UgyGTVAipQ\">\u6545\u969c\u4fee\u5fa9\u6b65\u9a5f<\/h2>\n<p>\u8981\u4fee\u5fa9 <code>ORA-22371<\/code> \u932f\u8aa4\uff0c\u53ef\u4ee5\u6309\u7167\u4ee5\u4e0b\u6b65\u9a5f\u9032\u884c\uff1a<\/p>\n<h3 id=\"1-%e7%a2%ba%e8%aa%8d%e5%b0%8d%e8%b1%a1%e9%a1%9e%e5%9e%8b%e7%9a%84%e7%89%88%e6%9c%ac-UgyGTVAipQ\">1. \u78ba\u8a8d\u5c0d\u8c61\u985e\u578b\u7684\u7248\u672c<\/h3>\n<p>\u9996\u5148\uff0c\u60a8\u9700\u8981\u78ba\u8a8d\u6578\u64da\u5eab\u4e2d\u5c0d\u8c61\u985e\u578b\u7684\u7248\u672c\u3002\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b SQL \u67e5\u8a62\u4f86\u6aa2\u67e5\uff1a<\/p>\n<pre><code>SELECT type_name, type_version \nFROM user_types \nWHERE type_name = 'YOUR_TYPE_NAME';<\/code><\/pre>\n<p>\u5c07 <code>YOUR_TYPE_NAME<\/code> \u66ff\u63db\u70ba\u60a8\u9047\u5230\u554f\u984c\u7684\u5c0d\u8c61\u985e\u578b\u540d\u7a31\u3002<\/p>\n<h3 id=\"2-%e6%9b%b4%e6%96%b0%e6%88%96%e9%87%8d%e5%bb%ba%e5%b0%8d%e8%b1%a1%e9%a1%9e%e5%9e%8b-UgyGTVAipQ\">2. \u66f4\u65b0\u6216\u91cd\u5efa\u5c0d\u8c61\u985e\u578b<\/h3>\n<p>\u5982\u679c\u767c\u73fe\u5c0d\u8c61\u985e\u578b\u7684\u7248\u672c\u4e0d\u6b63\u78ba\uff0c\u60a8\u53ef\u4ee5\u9078\u64c7\u66f4\u65b0\u6216\u91cd\u5efa\u8a72\u5c0d\u8c61\u985e\u578b\u3002\u4f7f\u7528\u4ee5\u4e0b SQL \u8a9e\u53e5\u4f86\u91cd\u5efa\u5c0d\u8c61\u985e\u578b\uff1a<\/p>\n<pre><code>CREATE OR REPLACE TYPE your_type_name AS OBJECT (\n    attribute1 datatype,\n    attribute2 datatype\n);<\/code><\/pre>\n<h3 id=\"3-%e4%bf%ae%e5%be%a9%e6%95%b8%e6%93%9a-UgyGTVAipQ\">3. \u4fee\u5fa9\u6578\u64da<\/h3>\n<p>\u5728\u78ba\u8a8d\u5c0d\u8c61\u985e\u578b\u5df2\u6b63\u78ba\u66f4\u65b0\u5f8c\uff0c\u60a8\u9700\u8981\u6aa2\u67e5\u4e26\u4fee\u5fa9\u8868\u4e2d\u7684\u6578\u64da\u3002\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b SQL \u67e5\u8a62\u4f86\u67e5\u627e\u4e0d\u6b63\u78ba\u7684\u6578\u64da\uff1a<\/p>\n<pre><code>SELECT * \nFROM your_table \nWHERE your_column IS NOT NULL \nAND your_column NOT IN (SELECT your_column FROM your_type_name);<\/code><\/pre>\n<p>\u6839\u64da\u67e5\u8a62\u7d50\u679c\uff0c\u60a8\u53ef\u4ee5\u9078\u64c7\u522a\u9664\u6216\u66f4\u65b0\u4e0d\u6b63\u78ba\u7684\u6578\u64da\u3002<\/p>\n<h3 id=\"4-%e6%b8%ac%e8%a9%a6%e5%92%8c%e9%a9%97%e8%ad%89-UgyGTVAipQ\">4. \u6e2c\u8a66\u548c\u9a57\u8b49<\/h3>\n<p>\u5728\u5b8c\u6210\u4e0a\u8ff0\u6b65\u9a5f\u5f8c\uff0c\u8acb\u52d9\u5fc5\u9032\u884c\u6e2c\u8a66\u4ee5\u78ba\u4fdd\u554f\u984c\u5df2\u7d93\u89e3\u6c7a\u3002\u53ef\u4ee5\u901a\u904e\u57f7\u884c\u539f\u672c\u5c0e\u81f4\u932f\u8aa4\u7684\u64cd\u4f5c\u4f86\u9a57\u8b49\u3002<\/p>\n<h2 id=\"%e7%b5%90%e8%ab%96-UgyGTVAipQ\">\u7d50\u8ad6<\/h2>\n<p>\u7e3d\u7d50\u4f86\u8aaa\uff0c<code>ORA-22371<\/code> \u932f\u8aa4\u662f\u7531\u65bc\u5c0d\u8c61\u985e\u578b\u7248\u672c\u4e0d\u5339\u914d\u6240\u5f15\u8d77\u7684\u3002\u901a\u904e\u78ba\u8a8d\u5c0d\u8c61\u985e\u578b\u7684\u7248\u672c\u3001\u66f4\u65b0\u6216\u91cd\u5efa\u5c0d\u8c61\u985e\u578b\u3001\u4fee\u5fa9\u6578\u64da\u4ee5\u53ca\u9032\u884c\u6e2c\u8a66\uff0c\u60a8\u53ef\u4ee5\u6709\u6548\u5730\u89e3\u6c7a\u6b64\u554f\u984c\u3002\u5c0d\u65bc\u4f7f\u7528 Oracle \u6578\u64da\u5eab\u7684\u958b\u767c\u8005\u548c\u7ba1\u7406\u54e1\u4f86\u8aaa\uff0c\u4e86\u89e3\u9019\u4e9b\u6545\u969c\u4fee\u5fa9\u6b65\u9a5f\u662f\u975e\u5e38\u91cd\u8981\u7684\u3002<\/p>\n<p>\u5982\u9700\u9032\u4e00\u6b65\u4e86\u89e3\u6709\u95dc <a href=\"https:\/\/server.hk\">\u9999\u6e2fVPS<\/a> \u548c\u5176\u4ed6\u6578\u64da\u5eab\u7ba1\u7406\u89e3\u6c7a\u65b9\u6848\u7684\u4fe1\u606f\uff0c\u8acb\u8a2a\u554f\u6211\u5011\u7684\u7db2\u7ad9\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u89e3\u6c7a ORA-22371 \u932f\u8aa4\uff1a\u8868\u5305\u542b\u985e\u578b string.string\u3001\u7248\u672c string \u7684\u6578\u64da\uff0c\u8a72\u7248\u672c\u4e0d\u5b58\u5728\uff0c\u63d0\u4f9b\u6545\u969c\u4fee\u5fa9\u548c\u9060\u7a0b\u8655\u7406\u65b9\u6848\u3002<\/p>\n","protected":false},"author":0,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[101],"tags":[],"class_list":["post-87904","post","type-post","status-publish","format-standard","hentry","category-database"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/87904","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/types\/post"}],"replies":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/comments?post=87904"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/87904\/revisions"}],"predecessor-version":[{"id":87905,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/87904\/revisions\/87905"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=87904"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=87904"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=87904"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}