{"id":99,"date":"2013-02-22T17:21:27","date_gmt":"2013-02-22T09:21:27","guid":{"rendered":"http:\/\/weitaoc.com\/?p=99"},"modified":"2013-02-22T17:29:03","modified_gmt":"2013-02-22T09:29:03","slug":"oracle%e5%be%aa%e7%8e%af%e6%8f%92%e5%85%a5%e6%b5%8b%e8%af%95%e6%95%b0%e6%8d%ae","status":"publish","type":"post","link":"http:\/\/weitaoc.com\/?p=99","title":{"rendered":"oracle\u5faa\u73af\u63d2\u5165\u6d4b\u8bd5\u6570\u636e"},"content":{"rendered":"<p>\u4eca\u5929\u516c\u53f8\u4e00\u6d4b\u8bd5\u7ed9\u4e86\u4e00\u6bb5oracle\u4ee3\u7801\uff0c\u770b\u7684\u5934\u5927\uff1a<\/p>\n<div class=\"codecolorer-container sql geshi\" style=\"overflow:auto;white-space:nowrap;width:100%;\"><table cellspacing=\"0\" cellpadding=\"0\"><tbody><tr><td class=\"line-numbers\"><div>1<br \/>2<br \/>3<br \/>4<br \/>5<br \/>6<br \/>7<br \/>8<br \/>9<br \/>10<br \/>11<br \/>12<br \/>13<br \/>14<br \/>15<br \/>16<br \/>17<br \/>18<br \/>19<br \/><\/div><\/td><td><div class=\"sql codecolorer\" style=\"white-space:nowrap\"><span style=\"color: #993333; font-weight: bold;\">DECLARE<\/span> @TERM_NO <span style=\"color: #993333; font-weight: bold;\">INT<\/span><br \/>\n<br \/>\n<span style=\"color: #993333; font-weight: bold;\">SET<\/span> @TERM_NO <span style=\"color: #66cc66;\">=<\/span> <span style=\"color: #cc66cc;\">1<\/span> <span style=\"color: #808080; font-style: italic;\">\/*\u8bbe\u7f6e\u53d8\u91cf*\/<\/span><br \/>\n<br \/>\nWHILE <span style=\"color: #66cc66;\">&#40;<\/span>@TERM_NO <span style=\"color: #66cc66;\">&lt;<\/span> <span style=\"color: #cc66cc;\">1000<\/span><span style=\"color: #66cc66;\">&#41;<\/span> <span style=\"color: #808080; font-style: italic;\">\/*\u8bbe\u7f6e\u5faa\u73af\u6b21\u6570*\/<\/span><br \/>\n<br \/>\n<span style=\"color: #993333; font-weight: bold;\">BEGIN<\/span><br \/>\n<br \/>\nWAITFOR DELAY <span style=\"color: #ff0000;\">'000:00:10'<\/span> <span style=\"color: #808080; font-style: italic;\">\/*\u5ef6\u8fdf\u65f6\u95f410\u79d2*\/<\/span><br \/>\n<br \/>\n<span style=\"color: #993333; font-weight: bold;\">INSERT<\/span> <span style=\"color: #993333; font-weight: bold;\">INTO<\/span> cd_terminal<br \/>\n<br \/>\n<span style=\"color: #66cc66;\">&#40;<\/span>TERM_NO<span style=\"color: #66cc66;\">,<\/span> EQUIP_TYPE<span style=\"color: #66cc66;\">,<\/span> EQUIP_USE<span style=\"color: #66cc66;\">,<\/span> EQUIP_NO<span style=\"color: #66cc66;\">,<\/span> EQUIP_NAME<span style=\"color: #66cc66;\">,<\/span> ACCEPT_TP<span style=\"color: #66cc66;\">,<\/span> BRANCH_NO<span style=\"color: #66cc66;\">,<\/span> TERM_STATUS<span style=\"color: #66cc66;\">,<\/span> TERM_SIGN_STATUS<span style=\"color: #66cc66;\">,<\/span> LAST_LOGIN_DATE<span style=\"color: #66cc66;\">,<\/span> BATCH_NO<span style=\"color: #66cc66;\">,<\/span> EQUIP_INVESTOR<span style=\"color: #66cc66;\">,<\/span> SETUP_DATE<span style=\"color: #66cc66;\">,<\/span> SETUP_PERSON<span style=\"color: #66cc66;\">,<\/span> MANAGE_PERSON<span style=\"color: #66cc66;\">,<\/span> TERM_DESCRIBE<span style=\"color: #66cc66;\">,<\/span> BIND_SAM_NUM<span style=\"color: #66cc66;\">,<\/span> LAST_KEY_UPDATE<span style=\"color: #66cc66;\">,<\/span> LAST_AUTH_DATE<span style=\"color: #66cc66;\">,<\/span> USE_WAY<span style=\"color: #66cc66;\">,<\/span> CUR_TERM_SEQ<span style=\"color: #66cc66;\">,<\/span> MAX_TERM_SEQ<span style=\"color: #66cc66;\">,<\/span> TRANSFER_FREQ<span style=\"color: #66cc66;\">,<\/span> TRANSFER_SUM<span style=\"color: #66cc66;\">,<\/span> CONSUM_SUM<span style=\"color: #66cc66;\">,<\/span> CONSUM_FREQ<span style=\"color: #66cc66;\">,<\/span> CHARGE_SUM<span style=\"color: #66cc66;\">,<\/span> CHARGE_FREQ<span style=\"color: #66cc66;\">,<\/span> REMARK<span style=\"color: #66cc66;\">,<\/span> TEST_FLAG<span style=\"color: #66cc66;\">,<\/span> CRT_SYS_OPR<span style=\"color: #66cc66;\">,<\/span> CRT_SYS_DT<span style=\"color: #66cc66;\">,<\/span> LST_MOD_SYS_OPR<span style=\"color: #66cc66;\">,<\/span> LST_MOD_SYS_DT<span style=\"color: #66cc66;\">&#41;<\/span><br \/>\n<br \/>\n<span style=\"color: #993333; font-weight: bold;\">VALUES<\/span> <span style=\"color: #66cc66;\">&#40;<\/span>@TERM_NO<span style=\"color: #66cc66;\">,<\/span> <span style=\"color: #ff0000;\">'3'<\/span><span style=\"color: #66cc66;\">,<\/span> <span style=\"color: #ff0000;\">'3'<\/span><span style=\"color: #66cc66;\">,<\/span> <span style=\"color: #ff0000;\">'1'<\/span><span style=\"color: #66cc66;\">,<\/span> <span style=\"color: #ff0000;\">'1'<\/span><span style=\"color: #66cc66;\">,<\/span> <span style=\"color: #ff0000;\">'01'<\/span><span style=\"color: #66cc66;\">,<\/span> <span style=\"color: #ff0000;\">'650202'<\/span><span style=\"color: #66cc66;\">,<\/span> <span style=\"color: #ff0000;\">'1'<\/span><span style=\"color: #66cc66;\">,<\/span> <span style=\"color: #ff0000;\">''<\/span><span style=\"color: #66cc66;\">,<\/span> <span style=\"color: #993333; font-weight: bold;\">NULL<\/span><span style=\"color: #66cc66;\">,<\/span> <span style=\"color: #ff0000;\">''<\/span><span style=\"color: #66cc66;\">,<\/span> <span style=\"color: #ff0000;\">''<\/span><span style=\"color: #66cc66;\">,<\/span> <span style=\"color: #993333; font-weight: bold;\">NULL<\/span><span style=\"color: #66cc66;\">,<\/span> <span style=\"color: #ff0000;\">''<\/span><span style=\"color: #66cc66;\">,<\/span> <span style=\"color: #ff0000;\">''<\/span><span style=\"color: #66cc66;\">,<\/span> <span style=\"color: #ff0000;\">''<\/span><span style=\"color: #66cc66;\">,<\/span> <span style=\"color: #cc66cc;\">1<\/span><span style=\"color: #66cc66;\">,<\/span> <span style=\"color: #993333; font-weight: bold;\">NULL<\/span><span style=\"color: #66cc66;\">,<\/span> <span style=\"color: #993333; font-weight: bold;\">NULL<\/span><span style=\"color: #66cc66;\">,<\/span> <span style=\"color: #ff0000;\">''<\/span><span style=\"color: #66cc66;\">,<\/span> <span style=\"color: #ff0000;\">''<\/span><span style=\"color: #66cc66;\">,<\/span> <span style=\"color: #ff0000;\">''<\/span><span style=\"color: #66cc66;\">,<\/span> <span style=\"color: #993333; font-weight: bold;\">NULL<\/span><span style=\"color: #66cc66;\">,<\/span> <span style=\"color: #993333; font-weight: bold;\">NULL<\/span><span style=\"color: #66cc66;\">,<\/span> <span style=\"color: #993333; font-weight: bold;\">NULL<\/span><span style=\"color: #66cc66;\">,<\/span> <span style=\"color: #993333; font-weight: bold;\">NULL<\/span><span style=\"color: #66cc66;\">,<\/span> <span style=\"color: #993333; font-weight: bold;\">NULL<\/span><span style=\"color: #66cc66;\">,<\/span> <span style=\"color: #993333; font-weight: bold;\">NULL<\/span><span style=\"color: #66cc66;\">,<\/span> <span style=\"color: #ff0000;\">''<\/span><span style=\"color: #66cc66;\">,<\/span> <span style=\"color: #ff0000;\">''<\/span><span style=\"color: #66cc66;\">,<\/span> <span style=\"color: #ff0000;\">'admin '<\/span><span style=\"color: #66cc66;\">,<\/span> to_date<span style=\"color: #66cc66;\">&#40;<\/span><span style=\"color: #ff0000;\">'22-02-2013 14:11:15'<\/span><span style=\"color: #66cc66;\">,<\/span> <span style=\"color: #ff0000;\">'dd-mm-yyyy hh24:mi:ss'<\/span><span style=\"color: #66cc66;\">&#41;<\/span><span style=\"color: #66cc66;\">,<\/span> <span style=\"color: #ff0000;\">'admin '<\/span><span style=\"color: #66cc66;\">,<\/span> to_date<span style=\"color: #66cc66;\">&#40;<\/span><span style=\"color: #ff0000;\">'22-02-2013 14:11:15'<\/span><span style=\"color: #66cc66;\">,<\/span> <span style=\"color: #ff0000;\">'dd-mm-yyyy hh24:mi:ss'<\/span><span style=\"color: #66cc66;\">&#41;<\/span><span style=\"color: #66cc66;\">&#41;<\/span><br \/>\n<br \/>\n<span style=\"color: #993333; font-weight: bold;\">SET<\/span> @TERM_NO <span style=\"color: #66cc66;\">=<\/span> @TERM_NO <span style=\"color: #66cc66;\">+<\/span> <span style=\"color: #cc66cc;\">1<\/span><br \/>\n<br \/>\n<span style=\"color: #993333; font-weight: bold;\">END<\/span><\/div><\/td><\/tr><\/tbody><\/table><\/div>\n<p>\u597d\u597d\u6c9f\u901a\u4e00\u4e0b\uff0c\u5176\u5b9e\u4eba\u5bb6\u6d4b\u8bd5\u4e5f\u662f\u6709\u9700\u6c42\u7684\uff0c\u4f5c\u4e3a\u6280\u672f\u4eba\u5458&lt;\u54c8\u54c8\uff0c\u4eca\u5929\u4e0d\u662f\u7f8e\u5de5\u5566&gt;\u600e\u4e48\u4e5f\u5f97\u534f\u8c03\u89e3\u51b3\u4e00\u4e0b\u3002<br \/>\n\u9700\u6c42\u662f\u8fd9\u6837\u7684\uff0c\u4eba\u5bb6\u9700\u8981\u505a\u4e00\u5343\u6761\u7684\u6d4b\u8bd5\u6570\u636e\uff0c\u4f46\u662f\u624b\u5de5\u592a\u6162\u4e86&lt;\u7a0b\u5e8f\u733f\u7684\u4ef7\u503c\u4e0d\u5c31\u662f\u8fd9\u4e2a\u4e48&gt;\u5c31\u60f3\u81ea\u52a8\u5316\u5904\u7406\u3002<br \/>\n\u597d\u5427\uff0c\u6211\u4eec\u5206\u6790\u4e00\u4e0b\u8fd9\u6bb5\u4ee3\u7801\uff0c\u9996\u5148@\u662f\u600e\u4e48\u56de\u4e8b\uff1f\u663e\u7136\u4eba\u5bb6\u7684\u60f3\u6cd5\u662f\u5b9a\u4e49\u4e00\u4e2a\u53d8\u91cf\uff0c\u597d\u5427\uff0c\u770b\u770b&amp;\u7684\u7528\u6cd5\u5427\u3002<\/p>\n<hr \/>\n<p>&amp;\u7b26\u53f7\uff1a\u5728Oracle\u4e2d,&amp;\u7b26\u53f7\u5e38\u7528\u6765\u6307\u51fa\u4e00\u4e2a\u53d8\u91cf\u3002\u4f8b\u5982\uff0c&amp;fox\u662f\u4e00\u4e2a\u53d8\u91cf\uff0c\u7a0d\u5fae\u6709\u70b9\u4e0d\u540c\u7684\u4e00\u79cd&amp;&amp; fox\u3002\u6bcf\u5f53&amp;fox\u51fa\u73b0\u5728Oracle\u811a\u672c\u4e2d\u65f6\uff0c\u90fd\u4f1a\u8981\u6c42\u60a8\u4e3a\u5b83\u63d0\u4f9b\u4e00\u4e2a\u503c\u3002\u800c\u4f7f\u7528&amp;&amp;fox\uff0c\u60a8\u53ea\u9700\u8981\u5728&amp; &amp;fox\u7b2c\u4e00\u6b21\u51fa\u73b0\u65f6\u4e3a\u5b83\u63d0\u4f9b\u53d8\u91cf\u503c\u3002\u5982\u679c\u60f3\u5c06&amp;\u7b26\u53f7\u4f5c\u4e3a\u666e\u901a\u7684\u7b26\u53f7\u4f7f\u7528\uff0c\u5219\u5e94\u8be5\u5173\u95ed\u8fd9\u4e2a\u7279\u6027\u3002\u8981\u60f3\u5173\u95ed\u8fd9\u4e2a\u7279\u6027\uff0c\u53ef\u4ee5\u8fd0\u884c\u4ee5\u4e0b\u7684\u547d\u4ee4\uff1a set define off \uff0c\u8fd9\u662f\u4e00\u4e2aSQLplus\u547d\u4ee4\uff0c\u4e0d\u662f\u4e00\u4e2aSQL\u547d\u4ee4\u3002SQLplus\u8bbe\u7f6e\u4e86SQL\u5728Oracle\u4e2d\u8fd0\u884c\u7684\u73af\u5883\u3002<\/p>\n<hr \/>\n<p>\u518d\u8bf4WHILE (@TERM_NO &lt; 1000) \/*\u8bbe\u7f6e\u5faa\u73af\u6b21\u6570*\/\uff0c\u8fd9\u4e2a\uff0c\u6211\u8fd8\u771f\u6ca1\u89c1\u8fc7while\u53ef\u4ee5\u8fd9\u6837\u7528\u3002\u597d\u5427\uff0c\u8bed\u6cd5\u4e5f\u9519\u4e86\u3002<\/p>\n<p>\u518d\u8bf4\u8fd9\u4e2a\u7f16\u7801\u683c\u5f0f\u7684\u95ee\u9898\uff0c\u4eb2\uff0c\u4f60\u8981\u6211\u600e\u4e48\u7ed9\u4f60\u89e3\u91ca\u201c;\u201d\u7684\u7528\u6cd5\u5462\uff0c\u597d\u5427\uff0c\u4e0d\u89e3\u91ca\u4e86\u3002<\/p>\n<p>\u5c31\u76f4\u63a5\u4e0a\u81ea\u5df1\u7684\u6d4b\u8bd5\u4ee3\u7801\u5427\u3002<\/p>\n<div class=\"codecolorer-container sql geshi\" style=\"overflow:auto;white-space:nowrap;width:100%;\"><table cellspacing=\"0\" cellpadding=\"0\"><tbody><tr><td class=\"line-numbers\"><div>1<br \/>2<br \/>3<br \/>4<br \/>5<br \/>6<br \/>7<br \/>8<br \/>9<br \/>10<br \/>11<br \/>12<br \/>13<br \/>14<br \/>15<br \/>16<br \/>17<br \/>18<br \/>19<br \/>20<br \/>21<br \/><\/div><\/td><td><div class=\"sql codecolorer\" style=\"white-space:nowrap\"><span style=\"color: #993333; font-weight: bold;\">DECLARE<\/span> TERM_NO <span style=\"color: #993333; font-weight: bold;\">INT<\/span> ;<br \/>\n<br \/>\n<span style=\"color: #993333; font-weight: bold;\">BEGIN<\/span><br \/>\n<br \/>\nTERM_NO:<span style=\"color: #66cc66;\">=<\/span> <span style=\"color: #cc66cc;\">1<\/span> ; <span style=\"color: #808080; font-style: italic;\">\/*\u8bbe\u7f6e\u53d8\u91cf*\/<\/span><br \/>\n<br \/>\nWHILE TERM_NO\u00a0<span style=\"color: #66cc66;\">&lt;<\/span> <span style=\"color: #cc66cc;\">1001<\/span> loop <span style=\"color: #808080; font-style: italic;\">\/*\u8bbe\u7f6e\u5faa\u73af\u6b21\u6570*\/<\/span><br \/>\n<br \/>\nDBMS_LOCK<span style=\"color: #66cc66;\">.<\/span>SLEEP<span style=\"color: #66cc66;\">&#40;<\/span><span style=\"color: #cc66cc;\">10<\/span><span style=\"color: #66cc66;\">&#41;<\/span>; <span style=\"color: #808080; font-style: italic;\">\/*\u5ef6\u8fdf\u65f6\u95f410\u79d2*\/<\/span><br \/>\n<br \/>\n<span style=\"color: #993333; font-weight: bold;\">INSERT<\/span> <span style=\"color: #993333; font-weight: bold;\">INTO<\/span> ACCT_DICTCODE<br \/>\n<br \/>\n<span style=\"color: #66cc66;\">&#40;<\/span>ID<span style=\"color: #66cc66;\">,<\/span> NAME<span style=\"color: #66cc66;\">,<\/span> DICTDESC<span style=\"color: #66cc66;\">,<\/span> DICTVALUE<span style=\"color: #66cc66;\">&#41;<\/span><br \/>\n<br \/>\n<span style=\"color: #993333; font-weight: bold;\">VALUES<\/span> <span style=\"color: #66cc66;\">&#40;<\/span>TERM_NO<span style=\"color: #66cc66;\">,<\/span> <span style=\"color: #ff0000;\">'3'<\/span><span style=\"color: #66cc66;\">,<\/span> <span style=\"color: #ff0000;\">'3'<\/span><span style=\"color: #66cc66;\">,<\/span> <span style=\"color: #ff0000;\">'1'<\/span><span style=\"color: #66cc66;\">&#41;<\/span>;<br \/>\n<br \/>\nTERM_NO :<span style=\"color: #66cc66;\">=<\/span> TERM_NO <span style=\"color: #66cc66;\">+<\/span> <span style=\"color: #cc66cc;\">1<\/span> ;<br \/>\n<br \/>\n<span style=\"color: #993333; font-weight: bold;\">END<\/span> loop;<br \/>\n<br \/>\n<span style=\"color: #993333; font-weight: bold;\">END<\/span>;<\/div><\/td><\/tr><\/tbody><\/table><\/div>\n<p>\u6ca1\u4ec0\u4e48\u6280\u672f\u6027\uff0c\u81ea\u5df1mark\u4e00\u4e0b\u5427\u3002<\/p>\n<div id=\"attachment_100\" style=\"width: 510px\" class=\"wp-caption alignnone\"><a href=\"http:\/\/weitaoc.com\/?attachment_id=100\" rel=\"attachment wp-att-100\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-100\" class=\"size-full wp-image-100\" alt=\"oracle\" src=\"http:\/\/weitaoc.com\/wp-content\/uploads\/2013\/02\/201106252551309008183036.jpg\" width=\"500\" height=\"332\" srcset=\"http:\/\/weitaoc.com\/wp-content\/uploads\/2013\/02\/201106252551309008183036.jpg 500w, http:\/\/weitaoc.com\/wp-content\/uploads\/2013\/02\/201106252551309008183036-300x199.jpg 300w\" sizes=\"auto, (max-width: 500px) 100vw, 500px\" \/><\/a><p id=\"caption-attachment-100\" class=\"wp-caption-text\">oracle<\/p><\/div>\n<p>&nbsp;<\/p>\n<p>\u8f6c\u8f7d\u8bf7\u6ce8\u660e\uff1a<a href=\"http:\/\/weitaoc.com\">\u8ff7\u8def\u7684\u8001\u9f20<\/a> &raquo; <a href=\"http:\/\/weitaoc.com\/?p=99\">oracle\u5faa\u73af\u63d2\u5165\u6d4b\u8bd5\u6570\u636e<\/a><\/p>","protected":false},"excerpt":{"rendered":"<p>\u4eca\u5929\u516c\u53f8\u4e00\u6d4b\u8bd5\u7ed9\u4e86\u4e00\u6bb5oracle\u4ee3\u7801\uff0c\u770b\u7684\u5934\u5927\uff1a 12345678910111213141516171819DECLARE @TERM_NO INT SET @TERM_NO = 1 \/*\u8bbe\u7f6e\u53d8\u91cf*\/ WHILE &#40;@TERM_NO &#038;lt [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[27],"tags":[29,28],"class_list":["post-99","post","type-post","status-publish","format-standard","hentry","category-database","tag-oracle","tag-sql"],"views":3156,"_links":{"self":[{"href":"http:\/\/weitaoc.com\/index.php?rest_route=\/wp\/v2\/posts\/99","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/weitaoc.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/weitaoc.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/weitaoc.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/weitaoc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=99"}],"version-history":[{"count":0,"href":"http:\/\/weitaoc.com\/index.php?rest_route=\/wp\/v2\/posts\/99\/revisions"}],"wp:attachment":[{"href":"http:\/\/weitaoc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=99"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/weitaoc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=99"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/weitaoc.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=99"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}