{"id":87458,"date":"2024-10-18T01:13:18","date_gmt":"2024-10-17T17:13:18","guid":{"rendered":"https:\/\/server.hk\/cnblog\/87458\/"},"modified":"2024-10-18T01:13:18","modified_gmt":"2024-10-17T17:13:18","slug":"ora-19195-oracontains-%e4%b8%ad%e7%9a%84%e7%84%a1%e6%95%88%e7%ad%96%e7%95%a5-oracle-%e5%a0%b1%e9%8c%af-%e6%95%85%e9%9a%9c%e4%bf%ae%e5%be%a9-%e9%81%a0%e7%a8%8b%e8%99%95%e7%90%86","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/87458\/","title":{"rendered":"ORA-19195: ora:contains \u4e2d\u7684\u7121\u6548\u7b56\u7565 ORACLE \u5831\u932f \u6545\u969c\u4fee\u5fa9 \u9060\u7a0b\u8655\u7406"},"content":{"rendered":"<h1 id=\"ora-19195-oracontains-%e4%b8%ad%e7%9a%84%e7%84%a1%e6%95%88%e7%ad%96%e7%95%a5-oracle-%e5%a0%b1%e9%8c%af-%e6%95%85%e9%9a%9c%e4%bf%ae%e5%be%a9-%e9%81%a0%e7%a8%8b%e8%99%95%e7%90%86-cjpfUBDxws\">ORA-19195: ora:contains \u4e2d\u7684\u7121\u6548\u7b56\u7565 ORACLE \u5831\u932f \u6545\u969c\u4fee\u5fa9 \u9060\u7a0b\u8655\u7406<\/h1>\n<p>\u5728\u4f7f\u7528 Oracle \u6578\u64da\u5eab\u6642\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-19195<\/code>\u3002\u9019\u500b\u932f\u8aa4\u901a\u5e38\u8207 XML \u6578\u64da\u8655\u7406\u6709\u95dc\uff0c\u7279\u5225\u662f\u5728\u4f7f\u7528 <code>ora:contains<\/code> \u51fd\u6578\u6642\u3002\u672c\u6587\u5c07\u6df1\u5165\u63a2\u8a0e\u9019\u500b\u932f\u8aa4\u7684\u539f\u56e0\u3001\u5f71\u97ff\u4ee5\u53ca\u5982\u4f55\u9032\u884c\u6545\u969c\u4fee\u5fa9\u3002<\/p>\n<h2 id=\"ora-19195-%e9%8c%af%e8%aa%a4%e6%a6%82%e8%bf%b0-cjpfUBDxws\">ORA-19195 \u932f\u8aa4\u6982\u8ff0<\/h2>\n<p><code>ORA-19195<\/code> \u932f\u8aa4\u7684\u5177\u9ad4\u4fe1\u606f\u70ba\u300c\u7121\u6548\u7b56\u7565\u300d\uff0c\u9019\u610f\u5473\u8457\u5728\u57f7\u884c XML \u67e5\u8a62\u6642\uff0cOracle \u6578\u64da\u5eab\u7121\u6cd5\u8b58\u5225\u6216\u8655\u7406\u6240\u63d0\u4f9b\u7684\u7b56\u7565\u3002\u9019\u901a\u5e38\u767c\u751f\u5728\u4f7f\u7528 XMLType \u6578\u64da\u985e\u578b\u6642\uff0c\u5c24\u5176\u662f\u5728\u9032\u884c XML \u67e5\u8a62\u6216\u64cd\u4f5c\u6642\u3002<\/p>\n<h2 id=\"%e9%8c%af%e8%aa%a4%e5%8e%9f%e5%9b%a0-cjpfUBDxws\">\u932f\u8aa4\u539f\u56e0<\/h2>\n<p>\u9020\u6210 <code>ORA-19195<\/code> \u932f\u8aa4\u7684\u539f\u56e0\u53ef\u80fd\u6709\u591a\u7a2e\uff0c\u4ee5\u4e0b\u662f\u4e00\u4e9b\u5e38\u898b\u7684\u60c5\u6cc1\uff1a<\/p>\n<ul>\n<li><strong>\u7121\u6548\u7684 XPath \u8868\u9054\u5f0f\uff1a<\/strong>\u5982\u679c\u5728 <code>ora:contains<\/code> \u51fd\u6578\u4e2d\u4f7f\u7528\u4e86\u4e0d\u6b63\u78ba\u7684 XPath \u8868\u9054\u5f0f\uff0c\u5247\u6703\u5c0e\u81f4\u6b64\u932f\u8aa4\u3002<\/li>\n<li><strong>\u4e0d\u652f\u6301\u7684 XML \u7d50\u69cb\uff1a<\/strong>\u67d0\u4e9b XML \u7d50\u69cb\u53ef\u80fd\u4e0d\u88ab Oracle \u6578\u64da\u5eab\u652f\u6301\uff0c\u7279\u5225\u662f\u5728\u4f7f\u7528\u7279\u5b9a\u7684 XML \u6a21\u5f0f\u6642\u3002<\/li>\n<li><strong>\u6578\u64da\u985e\u578b\u4e0d\u5339\u914d\uff1a<\/strong>\u5982\u679c\u50b3\u905e\u7d66 <code>ora:contains<\/code> \u7684\u53c3\u6578\u985e\u578b\u4e0d\u6b63\u78ba\uff0c\u4e5f\u6703\u5f15\u767c\u6b64\u932f\u8aa4\u3002<\/li>\n<\/ul>\n<h2 id=\"%e6%95%85%e9%9a%9c%e4%bf%ae%e5%be%a9%e6%ad%a5%e9%a9%9f-cjpfUBDxws\">\u6545\u969c\u4fee\u5fa9\u6b65\u9a5f<\/h2>\n<p>\u7576\u9047\u5230 <code>ORA-19195<\/code> \u932f\u8aa4\u6642\uff0c\u53ef\u4ee5\u6309\u7167\u4ee5\u4e0b\u6b65\u9a5f\u9032\u884c\u6545\u969c\u6392\u9664\uff1a<\/p>\n<h3 id=\"1-%e6%aa%a2%e6%9f%a5-xpath-%e8%a1%a8%e9%81%94%e5%bc%8f-cjpfUBDxws\">1. \u6aa2\u67e5 XPath \u8868\u9054\u5f0f<\/h3>\n<p>\u9996\u5148\uff0c\u6aa2\u67e5\u60a8\u5728 <code>ora:contains<\/code> \u51fd\u6578\u4e2d\u4f7f\u7528\u7684 XPath \u8868\u9054\u5f0f\u3002\u78ba\u4fdd\u5b83\u662f\u6b63\u78ba\u7684\uff0c\u4e26\u4e14\u7b26\u5408 XML \u7d50\u69cb\u7684\u8981\u6c42\u3002\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u793a\u4f8b\u4f86\u9a57\u8b49\uff1a<\/p>\n<pre><code>SELECT *\nFROM your_table\nWHERE XMLExists('your_xpath_expression' PASSING your_xml_column);\n<\/code><\/pre>\n<h3 id=\"2-%e9%a9%97%e8%ad%89-xml-%e7%b5%90%e6%a7%8b-cjpfUBDxws\">2. \u9a57\u8b49 XML \u7d50\u69cb<\/h3>\n<p>\u78ba\u4fdd\u60a8\u6b63\u5728\u8655\u7406\u7684 XML \u6578\u64da\u7b26\u5408 Oracle \u7684\u8981\u6c42\u3002\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u67e5\u8a62\u4f86\u6aa2\u67e5 XML \u7d50\u69cb\uff1a<\/p>\n<pre><code>SELECT your_xml_column\nFROM your_table\nWHERE your_xml_column IS NOT NULL;\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-cjpfUBDxws\">3. \u6aa2\u67e5\u6578\u64da\u985e\u578b<\/h3>\n<p>\u78ba\u4fdd\u50b3\u905e\u7d66 <code>ora:contains<\/code> \u7684\u6240\u6709\u53c3\u6578\u90fd\u5177\u6709\u6b63\u78ba\u7684\u6578\u64da\u985e\u578b\u3002\u9019\u53ef\u4ee5\u901a\u904e\u4ee5\u4e0b\u67e5\u8a62\u4f86\u6aa2\u67e5\uff1a<\/p>\n<pre><code>SELECT data_type\nFROM user_tab_columns\nWHERE table_name = 'YOUR_TABLE_NAME';\n<\/code><\/pre>\n<h2 id=\"%e9%81%a0%e7%a8%8b%e8%99%95%e7%90%86%e5%bb%ba%e8%ad%b0-cjpfUBDxws\">\u9060\u7a0b\u8655\u7406\u5efa\u8b70<\/h2>\n<p>\u5728\u67d0\u4e9b\u60c5\u6cc1\u4e0b\uff0c\u60a8\u53ef\u80fd\u9700\u8981\u9032\u884c\u9060\u7a0b\u8655\u7406\u4ee5\u89e3\u6c7a <code>ORA-19195<\/code> \u932f\u8aa4\u3002\u9019\u53ef\u4ee5\u901a\u904e\u4ee5\u4e0b\u65b9\u5f0f\u5be6\u73fe\uff1a<\/p>\n<ul>\n<li><strong>\u4f7f\u7528\u9060\u7a0b\u684c\u9762\u5de5\u5177\uff1a<\/strong>\u53ef\u4ee5\u4f7f\u7528\u9060\u7a0b\u684c\u9762\u5de5\u5177\u9023\u63a5\u5230\u6578\u64da\u5eab\u4f3a\u670d\u5668\uff0c\u9032\u884c\u66f4\u6df1\u5165\u7684\u6545\u969c\u6392\u9664\u3002<\/li>\n<li><strong>\u67e5\u95b1 Oracle \u6587\u6a94\uff1a<\/strong>Oracle \u63d0\u4f9b\u4e86\u8a73\u7d30\u7684\u6587\u6a94\u548c\u652f\u6301\uff0c\u53ef\u4ee5\u5e6b\u52a9\u60a8\u7406\u89e3\u548c\u89e3\u6c7a\u6b64\u985e\u932f\u8aa4\u3002<\/li>\n<li><strong>\u5c0b\u6c42\u5c08\u696d\u652f\u6301\uff1a<\/strong>\u5982\u679c\u554f\u984c\u6301\u7e8c\u5b58\u5728\uff0c\u8003\u616e\u5c0b\u6c42\u5c08\u696d\u7684\u6578\u64da\u5eab\u7ba1\u7406\u652f\u6301\u3002<\/li>\n<\/ul>\n<h2 id=\"%e7%b8%bd%e7%b5%90-cjpfUBDxws\">\u7e3d\u7d50<\/h2>\n<p>\u5728\u8655\u7406 <code>ORA-19195<\/code> \u932f\u8aa4\u6642\uff0c\u4e86\u89e3\u5176\u539f\u56e0\u548c\u89e3\u6c7a\u65b9\u6cd5\u81f3\u95dc\u91cd\u8981\u3002\u901a\u904e\u6aa2\u67e5 XPath \u8868\u9054\u5f0f\u3001\u9a57\u8b49 XML \u7d50\u69cb\u548c\u6578\u64da\u985e\u578b\uff0c\u60a8\u53ef\u4ee5\u6709\u6548\u5730\u6392\u9664\u6545\u969c\u3002\u6b64\u5916\uff0c\u9060\u7a0b\u8655\u7406\u5de5\u5177\u548c\u5c08\u696d\u652f\u6301\u4e5f\u80fd\u5e6b\u52a9\u60a8\u66f4\u5feb\u5730\u89e3\u6c7a\u554f\u984c\u3002\u5982\u679c\u60a8\u9700\u8981\u7a69\u5b9a\u7684 <a href=\"https:\/\/server.hk\">VPS<\/a> \u89e3\u6c7a\u65b9\u6848\u4f86\u904b\u884c\u60a8\u7684 Oracle \u6578\u64da\u5eab\uff0c\u8acb\u8003\u616e\u6211\u5011\u7684\u670d\u52d9\uff0c\u78ba\u4fdd\u60a8\u7684\u696d\u52d9\u904b\u884c\u9806\u5229\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u89e3\u6c7a ORA-19195 \u932f\u8aa4\uff0c\u4e86\u89e3 ORACLE \u4e2d ora:contains \u7684\u7121\u6548\u7b56\u7565\uff0c\u63d0\u4f9b\u6545\u969c\u4fee\u5fa9\u548c\u9060\u7a0b\u8655\u7406\u6307\u5357\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-87458","post","type-post","status-publish","format-standard","hentry","category-database"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/87458","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=87458"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/87458\/revisions"}],"predecessor-version":[{"id":87459,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/87458\/revisions\/87459"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=87458"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=87458"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=87458"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}