{"id":92500,"date":"2024-10-19T06:07:26","date_gmt":"2024-10-18T22:07:26","guid":{"rendered":"https:\/\/server.hk\/cnblog\/92500\/"},"modified":"2024-10-19T06:07:26","modified_gmt":"2024-10-18T22:07:26","slug":"ora-40116-%e5%9c%a8%e6%ac%8a%e9%87%8d%e8%a1%a8%e4%b8%ad%e6%89%be%e5%88%b0-null-%e5%80%bc-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\/92500\/","title":{"rendered":"ORA-40116: \u5728\u6b0a\u91cd\u8868\u4e2d\u627e\u5230 NULL \u503c ORACLE \u5831\u932f \u6545\u969c\u4fee\u5fa9 \u9060\u7a0b\u8655\u7406"},"content":{"rendered":"<h1 id=\"ora-40116-%e5%9c%a8%e6%ac%8a%e9%87%8d%e8%a1%a8%e4%b8%ad%e6%89%be%e5%88%b0-null-%e5%80%bc-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-HhGREfnNhs\">ORA-40116: \u5728\u6b0a\u91cd\u8868\u4e2d\u627e\u5230 NULL \u503c 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 ORA-40116\u3002\u9019\u500b\u932f\u8aa4\u901a\u5e38\u8868\u793a\u5728\u6b0a\u91cd\u8868\u4e2d\u627e\u5230\u4e86 NULL \u503c\uff0c\u9019\u53ef\u80fd\u6703\u5c0e\u81f4\u6578\u64da\u8655\u7406\u904e\u7a0b\u4e2d\u7684\u7570\u5e38\u3002\u672c\u6587\u5c07\u6df1\u5165\u63a2\u8a0e ORA-40116 \u932f\u8aa4\u7684\u539f\u56e0\u3001\u5f71\u97ff\u4ee5\u53ca\u5982\u4f55\u9032\u884c\u6545\u969c\u4fee\u5fa9\u3002<\/p>\n<h2 id=\"ora-40116-%e9%8c%af%e8%aa%a4%e7%9a%84%e5%8e%9f%e5%9b%a0-HhGREfnNhs\">ORA-40116 \u932f\u8aa4\u7684\u539f\u56e0<\/h2>\n<p>ORA-40116 \u932f\u8aa4\u901a\u5e38\u51fa\u73fe\u5728\u4f7f\u7528 Oracle \u7684\u6578\u64da\u6316\u6398\u529f\u80fd\u6642\uff0c\u5c24\u5176\u662f\u5728\u9032\u884c\u6a21\u578b\u8a13\u7df4\u6216\u9810\u6e2c\u6642\u3002\u9019\u500b\u932f\u8aa4\u7684\u4e3b\u8981\u539f\u56e0\u5305\u62ec\uff1a<\/p>\n<ul>\n<li>\u6b0a\u91cd\u8868\u4e2d\u5b58\u5728 NULL \u503c\uff1a\u9019\u662f\u6700\u5e38\u898b\u7684\u539f\u56e0\uff0c\u7576\u6b0a\u91cd\u8868\u4e2d\u7684\u67d0\u4e9b\u884c\u6216\u5217\u5305\u542b NULL \u503c\u6642\uff0cOracle \u5c07\u7121\u6cd5\u6b63\u78ba\u8655\u7406\u9019\u4e9b\u6578\u64da\u3002<\/li>\n<li>\u6578\u64da\u4e0d\u4e00\u81f4\u6027\uff1a\u5982\u679c\u6578\u64da\u6e90\u4e2d\u7684\u6578\u64da\u4e0d\u4e00\u81f4\uff0c\u53ef\u80fd\u6703\u5c0e\u81f4\u6b0a\u91cd\u8868\u751f\u6210\u4e0d\u6b63\u78ba\u7684\u7d50\u679c\u3002<\/li>\n<li>\u932f\u8aa4\u7684\u6578\u64da\u985e\u578b\uff1a\u5728\u67d0\u4e9b\u60c5\u6cc1\u4e0b\uff0c\u6578\u64da\u985e\u578b\u4e0d\u5339\u914d\u4e5f\u53ef\u80fd\u5c0e\u81f4\u6b64\u932f\u8aa4\u3002<\/li>\n<\/ul>\n<h2 id=\"%e5%bd%b1%e9%9f%bf-HhGREfnNhs\">\u5f71\u97ff<\/h2>\n<p>\u7576 ORA-40116 \u932f\u8aa4\u767c\u751f\u6642\uff0c\u5c07\u6703\u5f71\u97ff\u5230\u6578\u64da\u6316\u6398\u6a21\u578b\u7684\u8a13\u7df4\u548c\u9810\u6e2c\u904e\u7a0b\u3002\u9019\u53ef\u80fd\u5c0e\u81f4\uff1a<\/p>\n<ul>\n<li>\u6a21\u578b\u7121\u6cd5\u751f\u6210\uff1a\u5982\u679c\u6b0a\u91cd\u8868\u7121\u6cd5\u6b63\u78ba\u751f\u6210\uff0c\u5247\u6574\u500b\u6a21\u578b\u7684\u8a13\u7df4\u904e\u7a0b\u5c07\u7121\u6cd5\u5b8c\u6210\u3002<\/li>\n<li>\u9810\u6e2c\u7d50\u679c\u4e0d\u6e96\u78ba\uff1a\u5373\u4f7f\u6a21\u578b\u5df2\u7d93\u8a13\u7df4\u5b8c\u6210\uff0c\u82e5\u6b0a\u91cd\u8868\u4e2d\u5b58\u5728 NULL \u503c\uff0c\u9810\u6e2c\u7d50\u679c\u4e5f\u53ef\u80fd\u6703\u53d7\u5230\u5f71\u97ff\u3002<\/li>\n<li>\u7cfb\u7d71\u6027\u80fd\u4e0b\u964d\uff1a\u6301\u7e8c\u7684\u932f\u8aa4\u53ef\u80fd\u6703\u5c0e\u81f4\u7cfb\u7d71\u6027\u80fd\u4e0b\u964d\uff0c\u5f71\u97ff\u5176\u4ed6\u64cd\u4f5c\u7684\u57f7\u884c\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-HhGREfnNhs\">\u6545\u969c\u4fee\u5fa9\u6b65\u9a5f<\/h2>\n<p>\u70ba\u4e86\u89e3\u6c7a ORA-40116 \u932f\u8aa4\uff0c\u60a8\u53ef\u4ee5\u6309\u7167\u4ee5\u4e0b\u6b65\u9a5f\u9032\u884c\u6545\u969c\u6392\u9664\u548c\u4fee\u5fa9\uff1a<\/p>\n<h3 id=\"1-%e6%aa%a2%e6%9f%a5%e6%ac%8a%e9%87%8d%e8%a1%a8-HhGREfnNhs\">1. \u6aa2\u67e5\u6b0a\u91cd\u8868<\/h3>\n<p>\u9996\u5148\uff0c\u60a8\u9700\u8981\u6aa2\u67e5\u6b0a\u91cd\u8868\u4e2d\u662f\u5426\u5b58\u5728 NULL \u503c\u3002\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b SQL \u67e5\u8a62\u4f86\u6aa2\u67e5\uff1a<\/p>\n<pre><code>SELECT * FROM your_weight_table WHERE your_column IS NULL;<\/code><\/pre>\n<p>\u5982\u679c\u67e5\u8a62\u7d50\u679c\u8fd4\u56de\u4e86\u884c\uff0c\u5247\u8868\u793a\u5b58\u5728 NULL \u503c\u3002<\/p>\n<h3 id=\"2-%e6%9b%b4%e6%96%b0%e6%88%96%e5%88%aa%e9%99%a4-null-%e5%80%bc-HhGREfnNhs\">2. \u66f4\u65b0\u6216\u522a\u9664 NULL \u503c<\/h3>\n<p>\u6839\u64da\u696d\u52d9\u9700\u6c42\uff0c\u60a8\u53ef\u4ee5\u9078\u64c7\u66f4\u65b0\u6216\u522a\u9664\u9019\u4e9b NULL \u503c\u3002\u4f8b\u5982\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b SQL \u8a9e\u53e5\u4f86\u66f4\u65b0 NULL \u503c\uff1a<\/p>\n<pre><code>UPDATE your_weight_table SET your_column = 'default_value' WHERE your_column IS NULL;<\/code><\/pre>\n<h3 id=\"3-%e7%a2%ba%e4%bf%9d%e6%95%b8%e6%93%9a%e4%b8%80%e8%87%b4%e6%80%a7-HhGREfnNhs\">3. \u78ba\u4fdd\u6578\u64da\u4e00\u81f4\u6027<\/h3>\n<p>\u6aa2\u67e5\u6578\u64da\u6e90\uff0c\u78ba\u4fdd\u6240\u6709\u6578\u64da\u90fd\u662f\u4e00\u81f4\u7684\u3002\u9019\u5305\u62ec\u6aa2\u67e5\u6578\u64da\u985e\u578b\u548c\u7bc4\u570d\u3002<\/p>\n<h3 id=\"4-%e6%b8%ac%e8%a9%a6%e6%a8%a1%e5%9e%8b-HhGREfnNhs\">4. \u6e2c\u8a66\u6a21\u578b<\/h3>\n<p>\u5728\u4fee\u5fa9\u4e86\u6b0a\u91cd\u8868\u4e2d\u7684\u554f\u984c\u5f8c\uff0c\u91cd\u65b0\u904b\u884c\u6a21\u578b\u8a13\u7df4\u548c\u9810\u6e2c\u904e\u7a0b\uff0c\u4ee5\u78ba\u4fdd\u554f\u984c\u5df2\u7d93\u89e3\u6c7a\u3002<\/p>\n<h2 id=\"%e7%b5%90%e8%ab%96-HhGREfnNhs\">\u7d50\u8ad6<\/h2>\n<p>ORA-40116 \u932f\u8aa4\u662f Oracle \u6578\u64da\u5eab\u4e2d\u5e38\u898b\u7684\u554f\u984c\u4e4b\u4e00\uff0c\u4e3b\u8981\u7531\u65bc\u6b0a\u91cd\u8868\u4e2d\u7684 NULL \u503c\u5f15\u8d77\u3002\u901a\u904e\u6aa2\u67e5\u548c\u4fee\u5fa9\u6b0a\u91cd\u8868\u4e2d\u7684\u554f\u984c\uff0c\u60a8\u53ef\u4ee5\u6709\u6548\u5730\u89e3\u6c7a\u6b64\u932f\u8aa4\uff0c\u4e26\u78ba\u4fdd\u6578\u64da\u6316\u6398\u6a21\u578b\u7684\u6b63\u5e38\u904b\u884c\u3002\u5c0d\u65bc\u9700\u8981\u9ad8\u6548\u6578\u64da\u8655\u7406\u7684\u4f01\u696d\u4f86\u8aaa\uff0c\u9078\u64c7\u5408\u9069\u7684 <a href=\"https:\/\/server.hk\">VPS<\/a> \u89e3\u6c7a\u65b9\u6848\u4e5f\u662f\u81f3\u95dc\u91cd\u8981\u7684\uff0c\u9019\u6a23\u53ef\u4ee5\u78ba\u4fdd\u7cfb\u7d71\u7684\u7a69\u5b9a\u6027\u548c\u6027\u80fd\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u89e3\u6c7a ORA-40116 \u932f\u8aa4\uff0c\u4fee\u5fa9\u6b0a\u91cd\u8868\u4e2d\u7684 NULL \u503c\u554f\u984c\uff0c\u63d0\u4f9b\u6709\u6548\u7684\u9060\u7a0b\u8655\u7406\u65b9\u6848\uff0c\u78ba\u4fdd Oracle \u6578\u64da\u5eab\u7a69\u5b9a\u904b\u884c\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-92500","post","type-post","status-publish","format-standard","hentry","category-database"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/92500","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=92500"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/92500\/revisions"}],"predecessor-version":[{"id":92501,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/92500\/revisions\/92501"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=92500"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=92500"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=92500"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}