{"id":84863,"date":"2024-10-17T11:24:19","date_gmt":"2024-10-17T03:24:19","guid":{"rendered":"https:\/\/server.hk\/cnblog\/84863\/"},"modified":"2024-10-17T11:24:20","modified_gmt":"2024-10-17T03:24:20","slug":"ora-12402-%e7%84%a1%e6%95%88%e7%9a%84%e6%a0%bc%e5%bc%8f%e5%ad%97%e7%ac%a6%e4%b8%b2%ef%bc%9a%e5%ad%97%e7%ac%a6%e4%b8%b2%e3%80%82oracle-%e5%a0%b1%e9%8c%af-%e6%95%85%e9%9a%9c%e4%bf%ae%e5%be%a9-%e9%81%a0","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/84863\/","title":{"rendered":"ORA-12402: \u7121\u6548\u7684\u683c\u5f0f\u5b57\u7b26\u4e32\uff1a\u5b57\u7b26\u4e32\u3002ORACLE \u5831\u932f \u6545\u969c\u4fee\u5fa9 \u9060\u7a0b\u8655\u7406"},"content":{"rendered":"<h1 id=\"ora-12402-%e7%84%a1%e6%95%88%e7%9a%84%e6%a0%bc%e5%bc%8f%e5%ad%97%e7%ac%a6%e4%b8%b2%ef%bc%9a%e5%ad%97%e7%ac%a6%e4%b8%b2%e3%80%82oracle-%e5%a0%b1%e9%8c%af-%e6%95%85%e9%9a%9c%e4%bf%ae%e5%be%a9-%e9%81%a0-xmmhpxBtso\">ORA-12402: \u7121\u6548\u7684\u683c\u5f0f\u5b57\u7b26\u4e32\uff1a\u5b57\u7b26\u4e32\u3002ORACLE \u5831\u932f \u6545\u969c\u4fee\u5fa9 \u9060\u7a0b\u8655\u7406<\/h1>\n<p>\u5728\u4f7f\u7528 Oracle \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\u662f <code>ORA-12402<\/code>\u3002\u9019\u500b\u932f\u8aa4\u901a\u5e38\u8868\u793a\u5728\u683c\u5f0f\u5b57\u7b26\u4e32\u4e2d\u5b58\u5728\u7121\u6548\u7684\u5b57\u7b26\u6216\u7d50\u69cb\uff0c\u5c0e\u81f4 Oracle \u7121\u6cd5\u6b63\u78ba\u89e3\u6790\u8a72\u5b57\u7b26\u4e32\u3002\u672c\u6587\u5c07\u6df1\u5165\u63a2\u8a0e <code>ORA-12402<\/code> \u7684\u6210\u56e0\u3001\u5f71\u97ff\u53ca\u5176\u89e3\u6c7a\u65b9\u6848\u3002<\/p>\n<h2 id=\"ora-12402-%e9%8c%af%e8%aa%a4%e7%9a%84%e6%88%90%e5%9b%a0-xmmhpxBtso\">ORA-12402 \u932f\u8aa4\u7684\u6210\u56e0<\/h2>\n<p><code>ORA-12402<\/code> \u932f\u8aa4\u901a\u5e38\u51fa\u73fe\u5728\u4ee5\u4e0b\u5e7e\u7a2e\u60c5\u6cc1\u4e0b\uff1a<\/p>\n<ul>\n<li><strong>\u683c\u5f0f\u5b57\u7b26\u4e32\u932f\u8aa4\uff1a<\/strong>\u7576\u4f7f\u7528\u4e0d\u6b63\u78ba\u7684\u683c\u5f0f\u5b57\u7b26\u4e32\u6642\uff0c\u4f8b\u5982\u5728\u4f7f\u7528 <code>TO_CHAR<\/code> \u51fd\u6578\u6642\uff0c\u683c\u5f0f\u5b57\u7b26\u4e32\u7684\u7d50\u69cb\u4e0d\u7b26\u5408 Oracle \u7684\u8981\u6c42\u3002<\/li>\n<li><strong>\u6578\u64da\u985e\u578b\u4e0d\u5339\u914d\uff1a<\/strong>\u5982\u679c\u683c\u5f0f\u5b57\u7b26\u4e32\u8207\u6578\u64da\u985e\u578b\u4e0d\u5339\u914d\uff0c\u4f8b\u5982\u5c07\u65e5\u671f\u683c\u5f0f\u61c9\u7528\u65bc\u6578\u5b57\uff0c\u5247\u6703\u5c0e\u81f4\u6b64\u932f\u8aa4\u3002<\/li>\n<li><strong>\u4f7f\u7528\u4e86\u4e0d\u652f\u6301\u7684\u683c\u5f0f\uff1a<\/strong>\u67d0\u4e9b\u683c\u5f0f\u5b57\u7b26\u4e32\u53ef\u80fd\u5728\u7279\u5b9a\u7248\u672c\u7684 Oracle \u4e2d\u4e0d\u88ab\u652f\u6301\uff0c\u9019\u4e5f\u6703\u5f15\u767c\u932f\u8aa4\u3002<\/li>\n<\/ul>\n<h2 id=\"%e5%a6%82%e4%bd%95%e8%ad%98%e5%88%a5-ora-12402-%e9%8c%af%e8%aa%a4-xmmhpxBtso\">\u5982\u4f55\u8b58\u5225 ORA-12402 \u932f\u8aa4<\/h2>\n<p>\u7576 <code>ORA-12402<\/code> \u932f\u8aa4\u767c\u751f\u6642\uff0cOracle \u6703\u8fd4\u56de\u4e00\u689d\u932f\u8aa4\u6d88\u606f\uff0c\u901a\u5e38\u5305\u542b\u4ee5\u4e0b\u4fe1\u606f\uff1a<\/p>\n<pre>\nORA-12402: \u7121\u6548\u7684\u683c\u5f0f\u5b57\u7b26\u4e32\uff1a\u5b57\u7b26\u4e32\n<\/pre>\n<p>\u9019\u689d\u6d88\u606f\u6703\u6307\u660e\u51fa\u932f\u7684\u5177\u9ad4\u4f4d\u7f6e\uff0c\u5e6b\u52a9\u958b\u767c\u8005\u5feb\u901f\u5b9a\u4f4d\u554f\u984c\u3002\u70ba\u4e86\u66f4\u597d\u5730\u7406\u89e3\u932f\u8aa4\uff0c\u958b\u767c\u8005\u53ef\u4ee5\u67e5\u770b\u76f8\u95dc\u7684 SQL \u67e5\u8a62\u6216 PL\/SQL \u7a0b\u5e8f\uff0c\u4e26\u6aa2\u67e5\u683c\u5f0f\u5b57\u7b26\u4e32\u7684\u4f7f\u7528\u60c5\u6cc1\u3002<\/p>\n<h2 id=\"%e8%a7%a3%e6%b1%ba-ora-12402-%e9%8c%af%e8%aa%a4%e7%9a%84%e6%96%b9%e6%b3%95-xmmhpxBtso\">\u89e3\u6c7a ORA-12402 \u932f\u8aa4\u7684\u65b9\u6cd5<\/h2>\n<p>\u89e3\u6c7a <code>ORA-12402<\/code> \u932f\u8aa4\u7684\u904e\u7a0b\u901a\u5e38\u5305\u62ec\u4ee5\u4e0b\u5e7e\u500b\u6b65\u9a5f\uff1a<\/p>\n<h3 id=\"1-%e6%aa%a2%e6%9f%a5%e6%a0%bc%e5%bc%8f%e5%ad%97%e7%ac%a6%e4%b8%b2-xmmhpxBtso\">1. \u6aa2\u67e5\u683c\u5f0f\u5b57\u7b26\u4e32<\/h3>\n<p>\u9996\u5148\uff0c\u6aa2\u67e5\u5f15\u767c\u932f\u8aa4\u7684\u683c\u5f0f\u5b57\u7b26\u4e32\u3002\u78ba\u4fdd\u5b83\u7b26\u5408 Oracle \u7684\u683c\u5f0f\u8981\u6c42\u3002\u4f8b\u5982\uff0c\u5c0d\u65bc\u65e5\u671f\u683c\u5f0f\uff0c\u61c9\u4f7f\u7528\u6b63\u78ba\u7684\u683c\u5f0f\u7b26\u865f\uff0c\u5982 <code>YYYY<\/code>\u3001<code>MM<\/code>\u3001<code>DD<\/code> \u7b49\u3002<\/p>\n<pre>\n-- \u6b63\u78ba\u7684\u65e5\u671f\u683c\u5f0f\u793a\u4f8b\nSELECT TO_CHAR(SYSDATE, 'YYYY-MM-DD') FROM dual;\n<\/pre>\n<h3 id=\"2-%e7%a2%ba%e8%aa%8d%e6%95%b8%e6%93%9a%e9%a1%9e%e5%9e%8b-xmmhpxBtso\">2. \u78ba\u8a8d\u6578\u64da\u985e\u578b<\/h3>\n<p>\u78ba\u4fdd\u683c\u5f0f\u5b57\u7b26\u4e32\u8207\u6578\u64da\u985e\u578b\u76f8\u5339\u914d\u3002\u5982\u679c\u4f60\u6b63\u5728\u8655\u7406\u65e5\u671f\uff0c\u8acb\u78ba\u4fdd\u4f7f\u7528\u7684\u6578\u64da\u985e\u578b\u70ba\u65e5\u671f\u578b\u3002\u5982\u679c\u662f\u6578\u5b57\uff0c\u5247\u61c9\u4f7f\u7528\u76f8\u61c9\u7684\u6578\u5b57\u683c\u5f0f\u3002<\/p>\n<pre>\n-- \u6578\u5b57\u683c\u5f0f\u793a\u4f8b\nSELECT TO_CHAR(12345.67, '99999.99') FROM dual;\n<\/pre>\n<h3 id=\"3-%e6%9b%b4%e6%96%b0-oracle-%e7%89%88%e6%9c%ac-xmmhpxBtso\">3. \u66f4\u65b0 Oracle \u7248\u672c<\/h3>\n<p>\u5982\u679c\u4f60\u4f7f\u7528\u7684\u683c\u5f0f\u5b57\u7b26\u4e32\u5728\u7576\u524d\u7248\u672c\u7684 Oracle \u4e2d\u4e0d\u88ab\u652f\u6301\uff0c\u8003\u616e\u66f4\u65b0\u5230\u6700\u65b0\u7248\u672c\u3002Oracle \u7684\u65b0\u7248\u672c\u901a\u5e38\u6703\u589e\u52a0\u5c0d\u65b0\u683c\u5f0f\u7684\u652f\u6301\u3002<\/p>\n<h2 id=\"%e9%81%a0%e7%a8%8b%e8%99%95%e7%90%86-ora-12402-%e9%8c%af%e8%aa%a4-xmmhpxBtso\">\u9060\u7a0b\u8655\u7406 ORA-12402 \u932f\u8aa4<\/h2>\n<p>\u5728\u67d0\u4e9b\u60c5\u6cc1\u4e0b\uff0c\u958b\u767c\u8005\u53ef\u80fd\u7121\u6cd5\u76f4\u63a5\u8a2a\u554f\u6578\u64da\u5eab\u9032\u884c\u6545\u969c\u6392\u9664\u3002\u6b64\u6642\uff0c\u53ef\u4ee5\u8003\u616e\u4f7f\u7528\u9060\u7a0b\u8655\u7406\u5de5\u5177\u4f86\u5354\u52a9\u89e3\u6c7a\u554f\u984c\u3002\u9019\u4e9b\u5de5\u5177\u53ef\u4ee5\u5e6b\u52a9\u958b\u767c\u8005\u5728\u4e0d\u76f4\u63a5\u8a2a\u554f\u6578\u64da\u5eab\u7684\u60c5\u6cc1\u4e0b\uff0c\u9032\u884c\u65e5\u8a8c\u5206\u6790\u548c\u932f\u8aa4\u6392\u67e5\u3002<\/p>\n<h2 id=\"%e7%b8%bd%e7%b5%90-xmmhpxBtso\">\u7e3d\u7d50<\/h2>\n<p>\u7e3d\u4e4b\uff0c<code>ORA-12402<\/code> \u932f\u8aa4\u901a\u5e38\u662f\u7531\u65bc\u683c\u5f0f\u5b57\u7b26\u4e32\u4e0d\u6b63\u78ba\u6216\u6578\u64da\u985e\u578b\u4e0d\u5339\u914d\u5f15\u8d77\u7684\u3002\u901a\u904e\u4ed4\u7d30\u6aa2\u67e5\u683c\u5f0f\u5b57\u7b26\u4e32\u3001\u78ba\u8a8d\u6578\u64da\u985e\u578b\u4ee5\u53ca\u5fc5\u8981\u6642\u66f4\u65b0 Oracle \u7248\u672c\uff0c\u53ef\u4ee5\u6709\u6548\u5730\u89e3\u6c7a\u6b64\u554f\u984c\u3002\u5c0d\u65bc\u9700\u8981\u9032\u884c\u9060\u7a0b\u6545\u969c\u6392\u9664\u7684\u60c5\u6cc1\uff0c\u4f7f\u7528\u5408\u9069\u7684\u5de5\u5177\u5c07\u6709\u52a9\u65bc\u5feb\u901f\u5b9a\u4f4d\u548c\u4fee\u5fa9\u932f\u8aa4\u3002<\/p>\n<p>\u5982\u9700\u4e86\u89e3\u66f4\u591a\u6709\u95dc <a href=\"https:\/\/server.hk\">\u9999\u6e2fVPS<\/a> \u53ca\u5176\u76f8\u95dc\u670d\u52d9\u7684\u4fe1\u606f\uff0c\u8acb\u8a2a\u554f\u6211\u5011\u7684\u7db2\u7ad9\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u89e3\u6c7a ORA-12402 \u932f\u8aa4\uff1a\u7121\u6548\u7684\u683c\u5f0f\u5b57\u7b26\u4e32\u3002\u4e86\u89e3 Oracle \u5831\u932f\u7684\u6545\u969c\u4fee\u5fa9\u65b9\u6cd5\u53ca\u9060\u7a0b\u8655\u7406\u6280\u5de7\uff0c\u63d0\u5347\u7cfb\u7d71\u7a69\u5b9a\u6027\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-84863","post","type-post","status-publish","format-standard","hentry","category-database"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/84863","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=84863"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/84863\/revisions"}],"predecessor-version":[{"id":84864,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/84863\/revisions\/84864"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=84863"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=84863"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=84863"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}