{"id":67,"date":"2012-08-06T15:24:57","date_gmt":"2012-08-06T06:24:57","guid":{"rendered":"http:\/\/auctionpro.co.kr\/WPress\/?p=67"},"modified":"2022-04-08T16:04:43","modified_gmt":"2022-04-08T07:04:43","slug":"con_cursor-cursor-for-select","status":"publish","type":"post","link":"https:\/\/www.auctionpro.co.kr\/?p=67","title":{"rendered":"con_cursor cursor for SELECT ~"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">DB \ub370\uc774\ud0c0 \uc77c\uad00 \ucc98\ub9ac \ud504\ub85c\uc138\uc11c<\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:tsql decode:true \" title=\"con_cursor \">Create PROCEDURE Pro_GetMutilCode\n @cityCode VARCHAR(3) \nAS\n\nBEGIN\n\tDECLARE @muticodeArr varchar(100),@apCode varchar(3)\n\tSET @muticodeArr=@cityCode;\n\n\tDeclare con_cursor cursor for SELECT AP_CODE FROM AIRPORTCODE WHERE AP_CITY_CODE=@cityCode\n\t\topen con_cursor --\ucee4\uc2a4\ub97c \uc5f0\ub2e4.\n\t\t\tfetch next from con_cursor into @apCode\n\t\t\twhile (@@fetch_status &lt;&gt;-1)\n\t\t\tbegin\n\t\t\t\tif (@@fetch_status = -2)\n\t\t\t\tcontinue\n\t\t\t\tbegin\n\t\t\t\t-- \ucc98\ub9ac\n\t\t\t\t  set @muticodeArr += '-' + @apCode\n\t\t\t\tend\n\t\t\tfetch next from con_cursor into @apCode\n\t\t\tend\n\t\tclose con_cursor\n\tDeallocate con_cursor\n\n\tSELECT @muticodeArr as MC_GROUP_CITY, @cityCode as MC_CITY\nEND<\/pre><\/div>\n\n\n\n<h4 class=\"wp-block-heading\">STRING_SPLIT<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">\ubb38\uc7a5\uc744  \uad6c\ubd84\uc73c\ub85c \uc798\ub77c  List \ub85c \ubcf4\uc5ec\uc8fc\uae30. <\/p>\n\n\n\n<p class=\"has-luminous-vivid-orange-color has-text-color wp-block-paragraph\">(2016 \ubc84\uc804 \ubd80\ud130 \uc801\uc6a9\uac00\ub2a5)<\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:mysql decode:true \">SELECT RULE_NO\n     , RULE_NAME\n     , RULE_CONTENTS\n  FROM RULE\n CROSS APPLY STRING_SPLIT(RULE_CONTENTS, ' ')<\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"mh-excerpt\"><p>DB \ub370\uc774\ud0c0 \uc77c\uad00 \ucc98\ub9ac \ud504\ub85c\uc138\uc11c STRING_SPLIT \ubb38\uc7a5\uc744 \uad6c\ubd84\uc73c\ub85c \uc798\ub77c List \ub85c \ubcf4\uc5ec\uc8fc\uae30. (2016 \ubc84\uc804 \ubd80\ud130 \uc801\uc6a9\uac00\ub2a5)<\/p>\n<\/div>","protected":false},"author":6,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[16],"tags":[],"class_list":["post-67","post","type-post","status-publish","format-standard","hentry","category-mssql-server"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.auctionpro.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/67","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.auctionpro.co.kr\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.auctionpro.co.kr\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.auctionpro.co.kr\/index.php?rest_route=\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/www.auctionpro.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=67"}],"version-history":[{"count":0,"href":"https:\/\/www.auctionpro.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/67\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.auctionpro.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=67"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.auctionpro.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=67"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.auctionpro.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=67"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}