{"id":5857,"date":"2025-09-17T22:59:38","date_gmt":"2025-09-17T13:59:38","guid":{"rendered":"https:\/\/sky-peace.net\/?p=5857"},"modified":"2025-09-17T22:59:38","modified_gmt":"2025-09-17T13:59:38","slug":"declare-cursor","status":"publish","type":"post","link":"https:\/\/sky-peace.net\/certified\/declare-cursor\/","title":{"rendered":"DECLARE CURSOR\u3068\u30c8\u30ea\u30ac\u306e\u95a2\u4fc2\u3082\u308f\u304b\u308b\uff01SQL\u30ab\u30fc\u30bd\u30eb\u306e\u4f7f\u3044\u65b9\u3092\u5348\u5f8c\u8a66\u9a13\u30ec\u30d9\u30eb\u3067\u89e3\u8aac"},"content":{"rendered":"<p>\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u30b9\u30da\u30b7\u30e3\u30ea\u30b9\u30c8\u8a66\u9a13\u3084\u5fdc\u7528\u60c5\u5831\u6280\u8853\u8005\u8a66\u9a13\u306e\u5348\u5f8c\u554f\u984c\u3067\u3001\u591a\u304f\u306e\u53d7\u9a13\u8005\u3092\u60a9\u307e\u305b\u308bSQL\u306e\u300c\u30ab\u30fc\u30bd\u30eb\uff08CURSOR\uff09\u300d\u3002\u7279\u306b\u300cDECLARE CURSOR\u300d\u304b\u3089\u59cb\u307e\u308b\u4e00\u9023\u306e\u51e6\u7406\u306f\u3001\u691c\u7d22\u7d50\u679c\u306e\u96c6\u5408\u304b\u30891\u884c\u305a\u3064\u30c7\u30fc\u30bf\u3092\u53d6\u308a\u51fa\u3057\u3066\u8907\u96d1\u306a\u51e6\u7406\u3092\u884c\u3046\u305f\u3081\u306e\u4ed5\u7d44\u307f\u3067\u3059\u304c\u3001\u305d\u306e\u624b\u7d9a\u304d\u7684\u306a\u6d41\u308c\u304c\u30a4\u30e1\u30fc\u30b8\u3057\u306b\u304f\u3044\u3068\u611f\u3058\u308b\u65b9\u3082\u591a\u3044\u306e\u3067\u306f\u306a\u3044\u3067\u3057\u3087\u3046\u304b\u3002\u307e\u305f\u3001\u300c\u30c8\u30ea\u30ac\uff08TRIGGER\uff09\u3068\u30ab\u30fc\u30bd\u30eb\u306f\u3069\u3046\u9023\u643a\u3059\u308b\u306e\u304b\uff1f\u300d\u3068\u3044\u3063\u305f\u3001\u3088\u308a\u5b9f\u8df5\u7684\u306a\u7591\u554f\u3082\u3088\u304f\u805e\u304b\u308c\u307e\u3059\u3002<\/p>\n<p>\u3053\u306e\u8a18\u4e8b\u3067\u306f\u3001SQL\u30ab\u30fc\u30bd\u30eb\u306e\u57fa\u672c\u7684\u306a\u6982\u5ff5\u304b\u3089\u3001\u300cDECLARE\uff08\u5ba3\u8a00\uff09\u300d\u300cOPEN\uff08\u30aa\u30fc\u30d7\u30f3\uff09\u300d\u300cFETCH\uff08\u30d5\u30a7\u30c3\u30c1\uff09\u300d\u300cCLOSE\uff08\u30af\u30ed\u30fc\u30ba\uff09\u300d\u3068\u3044\u3046\u4e00\u9023\u306e\u51e6\u7406\u306e\u6d41\u308c\u307e\u3067\u3092\u3001\u56f3\u89e3\u3084\u8eab\u8fd1\u306a\u4f8b\u3048\u3092\u4ea4\u3048\u3066\u5fb9\u5e95\u7684\u306b\u89e3\u8aac\u3057\u307e\u3059\u3002\u306a\u305c\u30ab\u30fc\u30bd\u30eb\u304c\u5fc5\u8981\u306a\u306e\u304b\u3001\u305d\u3057\u3066\u5b9f\u969b\u306e\u696d\u52d9\u3067\u3069\u306e\u3088\u3046\u306b\u5f79\u7acb\u3064\u306e\u304b\u3092\u8ad6\u7406\u7684\u306b\u7406\u89e3\u3059\u308c\u3070\u3001\u8907\u96d1\u306b\u898b\u3048\u308b\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u64cd\u4f5c\u3082\u30b9\u30c3\u30ad\u30ea\u3068\u982d\u306b\u5165\u3063\u3066\u304f\u308b\u306f\u305a\u3067\u3059\u3002\u3053\u306e\u8a18\u4e8b\u3092\u8aad\u307f\u7d42\u3048\u308b\u9803\u306b\u306f\u3001\u30ab\u30fc\u30bd\u30eb\u306e\u4f7f\u3044\u65b9\u3092\u30de\u30b9\u30bf\u30fc\u3057\u3001\u8a66\u9a13\u306e\u96e3\u554f\u3092\u89e3\u304d\u660e\u304b\u3059\u305f\u3081\u306e\u78ba\u304b\u306a\u6b66\u5668\u3092\u624b\u306b\u3057\u3066\u3044\u308b\u3067\u3057\u3087\u3046\u3002<\/p>\n<hr>\n<h2>SQL\u30ab\u30fc\u30bd\u30eb\u3068\u306f\uff1fDECLARE\u3067\u59cb\u307e\u308b\u300c1\u884c\u305a\u3064\u51e6\u7406\u300d\u306e\u5f79\u5272\u3092\u89e3\u8aac<\/h2>\n<p>\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u64cd\u4f5c\u3059\u308bSQL\u306f\u3001\u672c\u6765\u3001\u6761\u4ef6\u306b\u4e00\u81f4\u3059\u308b<strong>\u8907\u6570\u884c\u306e\u30c7\u30fc\u30bf\u3092\u300c\u96c6\u5408\uff08\u30bb\u30c3\u30c8\uff09\u300d\u3068\u3057\u3066\u4e00\u5ea6\u306b\u53d6\u5f97\u30fb\u51e6\u7406\u3059\u308b<\/strong>\u306e\u304c\u5f97\u610f\u3067\u3059\u3002\u4f8b\u3048\u3070\u3001<code>SELECT * FROM products WHERE stock < 10;<\/code> \u3068\u3044\u3046\u547d\u4ee4\u3092\u5b9f\u884c\u3059\u308b\u3068\u3001\u5728\u5eab\u304c10\u672a\u6e80\u306e\u5546\u54c1\u30c7\u30fc\u30bf\u304c\u4e00\u5ea6\u306b\u3059\u3079\u3066\u8fd4\u3063\u3066\u304d\u307e\u3059\u3002<\/p>\n<p>\u3057\u304b\u3057\u3001\u5b9f\u52d9\u3084\u8a66\u9a13\u554f\u984c\u3067\u306f\u3001\u300c\u53d6\u5f97\u3057\u305f\u30c7\u30fc\u30bf1\u884c\u3054\u3068\u306b\u3001\u8907\u96d1\u306a\u6761\u4ef6\u5206\u5c90\u3092\u3057\u306a\u304c\u3089\u5225\u306e\u30c6\u30fc\u30d6\u30eb\u3092\u66f4\u65b0\u3057\u305f\u3044\u300d\u3068\u3044\u3063\u305f\u3001\u3088\u308a\u624b\u7d9a\u304d\u7684\u306a\u51e6\u7406\u304c\u6c42\u3081\u3089\u308c\u308b\u5834\u9762\u304c\u3042\u308a\u307e\u3059\u3002\u3053\u306e\u3088\u3046\u306a<strong>\u96c6\u5408\u51e6\u7406\u304c\u82e6\u624b\u3068\u3059\u308b\u300c1\u884c\u305a\u3064\u300d\u306e\u51e6\u7406\u3092\u5b9f\u73fe<\/strong>\u3059\u308b\u305f\u3081\u306b\u4f7f\u308f\u308c\u308b\u306e\u304c<strong>SQL\u30ab\u30fc\u30bd\u30eb<\/strong>\u3067\u3059\u3002<\/p>\n<h3>\u30ab\u30fc\u30bd\u30eb\u306e\u8eab\u8fd1\u306a\u4f8b\u3048\uff1a\u6599\u7406\u672c\u3068\u6307\u3055\u3057\u78ba\u8a8d<\/h3>\n<p>\u30ab\u30fc\u30bd\u30eb\u306e\u52d5\u304d\u3092\u7406\u89e3\u3059\u308b\u305f\u3081\u306b\u3001\u6599\u7406\u672c\u3092\u601d\u3044\u6d6e\u304b\u3079\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<ul>\n<li><strong>\u901a\u5e38\u306eSQL<\/strong>\uff1a\u6599\u7406\u672c\u3067\u300c\u30ab\u30ec\u30fc\u306e\u30ec\u30b7\u30d4\u300d\u306e\u30da\u30fc\u30b8\u5168\u4f53\u3092\u958b\u304f\u3053\u3068\u306b\u4f3c\u3066\u3044\u307e\u3059\u3002\u30ec\u30b7\u30d4\u5168\u4f53\uff08\u30c7\u30fc\u30bf\u306e\u96c6\u5408\uff09\u3092\u4e00\u5ea6\u306b\u773a\u3081\u308b\u3053\u3068\u306f\u3067\u304d\u307e\u3059\u304c\u3001\u624b\u9806\u3092\u4e00\u3064\u305a\u3064\u5b9f\u884c\u3059\u308b\u306b\u306f\u4e0d\u4fbf\u3067\u3059\u3002<\/li>\n<li><strong>\u30ab\u30fc\u30bd\u30eb<\/strong>\uff1a\u30ec\u30b7\u30d4\u306e1\u884c\u76ee\u300c\u2460\u7389\u306d\u304e\u3092\u307f\u3058\u3093\u5207\u308a\u306b\u3059\u308b\u300d\u3092<strong>\u6307\u3055\u3057<\/strong>\u3001\u305d\u306e\u4f5c\u696d\u304c\u7d42\u308f\u3063\u305f\u3089\u3001\u6307\u30922\u884c\u76ee\u300c\u2461\u4eba\u53c2\u3092\u4e71\u5207\u308a\u306b\u3059\u308b\u300d\u306b<strong>\u52d5\u304b\u3059<\/strong>\u3088\u3046\u306a\u3082\u306e\u3067\u3059\u3002\u3053\u306e<strong>\u300c\u6307\u300d\u306e\u5f79\u5272<\/strong>\u3053\u305d\u304c\u30ab\u30fc\u30bd\u30eb\u3067\u3059\u3002\u691c\u7d22\u7d50\u679c\u306e\u96c6\u5408\u306e\u4e2d\u304b\u3089\u300c\u4eca\u3001\u3069\u306e\u884c\u3092\u51e6\u7406\u3057\u3066\u3044\u308b\u304b\u300d\u3068\u3044\u3046\u73fe\u5728\u5730\u3092\u793a\u3057\u30011\u884c\u305a\u3064\u9806\u306b\u51e6\u7406\u3092\u9032\u3081\u308b\u3053\u3068\u3092\u53ef\u80fd\u306b\u3057\u307e\u3059\u3002<\/li>\n<\/ul>\n<h3>\u306a\u305c\u30ab\u30fc\u30bd\u30eb\u304c\u5fc5\u8981\u306a\u306e\u304b\uff1f\u3010\u4ed5\u4e8b\u3067\u306e\u6d3b\u7528\u4f8b\u3011<\/h3>\n<p>\u4f8b\u3048\u3070\u3001\u300cEC\u30b5\u30a4\u30c8\u3067\u3001\u4eca\u6708\u306e\u58f2\u4e0a\u4e0a\u4f4d10\u540d\u306e\u9867\u5ba2\u306b\u5bfe\u3057\u3066\u3001\u904e\u53bb\u306e\u8cfc\u5165\u5c65\u6b74\u306b\u5fdc\u3058\u305f\u500b\u5225\u306e\u30af\u30fc\u30dd\u30f3\u30b3\u30fc\u30c9\u3092\u767a\u884c\u3057\u3001\u30ed\u30b0\u30c6\u30fc\u30d6\u30eb\u306b\u8a18\u9332\u3059\u308b\u300d\u3068\u3044\u3046\u51e6\u7406\u3092\u8003\u3048\u307e\u3059\u3002<\/p>\n<p>\u3053\u306e\u51e6\u7406\u306f\u3001\u5358\u7d14\u306a<code>UPDATE<\/code>\u6587\u4e00\u767a\u3067\u306f\u5b9f\u73fe\u3067\u304d\u307e\u305b\u3093\u3002\u9867\u5ba2ID\uff08<code>customer_id<\/code>\uff09\u30921\u4ef6\u305a\u3064\u53d6\u308a\u51fa\u3057\u3001\u305d\u306e\u9867\u5ba2\u306e\u8cfc\u5165\u5c65\u6b74\u3092\u5206\u6790\u3057\u3001\u30af\u30fc\u30dd\u30f3\u3092\u751f\u6210\u3057\u3001\u30ed\u30b0\u306b\u66f8\u304d\u8fbc\u3080\u3001\u3068\u3044\u3046\u4e00\u9023\u306e\u6d41\u308c\u309210\u56de\u7e70\u308a\u8fd4\u3059\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u3053\u306e\u3088\u3046\u306a\u30d0\u30c3\u30c1\u51e6\u7406\u3084\u30b9\u30c8\u30a2\u30c9\u30d7\u30ed\u30b7\u30fc\u30b8\u30e3\u5185\u3067\u306e\u8907\u96d1\u306a\u9010\u6b21\u51e6\u7406\u306b\u3001\u30ab\u30fc\u30bd\u30eb\u306f\u7d76\u5927\u306a\u52b9\u679c\u3092\u767a\u63ee\u3057\u307e\u3059\u3002<\/p>\n<h3>\u901a\u5e38\u306eSQL\u3068\u30ab\u30fc\u30bd\u30eb\u51e6\u7406\u306e\u9055\u3044<\/h3>\n<table border=\"1\" style=\"width:100%; border-collapse: collapse;\">\n<thead style=\"background-color:#f2f2f2;\">\n<tr>\n<th style=\"padding: 8px; border: 1px solid #ddd; text-align: left;\">\u6bd4\u8f03\u9805\u76ee<\/th>\n<th style=\"padding: 8px; border: 1px solid #ddd; text-align: left;\">\u901a\u5e38\u306eSQL\uff08\u96c6\u5408\u51e6\u7406\uff09<\/th>\n<th style=\"padding: 8px; border: 1px solid #ddd; text-align: left;\">\u30ab\u30fc\u30bd\u30eb\u51e6\u7406\uff08\u624b\u7d9a\u304d\u51e6\u7406\uff09<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"padding: 8px; border: 1px solid #ddd;\"><strong>\u51e6\u7406\u5358\u4f4d<\/strong><\/td>\n<td style=\"padding: 8px; border: 1px solid #ddd;\">\u8907\u6570\u884c\u306e<strong>\u96c6\u5408<\/strong><\/td>\n<td style=\"padding: 8px; border: 1px solid #ddd;\"><strong>1\u884c<\/strong>\u305a\u3064<\/td>\n<\/tr>\n<tr>\n<td style=\"padding: 8px; border: 1px solid #ddd;\"><strong>\u5f97\u610f\u306a\u3053\u3068<\/strong><\/td>\n<td style=\"padding: 8px; border: 1px solid #ddd;\">\u30c7\u30fc\u30bf\u306e\u691c\u7d22\u3001\u96c6\u8a08\u3001\u4e00\u62ec\u66f4\u65b0\u30fb\u524a\u9664<\/td>\n<td style=\"padding: 8px; border: 1px solid #ddd;\">1\u884c\u3054\u3068\u306b\u8907\u96d1\u306a\u6761\u4ef6\u5206\u5c90\u3084\u9010\u6b21\u51e6\u7406\u3092\u884c\u3046<\/td>\n<\/tr>\n<tr>\n<td style=\"padding: 8px; border: 1px solid #ddd;\"><strong>\u30a4\u30e1\u30fc\u30b8<\/strong><\/td>\n<td style=\"padding: 8px; border: 1px solid #ddd;\">\u691c\u7d22\u7d50\u679c\u3092\u4e00\u679a\u306e\u8868\u3068\u3057\u3066\u4e00\u6c17\u306b\u8fd4\u3059<\/td>\n<td style=\"padding: 8px; border: 1px solid #ddd;\">\u7d50\u679c\u30bb\u30c3\u30c8\u5185\u3092\u4e00\u884c\u305a\u3064\u79fb\u52d5\u3059\u308b\u30dd\u30a4\u30f3\u30bf\uff08\u3057\u304a\u308a\uff09<\/td>\n<\/tr>\n<tr>\n<td style=\"padding: 8px; border: 1px solid #ddd;\"><strong>\u4e3b\u306a\u7528\u9014<\/strong><\/td>\n<td style=\"padding: 8px; border: 1px solid #ddd;\">\u30c7\u30fc\u30bf\u62bd\u51fa\u3001\u30ec\u30dd\u30fc\u30c8\u4f5c\u6210<\/td>\n<td style=\"padding: 8px; border: 1px solid #ddd;\">\u30d0\u30c3\u30c1\u51e6\u7406\u3001\u30ed\u30b0\u8a18\u9332\u3001\u30c8\u30ea\u30ac\u3084\u30b9\u30c8\u30a2\u30c9\u30d7\u30ed\u30b7\u30fc\u30b8\u30e3\u5185\u3067\u306e\u8907\u96d1\u306a\u30ed\u30b8\u30c3\u30af<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<hr>\n<h2>\u30ab\u30fc\u30bd\u30eb\u51e6\u7406\u306e4\u30b9\u30c6\u30c3\u30d7\u2502DECLARE, OPEN, FETCH, CLOSE\u306e\u4f7f\u3044\u65b9<\/h2>\n<p>SQL\u30ab\u30fc\u30bd\u30eb\u3092\u4f7f\u3063\u305f\u51e6\u7406\u306b\u306f\u3001\u304a\u6c7a\u307e\u308a\u306e\u300c\u578b\u300d\u304c\u3042\u308a\u307e\u3059\u3002\u305d\u308c\u306f<strong>\u300c\u2460\u5ba3\u8a00 \u2192 \u2461\u30aa\u30fc\u30d7\u30f3 \u2192 \u2462\u30d5\u30a7\u30c3\u30c1\uff08\u7e70\u308a\u8fd4\u3057\uff09 \u2192 \u2463\u30af\u30ed\u30fc\u30ba\u300d<\/strong>\u3068\u3044\u30464\u3064\u306e\u30b9\u30c6\u30c3\u30d7\u3067\u3059\u3002\u3053\u306e\u4e00\u9023\u306e\u6d41\u308c\u3092\u7406\u89e3\u3059\u308b\u3053\u3068\u304c\u3001\u30ab\u30fc\u30bd\u30eb\u653b\u7565\u306e\u6700\u5927\u306e\u30dd\u30a4\u30f3\u30c8\u3067\u3059\u3002<\/p>\n<\/p>\n<h3>\u2460 DECLARE\uff08\u5ba3\u8a00\uff09\uff1a\u3069\u306e\u30ec\u30b7\u30d4\u3092\u8aad\u3080\u304b\u6c7a\u3081\u308b<\/h3>\n<p>\u307e\u305a\u306f\u3058\u3081\u306b\u3001\u3069\u306e\u3088\u3046\u306a\u30c7\u30fc\u30bf\u30921\u884c\u305a\u3064\u51e6\u7406\u3057\u305f\u3044\u306e\u304b\u3092\u5b9a\u7fa9\u3057\u307e\u3059\u3002\u3053\u308c\u304c\u30ab\u30fc\u30bd\u30eb\u306e<strong>\u5ba3\u8a00\uff08DECLARE\uff09<\/strong>\u3067\u3059\u3002<\/p>\n<p><strong>\u3010\u69cb\u6587\u306e\u30dd\u30a4\u30f3\u30c8\u3011<\/strong><br \/><code>DECLARE &lt;\u30ab\u30fc\u30bd\u30eb\u540d&gt; CURSOR FOR &lt;SELECT\u6587&gt;;<\/code><\/p>\n<h3>\u2461 OPEN\uff08\u30aa\u30fc\u30d7\u30f3\uff09\uff1a\u30ec\u30b7\u30d4\u3092\u958b\u3044\u3066\u6e96\u5099\u3059\u308b<\/h3>\n<p>\u6b21\u306b\u3001\u5ba3\u8a00\u3057\u305f\u30ab\u30fc\u30bd\u30eb\u3092\u4f7f\u3048\u308b\u72b6\u614b\u306b\u3057\u307e\u3059\u3002\u3053\u308c\u304c\u30ab\u30fc\u30bd\u30eb\u306e<strong>\u30aa\u30fc\u30d7\u30f3\uff08OPEN\uff09<\/strong>\u3067\u3059\u3002<\/p>\n<h3>\u2462 FETCH\uff08\u30d5\u30a7\u30c3\u30c1\uff09\uff1a1\u884c\u8aad\u3093\u3067\u3001\u51e6\u7406\u3092\u5b9f\u884c\u3059\u308b<\/h3>\n<p>\u3044\u3088\u3044\u3088\u30c7\u30fc\u30bf\u30921\u884c\u305a\u3064\u53d6\u308a\u51fa\u3057\u3066\u51e6\u7406\u3057\u307e\u3059\u3002\u3053\u306e\u64cd\u4f5c\u304c<strong>\u30d5\u30a7\u30c3\u30c1\uff08FETCH\uff09<\/strong>\u3067\u3059\u3002<\/p>\n<p><strong>\u3010\u69cb\u6587\u306e\u30dd\u30a4\u30f3\u30c8\u3011<\/strong><br \/><code>FETCH &lt;\u30ab\u30fc\u30bd\u30eb\u540d&gt; INTO &lt;\u5909\u65701&gt;, &lt;\u5909\u65702&gt;, ...;<\/code><\/p>\n<h3>\u2463 CLOSE\uff08\u30af\u30ed\u30fc\u30ba\uff09\uff1a\u30ec\u30b7\u30d4\u3092\u9589\u3058\u3066\u7247\u4ed8\u3051\u308b<\/h3>\n<p>\u30eb\u30fc\u30d7\u51e6\u7406\u304c\u3059\u3079\u3066\u7d42\u308f\u3063\u305f\u3089\u3001\u6700\u5f8c\u306b\u30ab\u30fc\u30bd\u30eb\u3092\u9589\u3058\u307e\u3059\u3002\u3053\u308c\u304c<strong>\u30af\u30ed\u30fc\u30ba\uff08CLOSE\uff09<\/strong>\u3067\u3059\u3002<\/p>\n<h3>\u5404\u30b9\u30c6\u30c3\u30d7\u306e\u5f79\u5272\u3068\u69cb\u6587\u307e\u3068\u3081<\/h3>\n<table border=\"1\" style=\"width:100%; border-collapse: collapse;\">\n<thead style=\"background-color:#f2f2f2;\">\n<tr>\n<th style=\"padding: 8px; border: 1px solid #ddd; text-align: left;\">\u30b9\u30c6\u30c3\u30d7<\/th>\n<th style=\"padding: 8px; border: 1px solid #ddd; text-align: left;\">\u5f79\u5272<\/th>\n<th style=\"padding: 8px; border: 1px solid #ddd; text-align: left;\">SQL\u69cb\u6587\u4f8b (SQL Server \/ MySQL)<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"padding: 8px; border: 1px solid #ddd;\"><strong>\u2460 DECLARE<\/strong><\/td>\n<td style=\"padding: 8px; border: 1px solid #ddd;\"><strong>\u30ab\u30fc\u30bd\u30eb\u306e\u5ba3\u8a00<\/strong>\uff1a\u540d\u524d\u3068\u3001\u5bfe\u8c61\u3068\u306a\u308bSELECT\u6587\u3092\u5b9a\u7fa9\u3059\u308b\u3002<\/td>\n<td style=\"padding: 8px; border: 1px solid #ddd;\"><code>DECLARE cur_products CURSOR FOR SELECT product_id, price FROM products;<\/code><\/td>\n<\/tr>\n<tr>\n<td style=\"padding: 8px; border: 1px solid #ddd;\"><strong>\u2461 OPEN<\/strong><\/td>\n<td style=\"padding: 8px; border: 1px solid #ddd;\"><strong>\u30ab\u30fc\u30bd\u30eb\u306e\u30aa\u30fc\u30d7\u30f3<\/strong>\uff1aSELECT\u6587\u3092\u5b9f\u884c\u3057\u3001\u7d50\u679c\u30bb\u30c3\u30c8\u3092\u6e96\u5099\u3059\u308b\u3002<\/td>\n<td style=\"padding: 8px; border: 1px solid #ddd;\"><code>OPEN cur_products;<\/code><\/td>\n<\/tr>\n<tr>\n<td style=\"padding: 8px; border: 1px solid #ddd;\"><strong>\u2462 FETCH<\/strong><\/td>\n<td style=\"padding: 8px; border: 1px solid #ddd;\"><strong>\u30c7\u30fc\u30bf\u306e\u53d6\u5f97<\/strong>\uff1a\u7d50\u679c\u30bb\u30c3\u30c8\u304b\u30891\u884c\u5206\u306e\u30c7\u30fc\u30bf\u3092\u5909\u6570\u306b\u683c\u7d0d\u3059\u308b\u3002<\/td>\n<td style=\"padding: 8px; border: 1px solid #ddd;\"><code>FETCH cur_products INTO @p_id, @p_price;<\/code><\/td>\n<\/tr>\n<tr>\n<td style=\"padding: 8px; border: 1px solid #ddd;\"><strong>\u2463 CLOSE<\/strong><\/td>\n<td style=\"padding: 8px; border: 1px solid #ddd;\"><strong>\u30ab\u30fc\u30bd\u30eb\u306e\u30af\u30ed\u30fc\u30ba<\/strong>\uff1a\u30ab\u30fc\u30bd\u30eb\u3092\u9589\u3058\u3066\u3001\u95a2\u9023\u30ea\u30bd\u30fc\u30b9\u3092\u89e3\u653e\u3059\u308b\u3002<\/td>\n<td style=\"padding: 8px; border: 1px solid #ddd;\"><code>CLOSE cur_products;<\/code><\/td>\n<\/tr>\n<tr>\n<td style=\"padding: 8px; border: 1px solid #ddd;\"><strong>(\u88dc\u8db3)<\/strong><\/td>\n<td style=\"padding: 8px; border: 1px solid #ddd;\"><strong>\u5b9a\u7fa9\u306e\u89e3\u653e<\/strong>\uff1a\u30ab\u30fc\u30bd\u30eb\u5b9a\u7fa9\u81ea\u4f53\u3092\u30e1\u30e2\u30ea\u304b\u3089\u524a\u9664\u3059\u308b\u3002<\/td>\n<td style=\"padding: 8px; border: 1px solid #ddd;\"><code>DEALLOCATE cur_products;<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<hr>\n<h2>\u3010\u5b9f\u8df5\u7de8\u3011\u5177\u4f53\u7684\u306a\u30b3\u30fc\u30c9\u3067\u898b\u308b\u30ab\u30fc\u30bd\u30eb\u306e\u4f7f\u3044\u65b9\u3068\u30eb\u30fc\u30d7\u51e6\u7406<\/h2>\n<p>\u3053\u3053\u307e\u3067\u306e\u30b9\u30c6\u30c3\u30d7\u3092\u3001\u5177\u4f53\u7684\u306aSQL\u30b3\u30fc\u30c9\uff08\u30b9\u30c8\u30a2\u30c9\u30d7\u30ed\u30b7\u30fc\u30b8\u30e3\uff09\u306e\u4f8b\u3067\u898b\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002\u3053\u3053\u3067\u306f\u3001\u300c\u5728\u5eab\u304c\u4e00\u5b9a\u6570\uff08<code>threshold<\/code>\uff09\u4ee5\u4e0b\u306e\u5546\u54c1\u3092\u62bd\u51fa\u3057\u3001\u305d\u306e\u5546\u54c1\u3054\u3068\u306b\u767a\u6ce8\u30c6\u30fc\u30d6\u30eb\uff08<code>orders<\/code>\uff09\u306b\u30ec\u30b3\u30fc\u30c9\u3092\u8ffd\u52a0\u3059\u308b\u300d\u3068\u3044\u3046\u51e6\u7406\u3092\u60f3\u5b9a\u3057\u307e\u3059\u3002<\/p>\n<pre><code style=\"display: block; white-space: pre-wrap; background-color: #f4f4f4; padding: 15px; border-radius: 5px; font-family: monospace;\">\n-- SQL Server \/ MySQL \u3067\u306e\u30b9\u30c8\u30a2\u30c9\u30d7\u30ed\u30b7\u30fc\u30b8\u30e3\u4f8b\nCREATE PROCEDURE sp_order_low_stock_products(IN threshold INT)\nBEGIN\n    -- 1. \u5909\u6570\u306e\u5ba3\u8a00 (FETCH\u3067\u53d7\u3051\u53d6\u308b\u7528)\n    DECLARE done INT DEFAULT FALSE;\n    DECLARE p_id INT;\n    DECLARE p_name VARCHAR(255);\n\n    -- 2. \u30ab\u30fc\u30bd\u30eb\u306e\u5ba3\u8a00 (DECLARE)\n    DECLARE cur_low_stock CURSOR FOR \n        SELECT product_id, product_name \n        FROM products \n        WHERE stock <= threshold;\n\n    -- 3. \u30eb\u30fc\u30d7\u306e\u7d42\u4e86\u6761\u4ef6\u3092\u5b9a\u7fa9 (\u30c7\u30fc\u30bf\u304c\u306a\u304f\u306a\u3063\u305f\u3089 done \u3092 TRUE \u306b)\n    DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE;\n\n    -- 4. \u30ab\u30fc\u30bd\u30eb\u306e\u30aa\u30fc\u30d7\u30f3 (OPEN)\n    OPEN cur_low_stock;\n\n    -- 5. \u30eb\u30fc\u30d7\u51e6\u7406\u3067\u30c7\u30fc\u30bf\u30921\u884c\u305a\u3064\u53d6\u5f97 (FETCH)\n    read_loop: LOOP\n        FETCH cur_low_stock INTO p_id, p_name;\n        \n        -- \u30eb\u30fc\u30d7\u306e\u7d42\u4e86\u5224\u5b9a\n        IF done THEN\n            LEAVE read_loop;\n        END IF;\n\n        -- \u53d6\u5f97\u3057\u305f\u30c7\u30fc\u30bf\u3092\u4f7f\u3063\u3066\u767a\u6ce8\u30c6\u30fc\u30d6\u30eb\u306bINSERT\n        INSERT INTO orders (product_id, order_date, status) \n        VALUES (p_id, CURDATE(), 'pending');\n\n    END LOOP;\n\n    -- 6. \u30ab\u30fc\u30bd\u30eb\u306e\u30af\u30ed\u30fc\u30ba (CLOSE)\n    CLOSE cur_low_stock;\n\nEND;\n<\/code><\/pre>\n<h3>\u30b3\u30fc\u30c9\u89e3\u8aac\uff1a\u30eb\u30fc\u30d7\u51e6\u7406\u306e\u4ed5\u7d44\u307f<\/h3>\n<p>\u3053\u306e\u30b3\u30fc\u30c9\u306e\u5fc3\u81d3\u90e8\u306f<code>LOOP<\/code>\u3068<code>FETCH<\/code>\u306e\u90e8\u5206\u3067\u3059\u3002<\/p>\n<ol>\n<li><strong><code>DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE;<\/code><\/strong>: \u300c<code>FETCH<\/code>\u3057\u3088\u3046\u3068\u3057\u305f\u3051\u3069\u3001\u3082\u3046\u6b21\u306e\u884c\u304c\u306a\u304b\u3063\u305f\uff08NOT FOUND\uff09\u300d\u5834\u5408\u306b\u3001\u5909\u6570 <code>done<\/code> \u3092 <code>TRUE<\/code> \u306b\u8a2d\u5b9a\u3059\u308b\u3068\u3044\u3046\u610f\u5473\u3067\u3059\u3002\u3053\u308c\u304c\u30eb\u30fc\u30d7\u3092\u629c\u3051\u308b\u305f\u3081\u306e\u91cd\u8981\u306a\u5408\u56f3\u306b\u306a\u308a\u307e\u3059\u3002<\/li>\n<li><strong><code>FETCH ... INTO ...;<\/code><\/strong>: \u30ab\u30fc\u30bd\u30eb\u304c\u6307\u3059\u884c\u306e\u30c7\u30fc\u30bf\u3092\u3001\u6307\u5b9a\u3057\u305f\u5909\u6570\u306b\u683c\u7d0d\u3057\u307e\u3059\u3002<\/li>\n<li><strong><code>IF done THEN LEAVE ...;<\/code><\/strong>: \u3082\u3057\u5909\u6570<code>done<\/code>\u304c<code>TRUE<\/code>\u306a\u3089\u3001<code>LEAVE<\/code>\u547d\u4ee4\u3067\u30eb\u30fc\u30d7\u3092\u8131\u51fa\u3057\u307e\u3059\u3002<\/li>\n<\/ol>\n<p>\u3053\u306e\u3088\u3046\u306b\u3001\u30ab\u30fc\u30bd\u30eb\u306f<strong>\u30eb\u30fc\u30d7\u51e6\u7406\u3068\u7d44\u307f\u5408\u308f\u305b\u308b\u3053\u3068\u3067\u771f\u4fa1\u3092\u767a\u63ee<\/strong>\u3057\u307e\u3059\u3002\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u30b9\u30da\u30b7\u30e3\u30ea\u30b9\u30c8\u8a66\u9a13\u306e\u5348\u5f8c\u554f\u984c\u306a\u3069\u3067\u306f\u3001\u3053\u306e\u30eb\u30fc\u30d7\u69cb\u9020\u3092\u6b63\u3057\u304f\u8aad\u307f\u89e3\u3051\u308b\u304b\u304c\u9375\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n<hr>\n<h2>\u30ab\u30fc\u30bd\u30eb\u3068\u30c8\u30ea\u30ac\u306e\u95a2\u4fc2\u6027\u2502BEFORE\/AFTER\u30c8\u30ea\u30ac\u3067\u306e\u9023\u643a\u3068\u6ce8\u610f\u70b9<\/h2>\n<p>\u300c\u30ab\u30fc\u30bd\u30eb\u3068\u30c8\u30ea\u30ac\u306f\u3069\u3046\u9055\u3046\u306e\uff1f\u300d\u300c\u3069\u3046\u9023\u643a\u3059\u308b\u306e\uff1f\u300d\u3068\u3044\u3046\u7591\u554f\u306f\u3001\u591a\u304f\u306e\u5b66\u7fd2\u8005\u304c\u62b1\u304f\u30dd\u30a4\u30f3\u30c8\u3067\u3059\u3002\u7d50\u8ad6\u304b\u3089\u8a00\u3046\u3068\u3001\u4e21\u8005\u306f\u5168\u304f\u7570\u306a\u308b\u5f79\u5272\u3092\u6301\u3064\u6a5f\u80fd\u3067\u3059\u304c\u3001<strong>\u7279\u5b9a\u306e\u76ee\u7684\u306e\u305f\u3081\u306b\u9023\u643a\u3055\u305b\u308b<\/strong>\u3053\u3068\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<h3>\u6d3b\u7528\u4f8b\uff1aAFTER INSERT\u30c8\u30ea\u30ac\u3068\u30ab\u30fc\u30bd\u30eb\u306e\u9023\u643a<\/h3>\n<p><strong>\u30b7\u30ca\u30ea\u30aa<\/strong>\uff1a\u300c\u6ce8\u6587\u30c6\u30fc\u30d6\u30eb\uff08<code>orders<\/code>\uff09\u306b\u65b0\u3057\u3044\u6ce8\u6587\u30c7\u30fc\u30bf\u304c1\u4ef6\u8ffd\u52a0\u3055\u308c\u305f<strong>\u5f8c\uff08AFTER INSERT\uff09<\/strong>\u306b\u3001\u305d\u306e\u6ce8\u6587\u660e\u7d30\uff08<code>order_details<\/code>\uff09\u30921\u884c\u305a\u3064\u53c2\u7167\u3057\u3001\u5546\u54c1\u30de\u30b9\u30bf\uff08<code>products<\/code>\uff09\u306e\u5728\u5eab\u6570\u3092\u66f4\u65b0\u3059\u308b\u300d<br \/>\n\u3053\u306e\u3088\u3046\u306a\u300c\u4f55\u304b\u304c\u8d77\u304d\u305f\u5f8c\u300d\u306e\u95a2\u9023\u51e6\u7406\u306b<code>AFTER<\/code>\u30c8\u30ea\u30ac\u3068\u30ab\u30fc\u30bd\u30eb\u306e\u7d44\u307f\u5408\u308f\u305b\u304c\u4f7f\u308f\u308c\u307e\u3059\u3002<\/p>\n<h3>\u6d3b\u7528\u4f8b\uff1aBEFORE INSERT\u30c8\u30ea\u30ac\u3067\u306e\u4e8b\u524d\u30c1\u30a7\u30c3\u30af\uff08\u30b3\u30fc\u30c9\u4f8b\uff09<\/h3>\n<p>\u6b21\u306b\u3001\u30c7\u30fc\u30bf\u304c\u30c6\u30fc\u30d6\u30eb\u306b\u66f8\u304d\u8fbc\u307e\u308c\u308b<strong>\u524d<\/strong>\u306b\u5b9f\u884c\u3055\u308c\u308b<code>BEFORE<\/code>\u30c8\u30ea\u30ac\u306e\u4f8b\u3092\u898b\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p><strong>\u30b7\u30ca\u30ea\u30aa<\/strong>\uff1a\u300c\u6ce8\u6587\u660e\u7d30\u30c6\u30fc\u30d6\u30eb\uff08<code>order_details<\/code>\uff09\u306b\u65b0\u3057\u3044\u30ec\u30b3\u30fc\u30c9\u304c\u8ffd\u52a0\u3055\u308c\u308b<strong>\u524d<\/strong>\u306b\u3001\u305d\u306e\u6ce8\u6587\u5546\u54c1\u306b\u7d10\u3065\u304f\u5168\u3066\u306e\u300e\u95a2\u9023\u5546\u54c1\u300f\uff08\u4f8b\uff1a\u30bb\u30c3\u30c8\u8ca9\u58f2\u54c1\u306a\u3069\uff09\u306e\u5728\u5eab\u3092\u30c1\u30a7\u30c3\u30af\u3057\u3001\u4e00\u3064\u3067\u3082\u5728\u5eab\u304c\u306a\u3051\u308c\u3070\u30a8\u30e9\u30fc\u3092\u767a\u751f\u3055\u305b\u3066\u6ce8\u6587\u3092\u30ad\u30e3\u30f3\u30bb\u30eb\u3059\u308b\u300d<\/p>\n<p>\u3053\u306e\u30b7\u30ca\u30ea\u30aa\u3067\u306f\u3001<code>BEFORE INSERT<\/code>\u30c8\u30ea\u30ac\u5185\u3067\u30ab\u30fc\u30bd\u30eb\u3092\u4f7f\u3044\u3001\u8907\u96d1\u306a\u4e8b\u524d\u30c1\u30a7\u30c3\u30af\u30ed\u30b8\u30c3\u30af\u3092\u5b9f\u73fe\u3057\u307e\u3059\u3002<\/p>\n<pre><code style=\"display: block; white-space: pre-wrap; background-color: #f4f4f4; padding: 15px; border-radius: 5px; font-family: monospace;\">\n-- MySQL\u3067\u306eBEFORE INSERT\u30c8\u30ea\u30ac\u4f8b\nCREATE TRIGGER trg_check_related_stock_before_insert\nBEFORE INSERT ON order_details\nFOR EACH ROW\nBEGIN\n    -- \u5909\u6570\u5ba3\u8a00\n    DECLARE done INT DEFAULT FALSE;\n    DECLARE related_p_id INT;\n    DECLARE current_stock INT;\n\n    -- \u30ab\u30fc\u30bd\u30eb\u5ba3\u8a00\uff1a\u3053\u308c\u304b\u3089INSERT\u3055\u308c\u308b\u5546\u54c1ID(NEW.product_id)\u306b\u7d10\u3065\u304f\u95a2\u9023\u5546\u54c1\u3092\u53d6\u5f97\n    DECLARE cur_related CURSOR FOR\n        SELECT related_product_id FROM related_products WHERE original_product_id = NEW.product_id;\n    \n    -- \u30eb\u30fc\u30d7\u7d42\u4e86\u30cf\u30f3\u30c9\u30e9\n    DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE;\n\n    OPEN cur_related;\n\n    check_loop: LOOP\n        FETCH cur_related INTO related_p_id;\n        IF done THEN\n            LEAVE check_loop;\n        END IF;\n\n        -- \u95a2\u9023\u5546\u54c1\u306e\u5728\u5eab\u6570\u3092\u30c1\u30a7\u30c3\u30af\n        SELECT stock INTO current_stock FROM products WHERE product_id = related_p_id;\n\n        -- \u5728\u5eab\u304c0\u306a\u3089\u30a8\u30e9\u30fc\u3092\u767a\u751f\u3055\u305b\u3066INSERT\u3092\u4e2d\u6b62\n        IF current_stock <= 0 THEN\n            -- \u30a8\u30e9\u30fc\u3092\u767a\u751f\u3055\u305b\u308b\n            SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = '\u95a2\u9023\u5546\u54c1\u306e\u5728\u5eab\u304c\u3042\u308a\u307e\u305b\u3093\u3002\u6ce8\u6587\u3092\u30ad\u30e3\u30f3\u30bb\u30eb\u3057\u307e\u3057\u305f\u3002';\n        END IF;\n    END LOOP;\n\n    CLOSE cur_related;\nEND;\n<\/code><\/pre>\n<h4>\u30b3\u30fc\u30c9\u89e3\u8aac<\/h4>\n<ul>\n<li><strong><code>FOR EACH ROW<\/code><\/strong>: INSERT\u3055\u308c\u308b\u5404\u884c\u306b\u5bfe\u3057\u3066\u3053\u306e\u30c8\u30ea\u30ac\u304c\u5b9f\u884c\u3055\u308c\u308b\u3053\u3068\u3092\u610f\u5473\u3057\u307e\u3059\u3002<\/li>\n<li><strong><code>NEW.product_id<\/code><\/strong>: \u30c8\u30ea\u30ac\u5185\u3067\u4f7f\u3048\u308b\u7279\u6b8a\u306a\u30ad\u30fc\u30ef\u30fc\u30c9\u3067\u3001<strong>\u3053\u308c\u304b\u3089INSERT\u3055\u308c\u3088\u3046\u3068\u3057\u3066\u3044\u308b\u884c<\/strong>\u306e<code>product_id<\/code>\u5217\u306e\u5024\u3092\u6307\u3057\u307e\u3059\u3002<\/li>\n<li><strong><code>SIGNAL SQLSTATE '45000'<\/code><\/strong>: \u30e6\u30fc\u30b6\u30fc\u5b9a\u7fa9\u306e\u30a8\u30e9\u30fc\u3092\u610f\u56f3\u7684\u306b\u767a\u751f\u3055\u305b\u308b\u547d\u4ee4\u3067\u3059\u3002\u3053\u308c\u306b\u3088\u308a\u3001\u6761\u4ef6\u3092\u6e80\u305f\u3055\u306a\u3044<code>INSERT<\/code>\u51e6\u7406\u305d\u306e\u3082\u306e\u3092\u5931\u6557\u3055\u305b\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/li>\n<\/ul>\n<p>\u3053\u306e\u3088\u3046\u306b\u3001<code>BEFORE<\/code>\u30c8\u30ea\u30ac\u306f\u30c7\u30fc\u30bf\u306e\u6574\u5408\u6027\u3092\u4fdd\u3064\u305f\u3081\u306e\u300c\u9580\u756a\u300d\u306e\u3088\u3046\u306a\u5f79\u5272\u3092\u679c\u305f\u3057\u3001\u305d\u306e\u30c1\u30a7\u30c3\u30af\u51e6\u7406\u304c\u8907\u96d1\u306a\u5834\u5408\u306b\u30ab\u30fc\u30bd\u30eb\u304c\u6d3b\u7528\u3055\u308c\u308b\u3053\u3068\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<h3>BEFORE\u30c8\u30ea\u30ac \/ AFTER\u30c8\u30ea\u30ac\u306e\u4f7f\u3044\u5206\u3051\u3068\u6ce8\u610f\u70b9<\/h3>\n<ul>\n<li><strong><code>BEFORE<\/code>\u30c8\u30ea\u30ac<\/strong>: \u30c7\u30fc\u30bf\u304c\u30c6\u30fc\u30d6\u30eb\u306b<strong>\u66f8\u304d\u8fbc\u307e\u308c\u308b\u524d<\/strong>\u306b\u5b9f\u884c\u3055\u308c\u307e\u3059\u3002\u5165\u529b\u5024\u306e\u30c1\u30a7\u30c3\u30af\u3084\u3001\u5024\u306e\u81ea\u52d5\u88dc\u6b63\u306a\u3069\u306b\u4f7f\u308f\u308c\u307e\u3059\u3002<\/li>\n<li><strong><code>AFTER<\/code>\u30c8\u30ea\u30ac<\/strong>: \u30c7\u30fc\u30bf\u304c<strong>\u66f8\u304d\u8fbc\u307e\u308c\u305f\u5f8c<\/strong>\u306b\u5b9f\u884c\u3055\u308c\u307e\u3059\u3002\u66f8\u304d\u8fbc\u307e\u308c\u305f\u30c7\u30fc\u30bf\u3092\u4f7f\u3063\u3066\u5225\u306e\u30c6\u30fc\u30d6\u30eb\u3092\u66f4\u65b0\u3057\u305f\u308a\u3001\u30ed\u30b0\u3092\u6b8b\u3057\u305f\u308a\u3059\u308b\u5834\u5408\u306b\u9069\u3057\u3066\u3044\u307e\u3059\u3002<\/li>\n<\/ul>\n<p><strong>\u3010\u91cd\u8981\u3011\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u3078\u306e\u6ce8\u610f<\/strong><br \/>\n\u30c8\u30ea\u30ac\u3001\u7279\u306b\u305d\u306e\u5185\u90e8\u3067\u30ab\u30fc\u30bd\u30eb\u3092\u4f7f\u3046\u51e6\u7406\u306f\u3001\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u306b\u5927\u304d\u306a\u5f71\u97ff\u3092\u4e0e\u3048\u308b\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002\u30c8\u30ea\u30ac\u306f1\u56de\u306e<code>INSERT<\/code>\u3084<code>UPDATE<\/code>\u306e\u88cf\u3067\u81ea\u52d5\u5b9f\u884c\u3055\u308c\u308b\u305f\u3081\u3001\u51e6\u7406\u304c\u91cd\u3044\u3068\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u5168\u4f53\u306e\u5fdc\u7b54\u901f\u5ea6\u3092\u4f4e\u4e0b\u3055\u305b\u308b\u539f\u56e0\u306b\u306a\u308a\u304b\u306d\u307e\u305b\u3093\u3002\u305d\u306e\u305f\u3081\u3001\u5b9f\u52d9\u3067\u306f\u300c\u672c\u5f53\u306b\u30ab\u30fc\u30bd\u30eb\u3067\u306a\u3044\u3068\u5b9f\u73fe\u3067\u304d\u306a\u3044\u304b\uff1f\u300d\u300c\u96c6\u5408\u30d9\u30fc\u30b9\u306eSQL\u3067\u4e00\u62ec\u66f4\u65b0\u3067\u304d\u306a\u3044\u304b\uff1f\u300d\u3092\u5341\u5206\u306b\u691c\u8a0e\u3059\u308b\u3053\u3068\u304c\u975e\u5e38\u306b\u91cd\u8981\u3067\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u30b9\u30da\u30b7\u30e3\u30ea\u30b9\u30c8\u8a66\u9a13\u3084\u5fdc\u7528\u60c5\u5831\u6280\u8853\u8005\u8a66\u9a13\u306e\u5348\u5f8c\u554f\u984c\u3067\u3001\u591a\u304f\u306e\u53d7\u9a13\u8005\u3092\u60a9\u307e\u305b\u308bSQL\u306e\u300c\u30ab\u30fc\u30bd\u30eb\uff08CURSOR\uff09\u300d\u3002\u7279\u306b\u300cDECLARE CURSOR\u300d\u304b\u3089\u59cb\u307e\u308b\u4e00\u9023\u306e\u51e6\u7406\u306f\u3001\u691c\u7d22\u7d50\u679c\u306e\u96c6\u5408\u304b &#8230; <\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":"","columnck":"","stmeta_robots":"index, follow","st_titlewords":"","st_title_extra":"","st_keywords":"","st_description":"","st_display_ad_mark":"","st_display_ad_mark_hide":"","textcopyck":"","st_copyright":"","st_copyurl":"","eyecatch_set":"","st_youtube_url":"","st_youtube_eyecatch":"","headerwidget_set":"","updatewidget_set":"","kanrenwidget_set":"","ikkatuwidget_set":"","koukoku_set":"","auto_adsense_koukoku_set":"","st_redirect":"","st_redirect_url_as_canonical":"","st_redirect_pvm_do_not_track":"","post_data_updatewidget_set":"","st_post_header_under_bg":"","st_twitter_tag":"","affinger_note":"","rankdisplayck":"","st_head_code":"","st_footer_code":"","st_post_header_under_code":"","_st_toc_override":false,"_st_toc_settings":[]},"categories":[3],"tags":[6],"class_list":["post-5857","post","type-post","status-publish","format-standard","hentry","category-ipa","tag-6"],"_links":{"self":[{"href":"https:\/\/sky-peace.net\/certified\/wp-json\/wp\/v2\/posts\/5857","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sky-peace.net\/certified\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sky-peace.net\/certified\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sky-peace.net\/certified\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/sky-peace.net\/certified\/wp-json\/wp\/v2\/comments?post=5857"}],"version-history":[{"count":0,"href":"https:\/\/sky-peace.net\/certified\/wp-json\/wp\/v2\/posts\/5857\/revisions"}],"wp:attachment":[{"href":"https:\/\/sky-peace.net\/certified\/wp-json\/wp\/v2\/media?parent=5857"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sky-peace.net\/certified\/wp-json\/wp\/v2\/categories?post=5857"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sky-peace.net\/certified\/wp-json\/wp\/v2\/tags?post=5857"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}