{"id":85301,"date":"2024-03-21T05:29:18","date_gmt":"2024-03-20T20:29:18","guid":{"rendered":"https:\/\/www.silicloud.com\/ja\/blog\/pl-sql%e3%82%ab%e3%83%bc%e3%82%bd%e3%83%ab%e3%81%ae%e4%bd%bf%e7%94%a8%e6%96%b9%e6%b3%95\/"},"modified":"2024-04-04T21:17:38","modified_gmt":"2024-04-04T12:17:38","slug":"pl-sql%e3%82%ab%e3%83%bc%e3%82%bd%e3%83%ab%e3%81%ae%e4%bd%bf%e7%94%a8%e6%96%b9%e6%b3%95","status":"publish","type":"post","link":"https:\/\/www.silicloud.com\/ja\/blog\/pl-sql%e3%82%ab%e3%83%bc%e3%82%bd%e3%83%ab%e3%81%ae%e4%bd%bf%e7%94%a8%e6%96%b9%e6%b3%95\/","title":{"rendered":"PL\/SQL\u30ab\u30fc\u30bd\u30eb\u306e\u4f7f\u7528\u65b9\u6cd5"},"content":{"rendered":"<p>PL\/SQL\u3067\u306f\u3001\u30ab\u30fc\u30bd\u30eb\u3092\u5b9f\u884c\u3059\u308b\u305f\u3081\u306e\u30e1\u30bd\u30c3\u30c9\u3068\u3057\u3066\u4ee5\u4e0b\u3092\u4f7f\u7528\u3067\u304d\u307e\u3059\u3002<\/p>\n<ol>\n<li>OPEN\u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\u3067\u30ab\u30fc\u30bd\u30eb\u3092\u958b\u304d\u3001FETCH\u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\u3067\u30ab\u30fc\u30bd\u30eb\u304b\u3089\u30c7\u30fc\u30bf\u3092\u53d6\u5f97\u3059\u308b\u3002<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code>DECLARE\r\n   cursor_name SYS_REFCURSOR;\r\n   variable_name table_name.column_name%TYPE;\r\n\r\nBEGIN\r\n   OPEN cursor_name FOR SELECT column_name FROM table_name;\r\n   \r\n   LOOP\r\n      FETCH cursor_name INTO variable_name;\r\n      \r\n      EXIT WHEN cursor_name%NOTFOUND;\r\n      \r\n      -- \u8fdb\u884c\u5904\u7406\r\n   END LOOP;\r\n   \r\n   CLOSE cursor_name;\r\n   \r\nEND;\r\n<\/code><\/pre>\n<ol>\n<li>\u30ab\u30fc\u30bd\u30eb\u5185\u306e\u30c7\u30fc\u30bf\u3092FOR\u30eb\u30fc\u30d7\u6587\u3067\u53cd\u5fa9\u51e6\u7406\u3059\u308b\u3002<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code>BEGIN\r\n   FOR variable_name IN (SELECT column_name FROM table_name) LOOP\r\n   \r\n      -- \u8fdb\u884c\u5904\u7406\r\n      \r\n   END LOOP;\r\n   \r\nEND;\r\n<\/code><\/pre>\n<ol>\n<li>\u30ab\u30fc\u30bd\u30eb\u306e\u5c5e\u6027\u3068\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u7528\u3057\u3066\u30ab\u30fc\u30bd\u30eb\u3092\u64cd\u4f5c\u3059\u308b\u3002<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code>DECLARE\r\n   cursor_name SYS_REFCURSOR;\r\n   variable_name table_name.column_name%TYPE;\r\n\r\nBEGIN\r\n   OPEN cursor_name FOR SELECT column_name FROM table_name;\r\n   \r\n   IF cursor_name%ISOPEN THEN\r\n      -- \u6e38\u6807\u5df2\u7ecf\u6253\u5f00\r\n   END IF;\r\n   \r\n   FETCH cursor_name INTO variable_name;\r\n   \r\n   IF cursor_name%FOUND THEN\r\n      -- \u4ece\u6e38\u6807\u4e2d\u83b7\u53d6\u4e86\u6570\u636e\r\n   END IF;\r\n   \r\n   CLOSE cursor_name;\r\n   \r\nEND;\r\n<\/code><\/pre>\n<p>\u4e0a\u8a18\u306e PL\/SQL \u3067\u30ab\u30fc\u30bd\u30eb\u3092\u547c\u3073\u51fa\u3059\u4e00\u822c\u7684\u306a\u65b9\u6cd5\u306f\u3001\u5177\u4f53\u7684\u306a\u30cb\u30fc\u30ba\u3068\u72b6\u6cc1\u306b\u3088\u3063\u3066\u4f7f\u7528\u6cd5\u304c\u7570\u306a\u308a\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>PL\/SQL\u3067\u306f\u3001\u30ab\u30fc\u30bd\u30eb\u3092\u5b9f\u884c\u3059\u308b\u305f\u3081\u306e\u30e1\u30bd\u30c3\u30c9\u3068\u3057\u3066\u4ee5\u4e0b\u3092\u4f7f\u7528\u3067\u304d\u307e\u3059\u3002 OPEN\u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\u3067\u30ab\u30fc\u30bd\u30eb\u3092\u958b\u304d\u3001FETCH\u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\u3067\u30ab\u30fc\u30bd\u30eb\u304b\u3089\u30c7\u30fc\u30bf\u3092\u53d6\u5f97\u3059\u308b\u3002 DECLARE cursor_name SY [&hellip;]<\/p>\n","protected":false},"author":6,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-85301","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v21.5 (Yoast SEO v21.5) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>PL\/SQL\u30ab\u30fc\u30bd\u30eb\u306e\u4f7f\u7528\u65b9\u6cd5 - Blog - Silicon Cloud<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.silicloud.com\/ja\/blog\/pl-sql\u30ab\u30fc\u30bd\u30eb\u306e\u4f7f\u7528\u65b9\u6cd5\/\" \/>\n<meta property=\"og:locale\" content=\"ja_JP\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"PL\/SQL\u30ab\u30fc\u30bd\u30eb\u306e\u4f7f\u7528\u65b9\u6cd5\" \/>\n<meta property=\"og:description\" content=\"PL\/SQL\u3067\u306f\u3001\u30ab\u30fc\u30bd\u30eb\u3092\u5b9f\u884c\u3059\u308b\u305f\u3081\u306e\u30e1\u30bd\u30c3\u30c9\u3068\u3057\u3066\u4ee5\u4e0b\u3092\u4f7f\u7528\u3067\u304d\u307e\u3059\u3002 OPEN\u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\u3067\u30ab\u30fc\u30bd\u30eb\u3092\u958b\u304d\u3001FETCH\u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\u3067\u30ab\u30fc\u30bd\u30eb\u304b\u3089\u30c7\u30fc\u30bf\u3092\u53d6\u5f97\u3059\u308b\u3002 DECLARE cursor_name SY [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.silicloud.com\/ja\/blog\/pl-sql\u30ab\u30fc\u30bd\u30eb\u306e\u4f7f\u7528\u65b9\u6cd5\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog - Silicon Cloud\" \/>\n<meta property=\"article:published_time\" content=\"2024-03-20T20:29:18+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-04-04T12:17:38+00:00\" \/>\n<meta name=\"author\" content=\"\u6d77\u6597, \u8475\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u57f7\u7b46\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u6d77\u6597, \u8475\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u63a8\u5b9a\u8aad\u307f\u53d6\u308a\u6642\u9593\" \/>\n\t<meta name=\"twitter:data2\" content=\"1\u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/pl-sql%e3%82%ab%e3%83%bc%e3%82%bd%e3%83%ab%e3%81%ae%e4%bd%bf%e7%94%a8%e6%96%b9%e6%b3%95\/\",\"url\":\"https:\/\/www.silicloud.com\/ja\/blog\/pl-sql%e3%82%ab%e3%83%bc%e3%82%bd%e3%83%ab%e3%81%ae%e4%bd%bf%e7%94%a8%e6%96%b9%e6%b3%95\/\",\"name\":\"PL\/SQL\u30ab\u30fc\u30bd\u30eb\u306e\u4f7f\u7528\u65b9\u6cd5 - Blog - Silicon Cloud\",\"isPartOf\":{\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#website\"},\"datePublished\":\"2024-03-20T20:29:18+00:00\",\"dateModified\":\"2024-04-04T12:17:38+00:00\",\"author\":{\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/20cfc053626f4d45c0fa7a4e7964b5b6\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/pl-sql%e3%82%ab%e3%83%bc%e3%82%bd%e3%83%ab%e3%81%ae%e4%bd%bf%e7%94%a8%e6%96%b9%e6%b3%95\/#breadcrumb\"},\"inLanguage\":\"ja\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.silicloud.com\/ja\/blog\/pl-sql%e3%82%ab%e3%83%bc%e3%82%bd%e3%83%ab%e3%81%ae%e4%bd%bf%e7%94%a8%e6%96%b9%e6%b3%95\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/pl-sql%e3%82%ab%e3%83%bc%e3%82%bd%e3%83%ab%e3%81%ae%e4%bd%bf%e7%94%a8%e6%96%b9%e6%b3%95\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.silicloud.com\/ja\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"PL\/SQL\u30ab\u30fc\u30bd\u30eb\u306e\u4f7f\u7528\u65b9\u6cd5\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#website\",\"url\":\"https:\/\/www.silicloud.com\/ja\/blog\/\",\"name\":\"Blog - Silicon Cloud\",\"description\":\"\",\"inLanguage\":\"ja\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/20cfc053626f4d45c0fa7a4e7964b5b6\",\"name\":\"\u6d77\u6597, \u8475\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/25aec9a18954b6bfb7e4f7219c2923d62c6f0c9f4d5c0171228fe41751c0ab7a?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/25aec9a18954b6bfb7e4f7219c2923d62c6f0c9f4d5c0171228fe41751c0ab7a?s=96&d=mm&r=g\",\"caption\":\"\u6d77\u6597, \u8475\"},\"url\":\"https:\/\/www.silicloud.com\/ja\/blog\/author\/kaitoaoi\/\"},{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/pl-sql%e3%82%ab%e3%83%bc%e3%82%bd%e3%83%ab%e3%81%ae%e4%bd%bf%e7%94%a8%e6%96%b9%e6%b3%95\/#local-main-organization-logo\",\"url\":\"\",\"contentUrl\":\"\",\"caption\":\"Blog - Silicon Cloud\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"PL\/SQL\u30ab\u30fc\u30bd\u30eb\u306e\u4f7f\u7528\u65b9\u6cd5 - Blog - Silicon Cloud","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.silicloud.com\/ja\/blog\/pl-sql\u30ab\u30fc\u30bd\u30eb\u306e\u4f7f\u7528\u65b9\u6cd5\/","og_locale":"ja_JP","og_type":"article","og_title":"PL\/SQL\u30ab\u30fc\u30bd\u30eb\u306e\u4f7f\u7528\u65b9\u6cd5","og_description":"PL\/SQL\u3067\u306f\u3001\u30ab\u30fc\u30bd\u30eb\u3092\u5b9f\u884c\u3059\u308b\u305f\u3081\u306e\u30e1\u30bd\u30c3\u30c9\u3068\u3057\u3066\u4ee5\u4e0b\u3092\u4f7f\u7528\u3067\u304d\u307e\u3059\u3002 OPEN\u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\u3067\u30ab\u30fc\u30bd\u30eb\u3092\u958b\u304d\u3001FETCH\u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\u3067\u30ab\u30fc\u30bd\u30eb\u304b\u3089\u30c7\u30fc\u30bf\u3092\u53d6\u5f97\u3059\u308b\u3002 DECLARE cursor_name SY [&hellip;]","og_url":"https:\/\/www.silicloud.com\/ja\/blog\/pl-sql\u30ab\u30fc\u30bd\u30eb\u306e\u4f7f\u7528\u65b9\u6cd5\/","og_site_name":"Blog - Silicon Cloud","article_published_time":"2024-03-20T20:29:18+00:00","article_modified_time":"2024-04-04T12:17:38+00:00","author":"\u6d77\u6597, \u8475","twitter_card":"summary_large_image","twitter_misc":{"\u57f7\u7b46\u8005":"\u6d77\u6597, \u8475","\u63a8\u5b9a\u8aad\u307f\u53d6\u308a\u6642\u9593":"1\u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.silicloud.com\/ja\/blog\/pl-sql%e3%82%ab%e3%83%bc%e3%82%bd%e3%83%ab%e3%81%ae%e4%bd%bf%e7%94%a8%e6%96%b9%e6%b3%95\/","url":"https:\/\/www.silicloud.com\/ja\/blog\/pl-sql%e3%82%ab%e3%83%bc%e3%82%bd%e3%83%ab%e3%81%ae%e4%bd%bf%e7%94%a8%e6%96%b9%e6%b3%95\/","name":"PL\/SQL\u30ab\u30fc\u30bd\u30eb\u306e\u4f7f\u7528\u65b9\u6cd5 - Blog - Silicon Cloud","isPartOf":{"@id":"https:\/\/www.silicloud.com\/ja\/blog\/#website"},"datePublished":"2024-03-20T20:29:18+00:00","dateModified":"2024-04-04T12:17:38+00:00","author":{"@id":"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/20cfc053626f4d45c0fa7a4e7964b5b6"},"breadcrumb":{"@id":"https:\/\/www.silicloud.com\/ja\/blog\/pl-sql%e3%82%ab%e3%83%bc%e3%82%bd%e3%83%ab%e3%81%ae%e4%bd%bf%e7%94%a8%e6%96%b9%e6%b3%95\/#breadcrumb"},"inLanguage":"ja","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.silicloud.com\/ja\/blog\/pl-sql%e3%82%ab%e3%83%bc%e3%82%bd%e3%83%ab%e3%81%ae%e4%bd%bf%e7%94%a8%e6%96%b9%e6%b3%95\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.silicloud.com\/ja\/blog\/pl-sql%e3%82%ab%e3%83%bc%e3%82%bd%e3%83%ab%e3%81%ae%e4%bd%bf%e7%94%a8%e6%96%b9%e6%b3%95\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.silicloud.com\/ja\/blog\/"},{"@type":"ListItem","position":2,"name":"PL\/SQL\u30ab\u30fc\u30bd\u30eb\u306e\u4f7f\u7528\u65b9\u6cd5"}]},{"@type":"WebSite","@id":"https:\/\/www.silicloud.com\/ja\/blog\/#website","url":"https:\/\/www.silicloud.com\/ja\/blog\/","name":"Blog - Silicon Cloud","description":"","inLanguage":"ja"},{"@type":"Person","@id":"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/20cfc053626f4d45c0fa7a4e7964b5b6","name":"\u6d77\u6597, \u8475","image":{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/25aec9a18954b6bfb7e4f7219c2923d62c6f0c9f4d5c0171228fe41751c0ab7a?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/25aec9a18954b6bfb7e4f7219c2923d62c6f0c9f4d5c0171228fe41751c0ab7a?s=96&d=mm&r=g","caption":"\u6d77\u6597, \u8475"},"url":"https:\/\/www.silicloud.com\/ja\/blog\/author\/kaitoaoi\/"},{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/www.silicloud.com\/ja\/blog\/pl-sql%e3%82%ab%e3%83%bc%e3%82%bd%e3%83%ab%e3%81%ae%e4%bd%bf%e7%94%a8%e6%96%b9%e6%b3%95\/#local-main-organization-logo","url":"","contentUrl":"","caption":"Blog - Silicon Cloud"}]}},"_links":{"self":[{"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/posts\/85301","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/comments?post=85301"}],"version-history":[{"count":2,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/posts\/85301\/revisions"}],"predecessor-version":[{"id":293361,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/posts\/85301\/revisions\/293361"}],"wp:attachment":[{"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/media?parent=85301"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/categories?post=85301"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/tags?post=85301"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}