{"id":89852,"date":"2024-10-18T13:22:18","date_gmt":"2024-10-18T05:22:18","guid":{"rendered":"https:\/\/server.hk\/cnblog\/89852\/"},"modified":"2024-10-18T13:22:18","modified_gmt":"2024-10-18T05:22:18","slug":"ora-26874-%e5%ad%97%e7%ac%a6%e4%b8%b2%e6%8d%95%e7%8d%b2%e9%81%8e%e7%a8%8b%e5%ad%97%e7%ac%a6%e4%b8%b2%e7%84%a1%e6%b3%95%e6%8b%86%e5%88%86%e3%80%82-oracle-%e5%a0%b1%e9%8c%af-%e6%95%85","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/89852\/","title":{"rendered":"ORA-26874: \u5b57\u7b26\u4e32\u6355\u7372\u904e\u7a0b\u201c\u5b57\u7b26\u4e32\u201d\u7121\u6cd5\u62c6\u5206\u3002 ORACLE \u5831\u932f \u6545\u969c\u4fee\u5fa9 \u9060\u7a0b\u8655\u7406"},"content":{"rendered":"<h1 id=\"ora-26874-%e5%ad%97%e7%ac%a6%e4%b8%b2%e6%8d%95%e7%8d%b2%e9%81%8e%e7%a8%8b%e5%ad%97%e7%ac%a6%e4%b8%b2%e7%84%a1%e6%b3%95%e6%8b%86%e5%88%86-itwpmVEMcD\">ORA-26874: \u5b57\u7b26\u4e32\u6355\u7372\u904e\u7a0b\u201c\u5b57\u7b26\u4e32\u201d\u7121\u6cd5\u62c6\u5206<\/h1>\n<p>\u5728\u4f7f\u7528Oracle\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\u662fORA-26874\u3002\u9019\u500b\u932f\u8aa4\u901a\u5e38\u8207\u5b57\u7b26\u4e32\u8655\u7406\u6709\u95dc\uff0c\u7279\u5225\u662f\u5728\u9032\u884c\u5b57\u7b26\u4e32\u62c6\u5206\u6642\u51fa\u73fe\u554f\u984c\u3002\u672c\u6587\u5c07\u6df1\u5165\u63a2\u8a0eORA-26874\u7684\u539f\u56e0\u3001\u5f71\u97ff\u4ee5\u53ca\u6545\u969c\u4fee\u5fa9\u7684\u6b65\u9a5f\u3002<\/p>\n<h2 id=\"ora-26874%e7%9a%84%e5%8e%9f%e5%9b%a0-itwpmVEMcD\">ORA-26874\u7684\u539f\u56e0<\/h2>\n<p>ORA-26874\u932f\u8aa4\u901a\u5e38\u767c\u751f\u5728\u4f7f\u7528Oracle\u7684\u5b57\u7b26\u4e32\u6355\u7372\u904e\u7a0b\u6642\uff0c\u7576\u7cfb\u7d71\u7121\u6cd5\u6b63\u78ba\u62c6\u5206\u5b57\u7b26\u4e32\u6642\uff0c\u4fbf\u6703\u5f15\u767c\u6b64\u932f\u8aa4\u3002\u9019\u53ef\u80fd\u662f\u7531\u65bc\u4ee5\u4e0b\u5e7e\u500b\u539f\u56e0\uff1a<\/p>\n<ul>\n<li><strong>\u5b57\u7b26\u4e32\u683c\u5f0f\u4e0d\u6b63\u78ba\uff1a<\/strong>\u5982\u679c\u8f38\u5165\u7684\u5b57\u7b26\u4e32\u4e0d\u7b26\u5408\u9810\u671f\u7684\u683c\u5f0f\uff0c\u7cfb\u7d71\u5c07\u7121\u6cd5\u9032\u884c\u62c6\u5206\u3002<\/li>\n<li><strong>\u5206\u9694\u7b26\u7f3a\u5931\uff1a<\/strong>\u5728\u9032\u884c\u5b57\u7b26\u4e32\u62c6\u5206\u6642\uff0c\u82e5\u6307\u5b9a\u7684\u5206\u9694\u7b26\u4e0d\u5b58\u5728\u65bc\u5b57\u7b26\u4e32\u4e2d\uff0c\u5247\u6703\u5c0e\u81f4\u932f\u8aa4\u3002<\/li>\n<li><strong>\u6578\u64da\u985e\u578b\u4e0d\u5339\u914d\uff1a<\/strong>\u5982\u679c\u50b3\u905e\u7d66\u5b57\u7b26\u4e32\u6355\u7372\u904e\u7a0b\u7684\u53c3\u6578\u985e\u578b\u4e0d\u6b63\u78ba\uff0c\u5247\u53ef\u80fd\u6703\u5f15\u767c\u6b64\u932f\u8aa4\u3002<\/li>\n<\/ul>\n<h2 id=\"%e5%bd%b1%e9%9f%bf-itwpmVEMcD\">\u5f71\u97ff<\/h2>\n<p>\u7576ORA-26874\u932f\u8aa4\u767c\u751f\u6642\uff0c\u5c07\u6703\u5f71\u97ff\u5230\u6578\u64da\u7684\u8655\u7406\u6d41\u7a0b\uff0c\u53ef\u80fd\u5c0e\u81f4\u61c9\u7528\u7a0b\u5e8f\u7121\u6cd5\u6b63\u5e38\u904b\u884c\u3002\u9019\u4e0d\u50c5\u6703\u5f71\u97ff\u7528\u6236\u9ad4\u9a57\uff0c\u9084\u53ef\u80fd\u5c0e\u81f4\u6578\u64da\u4e1f\u5931\u6216\u4e0d\u4e00\u81f4\u3002\u56e0\u6b64\uff0c\u53ca\u6642\u4fee\u5fa9\u6b64\u932f\u8aa4\u662f\u975e\u5e38\u91cd\u8981\u7684\u3002<\/p>\n<h2 id=\"%e6%95%85%e9%9a%9c%e4%bf%ae%e5%be%a9%e6%ad%a5%e9%a9%9f-itwpmVEMcD\">\u6545\u969c\u4fee\u5fa9\u6b65\u9a5f<\/h2>\n<p>\u4fee\u5fa9ORA-26874\u932f\u8aa4\u7684\u904e\u7a0b\u53ef\u4ee5\u5206\u70ba\u5e7e\u500b\u6b65\u9a5f\uff1a<\/p>\n<h3 id=\"1-%e6%aa%a2%e6%9f%a5%e5%ad%97%e7%ac%a6%e4%b8%b2%e6%a0%bc%e5%bc%8f-itwpmVEMcD\">1. \u6aa2\u67e5\u5b57\u7b26\u4e32\u683c\u5f0f<\/h3>\n<p>\u9996\u5148\uff0c\u6aa2\u67e5\u50b3\u905e\u7d66\u5b57\u7b26\u4e32\u6355\u7372\u904e\u7a0b\u7684\u5b57\u7b26\u4e32\u683c\u5f0f\u3002\u78ba\u4fdd\u5b57\u7b26\u4e32\u7b26\u5408\u9810\u671f\u7684\u683c\u5f0f\u8981\u6c42\u3002\u4f8b\u5982\uff0c\u5982\u679c\u9810\u671f\u7684\u683c\u5f0f\u662f\u201c\u503c1,\u503c2,\u503c3\u201d\uff0c\u90a3\u9ebc\u78ba\u4fdd\u5b57\u7b26\u4e32\u4e2d\u5305\u542b\u6b63\u78ba\u7684\u5206\u9694\u7b26\u3002<\/p>\n<pre><code>DECLARE\n    v_string VARCHAR2(100) := '\u503c1,\u503c2,\u503c3';\nBEGIN\n    -- \u6aa2\u67e5\u5b57\u7b26\u4e32\u683c\u5f0f\n    IF INSTR(v_string, ',') = 0 THEN\n        RAISE_APPLICATION_ERROR(-20001, '\u5b57\u7b26\u4e32\u683c\u5f0f\u4e0d\u6b63\u78ba');\n    END IF;\nEND;\n<\/code><\/pre>\n<h3 id=\"2-%e7%a2%ba%e8%aa%8d%e5%88%86%e9%9a%94%e7%ac%a6%e7%9a%84%e5%ad%98%e5%9c%a8-itwpmVEMcD\">2. \u78ba\u8a8d\u5206\u9694\u7b26\u7684\u5b58\u5728<\/h3>\n<p>\u5728\u9032\u884c\u5b57\u7b26\u4e32\u62c6\u5206\u4e4b\u524d\uff0c\u78ba\u8a8d\u6240\u4f7f\u7528\u7684\u5206\u9694\u7b26\u662f\u5426\u5b58\u5728\u65bc\u5b57\u7b26\u4e32\u4e2d\u3002\u5982\u679c\u5206\u9694\u7b26\u7f3a\u5931\uff0c\u5247\u9700\u8981\u6839\u64da\u5be6\u969b\u60c5\u6cc1\u9032\u884c\u8abf\u6574\u3002<\/p>\n<pre><code>DECLARE\n    v_string VARCHAR2(100) := '\u503c1\u503c2\u503c3';\nBEGIN\n    -- \u78ba\u8a8d\u5206\u9694\u7b26\n    IF INSTR(v_string, ',') = 0 THEN\n        RAISE_APPLICATION_ERROR(-20002, '\u5206\u9694\u7b26\u7f3a\u5931');\n    END IF;\nEND;\n<\/code><\/pre>\n<h3 id=\"3-%e6%aa%a2%e6%9f%a5%e6%95%b8%e6%93%9a%e9%a1%9e%e5%9e%8b-itwpmVEMcD\">3. \u6aa2\u67e5\u6578\u64da\u985e\u578b<\/h3>\n<p>\u78ba\u4fdd\u50b3\u905e\u7d66\u5b57\u7b26\u4e32\u6355\u7372\u904e\u7a0b\u7684\u53c3\u6578\u985e\u578b\u6b63\u78ba\u3002\u5982\u679c\u985e\u578b\u4e0d\u5339\u914d\uff0c\u5247\u9700\u8981\u9032\u884c\u76f8\u61c9\u7684\u8f49\u63db\u3002<\/p>\n<pre><code>DECLARE\n    v_string VARCHAR2(100) := '\u503c1,\u503c2,\u503c3';\n    v_array DBMS_UTILITY.LNAME_ARRAY;\nBEGIN\n    -- \u6aa2\u67e5\u6578\u64da\u985e\u578b\n    IF TYPEOF(v_string) != 'VARCHAR2' THEN\n        RAISE_APPLICATION_ERROR(-20003, '\u6578\u64da\u985e\u578b\u4e0d\u5339\u914d');\n    END IF;\nEND;\n<\/code><\/pre>\n<h2 id=\"%e7%b8%bd%e7%b5%90-itwpmVEMcD\">\u7e3d\u7d50<\/h2>\n<p>ORA-26874\u932f\u8aa4\u901a\u5e38\u8207\u5b57\u7b26\u4e32\u6355\u7372\u904e\u7a0b\u4e2d\u7684\u5b57\u7b26\u4e32\u62c6\u5206\u6709\u95dc\uff0c\u53ef\u80fd\u7531\u65bc\u5b57\u7b26\u4e32\u683c\u5f0f\u4e0d\u6b63\u78ba\u3001\u5206\u9694\u7b26\u7f3a\u5931\u6216\u6578\u64da\u985e\u578b\u4e0d\u5339\u914d\u7b49\u539f\u56e0\u5f15\u8d77\u3002\u901a\u904e\u6aa2\u67e5\u5b57\u7b26\u4e32\u683c\u5f0f\u3001\u78ba\u8a8d\u5206\u9694\u7b26\u7684\u5b58\u5728\u4ee5\u53ca\u6aa2\u67e5\u6578\u64da\u985e\u578b\uff0c\u53ef\u4ee5\u6709\u6548\u5730\u4fee\u5fa9\u6b64\u932f\u8aa4\u3002\u5c0d\u65bc\u9700\u8981\u7a69\u5b9a\u904b\u884c\u7684\u61c9\u7528\u7a0b\u5e8f\uff0c\u53ca\u6642\u89e3\u6c7a\u9019\u4e9b\u554f\u984c\u81f3\u95dc\u91cd\u8981\u3002<\/p>\n<p>\u5982\u9700\u4e86\u89e3\u66f4\u591a\u6709\u95dc<em><a href=\"https:\/\/server.hk\">\u9999\u6e2fVPS<\/a><\/em>\u548c<em><a href=\"https:\/\/server.hk\">\u96f2\u4f3a\u670d\u5668<\/a><\/em>\u7684\u8cc7\u8a0a\uff0c\u8acb\u8a2a\u554f\u6211\u5011\u7684\u7db2\u7ad9\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u89e3\u6c7a ORA-26874 \u932f\u8aa4\uff1a\u5b57\u7b26\u4e32\u6355\u7372\u904e\u7a0b\u7121\u6cd5\u62c6\u5206\u7684\u6545\u969c\u4fee\u5fa9\u6307\u5357\uff0c\u63d0\u4f9b\u9060\u7a0b\u8655\u7406\u6b65\u9a5f\u548c\u89e3\u6c7a\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-89852","post","type-post","status-publish","format-standard","hentry","category-database"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/89852","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=89852"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/89852\/revisions"}],"predecessor-version":[{"id":89853,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/89852\/revisions\/89853"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=89852"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=89852"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=89852"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}