{"id":85107,"date":"2024-10-17T13:27:17","date_gmt":"2024-10-17T05:27:17","guid":{"rendered":"https:\/\/server.hk\/cnblog\/85107\/"},"modified":"2024-10-17T13:27:17","modified_gmt":"2024-10-17T05:27:17","slug":"ora-13032-%e7%84%a1%e6%95%88%e7%9a%84-null-sdo_geometry-%e5%b0%8d%e8%b1%a1%e3%80%82oracle-%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\/85107\/","title":{"rendered":"ORA-13032: \u7121\u6548\u7684 NULL SDO_GEOMETRY \u5c0d\u8c61\u3002ORACLE \u5831\u932f \u6545\u969c\u4fee\u5fa9 \u9060\u7a0b\u8655\u7406"},"content":{"rendered":"<h1 id=\"ora-13032-%e7%84%a1%e6%95%88%e7%9a%84-null-sdo_geometry-%e5%b0%8d%e8%b1%a1-CFZVMuoOGV\">ORA-13032: \u7121\u6548\u7684 NULL SDO_GEOMETRY \u5c0d\u8c61<\/h1>\n<p>\u5728\u4f7f\u7528 Oracle \u6578\u64da\u5eab\u9032\u884c\u5730\u7406\u7a7a\u9593\u6578\u64da\u8655\u7406\u6642\uff0c\u958b\u767c\u8005\u53ef\u80fd\u6703\u9047\u5230\u932f\u8aa4\u4ee3\u78bc <code>ORA-13032<\/code>\uff0c\u8a72\u932f\u8aa4\u63d0\u793a\u300c\u7121\u6548\u7684 NULL SDO_GEOMETRY \u5c0d\u8c61\u300d\u3002\u9019\u500b\u932f\u8aa4\u901a\u5e38\u51fa\u73fe\u5728\u5617\u8a66\u4f7f\u7528\u7a7a\u7684\u6216\u672a\u521d\u59cb\u5316\u7684 <code>SDO_GEOMETRY<\/code> \u5c0d\u8c61\u6642\u3002\u672c\u6587\u5c07\u63a2\u8a0e\u8a72\u932f\u8aa4\u7684\u539f\u56e0\u3001\u5f71\u97ff\u4ee5\u53ca\u5982\u4f55\u9032\u884c\u6545\u969c\u4fee\u5fa9\u3002<\/p>\n<h2 id=\"sdo_geometry-%e5%b0%8d%e8%b1%a1%e6%a6%82%e8%bf%b0-CFZVMuoOGV\">SDO_GEOMETRY \u5c0d\u8c61\u6982\u8ff0<\/h2>\n<p><code>SDO_GEOMETRY<\/code> \u662f Oracle Spatial \u548c Graph \u4e2d\u7528\u65bc\u8868\u793a\u5730\u7406\u7a7a\u9593\u6578\u64da\u7684\u6578\u64da\u985e\u578b\u3002\u5b83\u80fd\u5920\u5b58\u5132\u5404\u7a2e\u5e7e\u4f55\u5f62\u72c0\uff0c\u5982\u9ede\u3001\u7dda\u548c\u591a\u908a\u5f62\u3002\u9019\u4e9b\u5c0d\u8c61\u5728\u9032\u884c\u5730\u7406\u7a7a\u9593\u67e5\u8a62\u548c\u5206\u6790\u6642\u81f3\u95dc\u91cd\u8981\u3002<\/p>\n<h2 id=\"%e9%8c%af%e8%aa%a4%e5%8e%9f%e5%9b%a0-CFZVMuoOGV\">\u932f\u8aa4\u539f\u56e0<\/h2>\n<p>\u7576\u958b\u767c\u8005\u5617\u8a66\u5c0d\u4e00\u500b\u672a\u521d\u59cb\u5316\u6216\u70ba NULL \u7684 <code>SDO_GEOMETRY<\/code> \u5c0d\u8c61\u9032\u884c\u64cd\u4f5c\u6642\uff0cOracle \u6578\u64da\u5eab\u6703\u8fd4\u56de <code>ORA-13032<\/code> \u932f\u8aa4\u3002\u9019\u901a\u5e38\u767c\u751f\u5728\u4ee5\u4e0b\u60c5\u6cc1\uff1a<\/p>\n<ul>\n<li><strong>\u672a\u521d\u59cb\u5316\u7684\u5c0d\u8c61\uff1a<\/strong>\u5728\u5275\u5efa <code>SDO_GEOMETRY<\/code> \u5c0d\u8c61\u6642\uff0c\u5982\u679c\u672a\u6b63\u78ba\u8a2d\u7f6e\u5176\u5c6c\u6027\uff0c\u5247\u53ef\u80fd\u5c0e\u81f4\u8a72\u5c0d\u8c61\u70ba NULL\u3002<\/li>\n<li><strong>\u6578\u64da\u5eab\u67e5\u8a62\u932f\u8aa4\uff1a<\/strong>\u5728\u57f7\u884c\u67e5\u8a62\u6642\uff0c\u5982\u679c\u67e5\u8a62\u7d50\u679c\u4e2d\u5305\u542b NULL \u503c\uff0c\u5247\u5728\u5f8c\u7e8c\u64cd\u4f5c\u4e2d\u53ef\u80fd\u6703\u5f15\u767c\u6b64\u932f\u8aa4\u3002<\/li>\n<li><strong>\u6578\u64da\u985e\u578b\u4e0d\u5339\u914d\uff1a<\/strong>\u5982\u679c\u5c07\u975e <code>SDO_GEOMETRY<\/code> \u985e\u578b\u7684\u6578\u64da\u50b3\u905e\u7d66\u9700\u8981\u8a72\u985e\u578b\u7684\u51fd\u6578\uff0c\u4e5f\u6703\u5c0e\u81f4\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-CFZVMuoOGV\">\u6545\u969c\u4fee\u5fa9\u6b65\u9a5f<\/h2>\n<p>\u70ba\u4e86\u89e3\u6c7a <code>ORA-13032<\/code> \u932f\u8aa4\uff0c\u958b\u767c\u8005\u53ef\u4ee5\u9075\u5faa\u4ee5\u4e0b\u6b65\u9a5f\uff1a<\/p>\n<h3 id=\"1-%e6%aa%a2%e6%9f%a5%e5%b0%8d%e8%b1%a1%e5%88%9d%e5%a7%8b%e5%8c%96-CFZVMuoOGV\">1. \u6aa2\u67e5\u5c0d\u8c61\u521d\u59cb\u5316<\/h3>\n<pre><code>DECLARE\n    geom SDO_GEOMETRY;\nBEGIN\n    geom := SDO_GEOMETRY(2001, 4326, SDO_POINT_TYPE(1, 1, NULL), NULL, NULL);\n    -- \u78ba\u4fdd geom \u88ab\u6b63\u78ba\u521d\u59cb\u5316\nEND;<\/code><\/pre>\n<p>\u5728\u9019\u6bb5\u4ee3\u78bc\u4e2d\uff0c\u6211\u5011\u5275\u5efa\u4e86\u4e00\u500b\u6709\u6548\u7684 <code>SDO_GEOMETRY<\/code> \u5c0d\u8c61\uff0c\u4e26\u78ba\u4fdd\u5176\u4e0d\u70ba NULL\u3002<\/p>\n<h3 id=\"2-%e6%aa%a2%e6%9f%a5%e6%9f%a5%e8%a9%a2%e7%b5%90%e6%9e%9c-CFZVMuoOGV\">2. \u6aa2\u67e5\u67e5\u8a62\u7d50\u679c<\/h3>\n<p>\u5728\u57f7\u884c\u67e5\u8a62\u6642\uff0c\u61c9\u6aa2\u67e5\u8fd4\u56de\u7684\u6578\u64da\u662f\u5426\u5305\u542b NULL \u503c\u3002\u53ef\u4ee5\u4f7f\u7528 <code>NVL<\/code> \u51fd\u6578\u4f86\u8655\u7406\u53ef\u80fd\u7684 NULL \u503c\uff1a<\/p>\n<pre><code>SELECT NVL(geom, SDO_GEOMETRY(2001, 4326, SDO_POINT_TYPE(0, 0, NULL), NULL, NULL)) AS geom\nFROM your_table;<\/code><\/pre>\n<h3 id=\"3-%e6%95%b8%e6%93%9a%e9%a1%9e%e5%9e%8b%e6%aa%a2%e6%9f%a5-CFZVMuoOGV\">3. \u6578\u64da\u985e\u578b\u6aa2\u67e5<\/h3>\n<p>\u78ba\u4fdd\u50b3\u905e\u7d66\u51fd\u6578\u7684\u6578\u64da\u985e\u578b\u6b63\u78ba\u3002\u5982\u679c\u9700\u8981 <code>SDO_GEOMETRY<\/code> \u5c0d\u8c61\uff0c\u8acb\u78ba\u4fdd\u50b3\u905e\u7684\u53c3\u6578\u662f\u6b63\u78ba\u7684\u985e\u578b\u3002<\/p>\n<h2 id=\"%e7%b5%90%e8%ab%96-CFZVMuoOGV\">\u7d50\u8ad6<\/h2>\n<p>\u5728\u8655\u7406 Oracle \u6578\u64da\u5eab\u4e2d\u7684\u5730\u7406\u7a7a\u9593\u6578\u64da\u6642\uff0c<code>ORA-13032<\/code> \u932f\u8aa4\u53ef\u80fd\u6703\u5f71\u97ff\u958b\u767c\u8005\u7684\u5de5\u4f5c\u6d41\u7a0b\u3002\u901a\u904e\u6aa2\u67e5\u5c0d\u8c61\u7684\u521d\u59cb\u5316\u3001\u67e5\u8a62\u7d50\u679c\u4ee5\u53ca\u6578\u64da\u985e\u578b\uff0c\u53ef\u4ee5\u6709\u6548\u5730\u89e3\u6c7a\u6b64\u554f\u984c\u3002\u4e86\u89e3\u9019\u4e9b\u57fa\u672c\u6982\u5ff5\u5c07\u6709\u52a9\u65bc\u958b\u767c\u8005\u5728\u672a\u4f86\u907f\u514d\u985e\u4f3c\u7684\u932f\u8aa4\u3002<\/p>\n<p>\u5982\u9700\u9032\u4e00\u6b65\u4e86\u89e3\u5982\u4f55\u512a\u5316\u60a8\u7684\u6578\u64da\u5eab\u6027\u80fd\uff0c\u60a8\u53ef\u4ee5\u8003\u616e\u4f7f\u7528\u6211\u5011\u7684 <a href=\"https:\/\/server.hk\">\u9999\u6e2fVPS<\/a> \u89e3\u6c7a\u65b9\u6848\uff0c\u9019\u5c07\u70ba\u60a8\u7684\u61c9\u7528\u63d0\u4f9b\u7a69\u5b9a\u7684\u652f\u6301\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u89e3\u6c7a ORA-13032 \u932f\u8aa4\uff1a\u7121\u6548\u7684 NULL SDO_GEOMETRY \u5c0d\u8c61\uff0c\u63d0\u4f9b\u6545\u969c\u4fee\u5fa9\u548c\u9060\u7a0b\u8655\u7406\u6307\u5357\uff0c\u52a9\u60a8\u5feb\u901f\u6062\u5fa9\u7cfb\u7d71\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-85107","post","type-post","status-publish","format-standard","hentry","category-database"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/85107","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=85107"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/85107\/revisions"}],"predecessor-version":[{"id":85108,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/85107\/revisions\/85108"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=85107"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=85107"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=85107"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}