{"id":91562,"date":"2024-10-18T22:15:19","date_gmt":"2024-10-18T14:15:19","guid":{"rendered":"https:\/\/server.hk\/cnblog\/91562\/"},"modified":"2024-10-18T22:15:19","modified_gmt":"2024-10-18T14:15:19","slug":"ora-31094-%e5%b1%ac%e6%80%a7%e6%88%96%e5%85%83%e7%b4%a0-string-%e7%9a%84-sql-%e9%a1%9e%e5%9e%8b-string-%e4%b8%8d%e5%85%bc%e5%ae%b9-oracle-%e5%a0%b1%e9%8c%af","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/91562\/","title":{"rendered":"ORA-31094: \u5c6c\u6027\u6216\u5143\u7d20 \u201cstring\u201d \u7684 SQL \u985e\u578b \u201cstring\u201d \u4e0d\u517c\u5bb9 ORACLE \u5831\u932f \u6545\u969c\u4fee\u5fa9 \u9060\u7a0b\u8655\u7406"},"content":{"rendered":"<h1 id=\"ora-31094-%e5%b1%ac%e6%80%a7%e6%88%96%e5%85%83%e7%b4%a0-string-%e7%9a%84-sql-%e9%a1%9e%e5%9e%8b-string-%e4%b8%8d%e5%85%bc%e5%ae%b9-oracle-%e5%a0%b1%e9%8c%af-VHMfNZQisP\">ORA-31094: \u5c6c\u6027\u6216\u5143\u7d20 \u201cstring\u201d \u7684 SQL \u985e\u578b \u201cstring\u201d \u4e0d\u517c\u5bb9 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-31094<\/code>\u3002\u9019\u500b\u932f\u8aa4\u901a\u5e38\u8207 XML \u6578\u64da\u7684\u8655\u7406\u6709\u95dc\uff0c\u7279\u5225\u662f\u5728\u9032\u884c\u6578\u64da\u63d2\u5165\u6216\u66f4\u65b0\u64cd\u4f5c\u6642\u3002\u672c\u6587\u5c07\u6df1\u5165\u63a2\u8a0e <code>ORA-31094<\/code> \u932f\u8aa4\u7684\u539f\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%e5%8e%9f%e5%9b%a0%e5%88%86%e6%9e%90-VHMfNZQisP\">\u932f\u8aa4\u539f\u56e0\u5206\u6790<\/h2>\n<p><code>ORA-31094<\/code> \u932f\u8aa4\u7684\u4e3b\u8981\u539f\u56e0\u662f SQL \u985e\u578b\u8207 XML \u5c6c\u6027\u6216\u5143\u7d20\u4e4b\u9593\u7684\u4e0d\u517c\u5bb9\u3002\u9019\u901a\u5e38\u767c\u751f\u5728\u4ee5\u4e0b\u60c5\u6cc1\uff1a<\/p>\n<ul>\n<li>XML \u7d50\u69cb\u8207\u6578\u64da\u5eab\u8868\u7d50\u69cb\u4e0d\u5339\u914d\u3002<\/li>\n<li>\u5728\u63d2\u5165\u6216\u66f4\u65b0 XML \u6578\u64da\u6642\uff0c\u6578\u64da\u985e\u578b\u4e0d\u6b63\u78ba\u3002<\/li>\n<li>\u4f7f\u7528\u4e86\u4e0d\u652f\u6301\u7684 XML \u6578\u64da\u985e\u578b\u3002<\/li>\n<\/ul>\n<p>\u4f8b\u5982\uff0c\u5047\u8a2d\u6709\u4e00\u500b XML \u7d50\u69cb\u5982\u4e0b\uff1a<\/p>\n<pre><code>&lt;person&gt;\n    &lt;name&gt;John&lt;\/name&gt;\n    &lt;age&gt;30&lt;\/age&gt;\n&lt;\/person&gt;<\/code><\/pre>\n<p>\u5982\u679c\u5728\u6578\u64da\u5eab\u4e2d\u5c0d\u61c9\u7684\u8868\u7d50\u69cb\u5b9a\u7fa9\u70ba\uff1a<\/p>\n<pre><code>CREATE TABLE persons (\n    name VARCHAR2(50),\n    age NUMBER\n);<\/code><\/pre>\n<p>\u7576\u5617\u8a66\u5c07\u4e00\u500b\u5305\u542b\u4e0d\u6b63\u78ba\u6578\u64da\u985e\u578b\u7684 XML \u63d2\u5165\u5230\u9019\u500b\u8868\u4e2d\u6642\uff0c\u5c31\u53ef\u80fd\u6703\u5f15\u767c <code>ORA-31094<\/code> \u932f\u8aa4\u3002<\/p>\n<h2 id=\"%e6%95%85%e9%9a%9c%e4%bf%ae%e5%be%a9%e6%ad%a5%e9%a9%9f-VHMfNZQisP\">\u6545\u969c\u4fee\u5fa9\u6b65\u9a5f<\/h2>\n<p>\u8981\u4fee\u5fa9 <code>ORA-31094<\/code> \u932f\u8aa4\uff0c\u53ef\u4ee5\u6309\u7167\u4ee5\u4e0b\u6b65\u9a5f\u9032\u884c\uff1a<\/p>\n<h3 id=\"1-%e6%aa%a2%e6%9f%a5-xml-%e7%b5%90%e6%a7%8b-VHMfNZQisP\">1. \u6aa2\u67e5 XML \u7d50\u69cb<\/h3>\n<p>\u9996\u5148\uff0c\u6aa2\u67e5 XML \u7684\u7d50\u69cb\u662f\u5426\u8207\u6578\u64da\u5eab\u8868\u7684\u7d50\u69cb\u76f8\u7b26\u3002\u78ba\u4fdd\u6240\u6709\u7684\u5143\u7d20\u548c\u5c6c\u6027\u90fd\u6b63\u78ba\u5c0d\u61c9\u5230\u6578\u64da\u5eab\u4e2d\u7684\u5b57\u6bb5\u3002<\/p>\n<h3 id=\"2-%e9%a9%97%e8%ad%89%e6%95%b8%e6%93%9a%e9%a1%9e%e5%9e%8b-VHMfNZQisP\">2. \u9a57\u8b49\u6578\u64da\u985e\u578b<\/h3>\n<p>\u78ba\u4fdd XML \u4e2d\u7684\u6578\u64da\u985e\u578b\u8207\u6578\u64da\u5eab\u8868\u4e2d\u5b9a\u7fa9\u7684\u6578\u64da\u985e\u578b\u76f8\u7b26\u3002\u4f8b\u5982\uff0c\u82e5\u6578\u64da\u5eab\u4e2d\u5b9a\u7fa9\u7684\u5b57\u6bb5\u70ba <code>NUMBER<\/code>\uff0c\u5247 XML \u4e2d\u7684\u5c0d\u61c9\u5143\u7d20\u5fc5\u9808\u662f\u6578\u5b57\u683c\u5f0f\u3002<\/p>\n<h3 id=\"3-%e4%bd%bf%e7%94%a8%e6%ad%a3%e7%a2%ba%e7%9a%84-xml-%e5%87%bd%e6%95%b8-VHMfNZQisP\">3. \u4f7f\u7528\u6b63\u78ba\u7684 XML \u51fd\u6578<\/h3>\n<p>\u5728\u9032\u884c XML \u6578\u64da\u64cd\u4f5c\u6642\uff0c\u4f7f\u7528 Oracle \u63d0\u4f9b\u7684 XML \u51fd\u6578\uff0c\u5982 <code>XMLTYPE<\/code>\uff0c\u4ee5\u78ba\u4fdd\u6578\u64da\u7684\u6b63\u78ba\u6027\u3002\u4f8b\u5982\uff1a<\/p>\n<pre><code>INSERT INTO persons (name, age)\nVALUES (XMLTYPE('&lt;name&gt;John&lt;\/name&gt;'), 30);<\/code><\/pre>\n<h3 id=\"4-%e6%aa%a2%e6%9f%a5%e6%95%b8%e6%93%9a%e5%ba%ab%e7%89%88%e6%9c%ac-VHMfNZQisP\">4. \u6aa2\u67e5\u6578\u64da\u5eab\u7248\u672c<\/h3>\n<p>\u67d0\u4e9b\u7248\u672c\u7684 Oracle \u6578\u64da\u5eab\u53ef\u80fd\u5c0d XML \u7684\u652f\u6301\u5b58\u5728\u5dee\u7570\uff0c\u6aa2\u67e5\u7576\u524d\u4f7f\u7528\u7684\u7248\u672c\u662f\u5426\u652f\u6301\u6240\u9700\u7684 XML \u529f\u80fd\u3002<\/p>\n<h2 id=\"%e9%81%a0%e7%a8%8b%e8%99%95%e7%90%86%e5%bb%ba%e8%ad%b0-VHMfNZQisP\">\u9060\u7a0b\u8655\u7406\u5efa\u8b70<\/h2>\n<p>\u5728\u9032\u884c\u6545\u969c\u6392\u9664\u6642\uff0c\u82e5\u7121\u6cd5\u76f4\u63a5\u8a2a\u554f\u6578\u64da\u5eab\uff0c\u5efa\u8b70\u4f7f\u7528\u9060\u7a0b\u8655\u7406\u5de5\u5177\u3002\u9019\u4e9b\u5de5\u5177\u53ef\u4ee5\u5e6b\u52a9\u60a8\u5728\u4e0d\u5f71\u97ff\u7cfb\u7d71\u904b\u884c\u7684\u60c5\u6cc1\u4e0b\uff0c\u9032\u884c\u5fc5\u8981\u7684\u6aa2\u67e5\u548c\u4fee\u5fa9\u3002\u78ba\u4fdd\u4f7f\u7528\u5b89\u5168\u7684\u9023\u63a5\u65b9\u5f0f\uff0c\u5982 VPN\uff0c\u4f86\u4fdd\u8b77\u6578\u64da\u7684\u5b89\u5168\u6027\u3002<\/p>\n<h2 id=\"%e7%b8%bd%e7%b5%90-VHMfNZQisP\">\u7e3d\u7d50<\/h2>\n<p>\u5728 Oracle \u6578\u64da\u5eab\u4e2d\uff0c<code>ORA-31094<\/code> \u932f\u8aa4\u901a\u5e38\u662f\u7531\u65bc XML \u6578\u64da\u985e\u578b\u4e0d\u517c\u5bb9\u5f15\u8d77\u7684\u3002\u901a\u904e\u6aa2\u67e5 XML \u7d50\u69cb\u3001\u9a57\u8b49\u6578\u64da\u985e\u578b\u3001\u4f7f\u7528\u6b63\u78ba\u7684 XML \u51fd\u6578\u4ee5\u53ca\u78ba\u4fdd\u6578\u64da\u5eab\u7248\u672c\u7684\u517c\u5bb9\u6027\uff0c\u53ef\u4ee5\u6709\u6548\u5730\u89e3\u6c7a\u6b64\u554f\u984c\u3002\u82e5\u60a8\u9700\u8981\u9032\u4e00\u6b65\u7684\u652f\u6301\u6216\u89e3\u6c7a\u65b9\u6848\uff0c\u8003\u616e\u4f7f\u7528 <a href=\"https:\/\/server.hk\">\u9999\u6e2fVPS<\/a> \u670d\u52d9\uff0c\u4ee5\u4fbf\u65bc\u66f4\u9748\u6d3b\u7684\u6578\u64da\u5eab\u7ba1\u7406\u548c\u6545\u969c\u6392\u9664\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u89e3\u6c7a ORA-31094 \u932f\u8aa4\uff0c\u5c6c\u6027\u6216\u5143\u7d20 SQL \u985e\u578b\u4e0d\u517c\u5bb9\u7684\u554f\u984c\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-91562","post","type-post","status-publish","format-standard","hentry","category-database"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/91562","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=91562"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/91562\/revisions"}],"predecessor-version":[{"id":91563,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/91562\/revisions\/91563"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=91562"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=91562"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=91562"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}