{"id":2335,"date":"2020-08-28T13:58:11","date_gmt":"2020-08-28T04:58:11","guid":{"rendered":"http:\/\/agtech.co.jp\/blog\/?p=2335"},"modified":"2023-06-21T17:30:36","modified_gmt":"2023-06-21T08:30:36","slug":"btrieve2api_from_nodejs","status":"publish","type":"post","link":"https:\/\/www.agtech.co.jp\/blog\/2020\/08\/btrieve2api_from_nodejs\/","title":{"rendered":"Node.js \u304b\u3089 \u9ad8\u901f\u306a Btrieve 2 API \u3092\u5229\u7528\u3059\u308b\u65b9\u6cd5"},"content":{"rendered":"<p style=\"text-align:center\"><img loading=\"lazy\" src=\"https:\/\/www.agtech.co.jp\/blog\/wp-content\/uploads\/2020\/08\/kokubankaku_0I9A2307_TP_V4.jpg\" alt=\"\" width=\"500\" height=\"333\" class=\"alignnone size-full wp-image-2374\" srcset=\"https:\/\/www.agtech.co.jp\/blog\/wp-content\/uploads\/2020\/08\/kokubankaku_0I9A2307_TP_V4.jpg 800w, https:\/\/www.agtech.co.jp\/blog\/wp-content\/uploads\/2020\/08\/kokubankaku_0I9A2307_TP_V4-300x200.jpg 300w, https:\/\/www.agtech.co.jp\/blog\/wp-content\/uploads\/2020\/08\/kokubankaku_0I9A2307_TP_V4-768x512.jpg 768w\" sizes=\"(max-width: 500px) 100vw, 500px\" \/><\/p>\r\n\r\n\r\n<p>Actian Zen \u3092\u3082\u3063\u3068\u3082\u9ad8\u901f\u306b\u6d3b\u7528\u3059\u308b\u305f\u3081\u306b\u3001Zen \u306e\u30cd\u30a4\u30c6\u30a3\u30d6 API \u3067\u3042\u308b Btrieve 2 API \u3092 Node.js \u304b\u3089\u547c\u3073\u51fa\u3059\u65b9\u6cd5\u306b\u3064\u3044\u3066\u89e3\u8aac\u3057\u307e\u3059\u3002<\/p>\r\n\r\n<h2>\u306f\u3058\u3081\u306b<\/h2>\r\n\r\n<p>Node.js \u3092\u4f7f\u7528\u3059\u308c\u3070\u30b5\u30fc\u30d0\u30fc\u30b5\u30a4\u30c9\u3067\u3082 Javascript \u3092\u4f7f\u7528\u3057\u3066\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u4f5c\u6210\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 <\/p>\r\n\r\n\r\n<p>Actian Zen \u3092Node.js \u304b\u3089\u4f7f\u7528\u3059\u308b\u6700\u3082\u7c21\u5358\u306a\u65b9\u6cd5\u306f\u3001\u3053\u3061\u3089\u306e <a href=\"\/actian\/faq\/13-201012\/\" target=\"_blank\" rel=\"noopener noreferrer\">FAQ<\/a> \u306e\u3088\u3046\u306b ODBC \u7d4c\u7531\u3067 SQL \u3092\u4f7f\u7528\u3057\u3066\u30a2\u30af\u30bb\u30b9\u3059\u308b\u4e8b\u3067\u3059\u3002<\/p>\r\n\r\n\r\n<p>\u3057\u304b\u3057\u306a\u304c\u3089\u3001Actian Zen \u306e\u5927\u304d\u306a\u7279\u5fb4\u3067\u3042\u308b\u9ad8\u901f\u6027\u3092\u30d5\u30eb\u6d3b\u7528\u3059\u308b\u305f\u3081\u306b\u306f\u3001\u6a19\u6e96 SQL \u3092\u5229\u7528\u3059\u308b\u3088\u308a\u3082 Zen \u306e\u30cd\u30a4\u30c6\u30a3\u30d6 API \u3067\u3042\u308b Btrieve 2 API \u3092\u547c\u3073\u51fa\u3057\u305f\u65b9\u304c\u6709\u5229\u3067\u3059\u3002Btrieve 2 API \u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u3067\u3001Node.js \u3067\u3082 \u3088\u308a\u9ad8\u901f\u306a\u30c7\u30fc\u30bf\u30a2\u30af\u30bb\u30b9\u6027\u80fd\u3092\u5f97\u308b\u3053\u3068\u304c\u51fa\u6765\u307e\u3059\u3002<\/p>\r\n\r\n\r\n<p>Btrieve 2 API \u306f C\/C++ \u5411\u3051\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u3067\u69cb\u6210\u3055\u308c\u3066\u3044\u307e\u3059\u304c\u3001Actian \u793e\u306f SWIG (Simplified Wrapper and Interface Generator) \u306e\u5b9a\u7fa9\u30d5\u30a1\u30a4\u30eb\u3092\u63d0\u4f9b\u3057\u3066\u3044\u308b\u306e\u3067\u3001\u4ed6\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u8a00\u8a9e\u3084\u3001\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u8a00\u8a9e\u304b\u3089\u3082 Btrieve 2 API \u3092\u5229\u7528\u3059\u308b\u4e8b\u304c\u53ef\u80fd\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\r\n\r\n\r\n<p>Node.js \u304b\u3089 Btrieve 2 API \u3092\u5229\u7528\u3059\u308b\u305f\u3081\u306b\u306f\u3001\u307e\u305a Node.js \u7528\u306e Btrieve 2 API \u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u7528\u610f\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\r\n\r\n\r\n<p><img loading=\"lazy\" src=\"https:\/\/www.agtech.co.jp\/blog\/wp-content\/uploads\/2020\/08\/014_modules.png\" alt=\"\" width=\"800\" height=\"313\" class=\"alignnone size-full wp-image-2337\" srcset=\"https:\/\/www.agtech.co.jp\/blog\/wp-content\/uploads\/2020\/08\/014_modules.png 1114w, https:\/\/www.agtech.co.jp\/blog\/wp-content\/uploads\/2020\/08\/014_modules-300x117.png 300w, https:\/\/www.agtech.co.jp\/blog\/wp-content\/uploads\/2020\/08\/014_modules-1024x401.png 1024w, https:\/\/www.agtech.co.jp\/blog\/wp-content\/uploads\/2020\/08\/014_modules-768x301.png 768w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/p>\r\n\r\n<p style=\"text-align: center;\">\u5404\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u95a2\u9023\u56f3<\/p>\r\n\r\n\r\n<p>\u5f53\u8a18\u4e8b\u3067\u306f\u3001Node.js \u306e\u30cd\u30a4\u30c6\u30a3\u30d6\u30a2\u30c9\u30aa\u30f3\u306e\u4f5c\u6210\u65b9\u6cd5\u3068\u3001\u7c21\u5358\u306a Btrieve 2 API \u547c\u3073\u51fa\u3057\u30b5\u30f3\u30d7\u30eb\u3092\u3054\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\r\n\r\n\r\n<p>\u306a\u304a\u4eca\u56de\u306f\u3001x64\u7248 CentOS 7.4 \u53ca\u3073 Ubuntu 18.04.4 LTS \u3092\u4f7f\u7528\u3057\u3066\u4f5c\u696d\u306e\u8aac\u660e\u3092\u884c\u3063\u3066\u3044\u307e\u3059\u3002 \u305d\u308c\u305e\u308c\u3067\u30b3\u30de\u30f3\u30c9\u64cd\u4f5c\u304c\u7570\u306a\u308b\u5834\u5408\u306b\u306f\u660e\u793a\u3057\u3066\u3044\u307e\u3059\u304c\u3001\u7279\u306b\u533a\u5225\u304c\u306a\u3044\u5834\u5408\u306f\u3001\u4e21\u8005\u5171\u901a\u306e\u30b3\u30de\u30f3\u30c9\u5165\u529b\u3068\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\r\n\r\n\r\n<p>\u4ee5\u4e0b\u306e\u4f5c\u696d\u3067\u306f\u3001\u624b\u6301\u3061\u306e PC \u306b\u30c7\u30e2\u74b0\u5883\u3092\u69cb\u7bc9\u3057\u3001Btrieve \u306e\u547c\u3073\u51fa\u3057\u3092\u884c\u3046\u7c21\u5358\u306a\u30b5\u30f3\u30d7\u30eb Javascript \u30d7\u30ed\u30b0\u30e9\u30e0 \u201c<strong>bcreate_insert_read_sample2.js<\/strong>\u201d \u3092\u52d5\u304b\u3057\u307e\u3059\u3002 <\/p>\r\n\r\n\r\n<p>\u203b<strong>bcreate_insert_read_sample2.js<\/strong> \u306f\u3001<a href=\"https:\/\/s3-ap-northeast-1.amazonaws.com\/agtech.co.jp\/download\/sample\/bcreate_insert_read_sample2.zip\">\u3053\u3053\u304b\u3089\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9<\/a>\u3067\u304d\u307e\u3059\u3002<\/p>\r\n\r\n<p>\u3053\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u306f\u3001\u6b21\u306e\u51e6\u7406\u3092\u884c\u3044\u307e\u3059\u3002<\/p>\r\n\r\n\r\n<p>\r\n<table width=\"100%\">\r\n\t<tr>\r\n\t\t<td>\r\n\t\t\t<ul>\r\n\t\t\t\t<li>1\u30ec\u30b3\u30fc\u30c910\u30d0\u30a4\u30c8\uff08AUTOTIMESTAMP\u578b8\u30d0\u30a4\u30c8\uff0bUInt16\u578b\u306e\u6570\u50242\u30d0\u30a4\u30c8\uff09\u3067\u69cb\u6210\u3055\u308c\u308b\u30c7\u30fc\u30bf\u3092\u683c\u7d0d\u3067\u304d\u308bBtrieve\u30c7\u30fc\u30bf\u30d5\u30a1\u30a4\u30eb\u3092\u751f\u6210\u3057\u307e\u3059\u3002<\/li>\r\n\t\t\t\t<li>AUTOTIMESTAMP\u578b8\u30d0\u30a4\u30c8\u306e\u30d5\u30a3\u30fc\u30eb\u30c9\u306f\u3001\u691c\u7d22\u306e\u305f\u3081\u306b\u30ad\u30fc\uff08\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\uff09\u3092\u8a2d\u5b9a\u3057\u307e\u3059\u3002<\/li>\r\n\t\t\t\t<li>\u30eb\u30fc\u30d7\u51e6\u7406\u30671\uff5e10000\u307e\u3067\u306e1\u4e07\u4ef6\u306e\u30c7\u30fc\u30bf\u3092\u30d5\u30a1\u30a4\u30eb\u306b\u66f8\u304d\u8fbc\u307f\u307e\u3059\u3002<\/li>\r\n\t\t\t\t<li>200\u4ef6\u76ee\u306e\u30c7\u30fc\u30bf\u304c\u66f8\u304d\u3053\u307e\u308c\u305f\u6642\u70b9\u306eAUTOTIMESTAMP\u578b8\u30d0\u30a4\u30c8\u306e\u5024\u3092\u3001\u5f8c\u306e\u691c\u7d22\u6761\u4ef6\u306b\u4f7f\u7528\u3059\u308b\u305f\u3081\u306b\u4fdd\u5b58\u3057\u307e\u3059\u3002<\/li>\r\n\t\t\t\t<li>\u30c7\u30fc\u30bf\u30d5\u30a1\u30a4\u30eb\u304b\u3089\u6700\u5f8c\u306b\u66f8\u304d\u8fbc\u307f\u306e\u3042\u3063\u305f\u30ec\u30b3\u30fc\u30c9\u3092\u62bd\u51fa\u3057\u3001\u8a18\u9332\u3055\u308c\u3066\u3044\u308b\u5024\u3092\u8868\u793a\u3057\u307e\u3059\u3002<\/li>\r\n\t\t\t\t<li>\u30eb\u30fc\u30d7\u5185\u3067\u4fdd\u5b58\u3057\u305f\u30bf\u30a4\u30e0\u30b9\u30bf\u30f3\u30d7\u5024\u3092\u4f7f\u7528\u3057\u3066\u3001\u8a72\u5f53\u306e\u5024\u3092\u6301\u3064\u30ec\u30b3\u30fc\u30c9\u3092\u62bd\u51fa\u3057\u307e\u3059\u3002<\/li>\r\n\t\t\t<\/ul>\r\n\t\t<\/td>\r\n\t<\/tr>\r\n<\/table>\r\n<\/p>\r\n\r\n\r\n<p><img loading=\"lazy\" src=\"https:\/\/www.agtech.co.jp\/blog\/wp-content\/uploads\/2020\/08\/014_sample_data_structure.png\" alt=\"\" width=\"800\" height=\"308\" class=\"alignnone size-full wp-image-2355\" srcset=\"https:\/\/www.agtech.co.jp\/blog\/wp-content\/uploads\/2020\/08\/014_sample_data_structure.png 1105w, https:\/\/www.agtech.co.jp\/blog\/wp-content\/uploads\/2020\/08\/014_sample_data_structure-300x115.png 300w, https:\/\/www.agtech.co.jp\/blog\/wp-content\/uploads\/2020\/08\/014_sample_data_structure-1024x394.png 1024w, https:\/\/www.agtech.co.jp\/blog\/wp-content\/uploads\/2020\/08\/014_sample_data_structure-768x295.png 768w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/p>\r\n\r\n<p style=\"text-align: center;\">\u30b5\u30f3\u30d7\u30eb\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u69cb\u9020<\/p>\r\n\r\n<h2>1. node-gyp \u306b\u3064\u3044\u3066<\/h2>\r\n\r\n<p>Node.js \u306f\u69d8\u3005\u306a\u30d7\u30e9\u30c3\u30c8\u30d5\u30a9\u30fc\u30e0\u3067\u52d5\u4f5c\u3059\u308b\u305f\u3081\u3001Btrieve 2 API \u306e\u3088\u3046\u306a\u30d7\u30e9\u30c3\u30c8\u30d5\u30a9\u30fc\u30e0\u56fa\u6709\u306e\u6a5f\u80fd\u3082\u3001\u305d\u308c\u305e\u308c\u306e\u74b0\u5883\u306b\u5408\u308f\u305b\u305f\u300c\u30cd\u30a4\u30c6\u30a3\u30d6\u30a2\u30c9\u30aa\u30f3\u300d\u3092\u7528\u610f\u3057\u3066\u30a2\u30af\u30bb\u30b9\u3057\u307e\u3059\u3002<\/p>\r\n\r\n\r\n<p>node-gyp \u306f\u3001Node.js \u7528\u306e\u30cd\u30a4\u30c6\u30a3\u30d6\u30a2\u30c9\u30aa\u30f3\u3092\u30d3\u30eb\u30c9\u3059\u308b\u305f\u3081\u306e\u30c4\u30fc\u30eb\u3067\u3059\u3002<\/p>\r\n\r\n\r\n<p>\u516c\u5f0f\u30da\u30fc\u30b8<br \/>\r\n<a href=\"https:\/\/github.com\/nodejs\/node-gyp\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/github.com\/nodejs\/node-gyp<\/a><\/p>\r\n\r\n\r\n<p>\u5c0e\u5165\u65b9\u6cd5\u306b\u95a2\u3057\u3066\u306f\u3001\u5f8c\u307b\u3069\u8aac\u660e\u3057\u307e\u3059\u3002<\/p>\r\n\r\n\r\n<p>\u203b node-gyp \u3092\u52d5\u304b\u3059\u305f\u3081\u306b\u306f \u305d\u306e\u4ed6\u306b Python3\u3001C++\u3001\u304a\u3088\u3073 make \u304c\u5fc5\u8981\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\r\n\r\n<h2>2. Node.js\u30a2\u30c9\u30aa\u30f3\u4f5c\u6210\u624b\u9806<\/h2>\r\n\r\n<p>Node.js\u30a2\u30c9\u30aa\u30f3\u4f5c\u6210\u306e\u57fa\u672c\u7684\u306a\u624b\u9806\u3068\u3057\u3066\u306f\u3001<\/p>\r\n\r\n<ol>\r\n\t<li>node-gyp\uff08\u305d\u306e\u4ed6\u5fc5\u8981\u3068\u306a\u308b\u30c4\u30fc\u30eb\u985e\uff09\u3092\u30b7\u30b9\u30c6\u30e0\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b<\/li>\r\n\t<li>node-gyp configure \u3092\u5b9f\u884c\u3059\u308b<br \/>\r\n\t\t\u2192 \u30a2\u30c9\u30aa\u30f3\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e \u30d3\u30eb\u30c9\u7528\u30d5\u30a1\u30a4\u30eb(makefile\u7b49\uff09\u304c\u751f\u6210\u3055\u308c\u308b<\/li>\r\n\t<li>node-gyp build \u3092\u5b9f\u884c\u3057\u30a2\u30c9\u30aa\u30f3\u3092\u30d3\u30eb\u30c9\u3059\u308b<\/li>\r\n\t<li>Node.js \u3067 Btrieve 2 API \u3092\u5229\u7528\u3057\u305f\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u4f5c\u6210\u3059\u308b<\/li>\r\n<\/ol>\r\n\r\n<p>\u3068\u3044\u3046\u6d41\u308c\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\r\n\r\n\r\n<p>\u305d\u308c\u3067\u306f\u3001\u5b9f\u969b\u306b\u74b0\u5883\u3092\u69cb\u7bc9\u3057\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\r\n\r\n<h2>3. \u74b0\u5883\u69cb\u7bc9<\/h2>\r\n\r\n<p>\u6700\u521d\u306bOS\u306e\u74b0\u5883\u3092\u6700\u65b0\u306b\u3057\u307e\u3059\u3002<br \/>\r\n\uff08\u3053\u308c\u3092\u3057\u3066\u304a\u304b\u306a\u3044\u3068\u5404\u7a2e\u30d1\u30c3\u30b1\u30fc\u30b8\u304c\u6b63\u5e38\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3067\u304d\u306a\u3044\u5834\u5408\u304c\u3042\u308a\u307e\u3059\uff09<\/p>\r\n\r\n\r\n<p>CentOS:<br \/>\r\n<table style=\"width: 100%; background-color: #000000;\">\r\n\t<tr>\r\n\t\t<td><span style=\"color: #ffffff;\">\r\n\t\t\t$ sudo yum update\r\n\t\t<\/span><\/td>\r\n\t<\/tr>\r\n<\/table>\r\n<\/p>\r\n\r\n\r\n<p>Ubuntu:<br \/>\r\n<table style=\"width: 100%; background-color: #000000;\">\r\n\t<tr>\r\n\t\t<td><span style=\"color: #ffffff;\">\r\n\t\t\t$ sudo apt update<br \/>\r\n\t\t\t$ sudo apt upgrade\r\n\t\t<\/span><\/td>\r\n\t<\/tr>\r\n<\/table>\r\n<\/p>\r\n\r\n\r\n<p>\u6b21\u306b\u3001Zen \u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002<br \/>  \r\n\u3053\u3053\u3067\u306f\u30e6\u30fc\u30b6\u30fc &#8220;test&#8221; \u3092\u4f7f\u7528\u3057\u3066\u8aac\u660e\u3057\u307e\u3059\u3002\u307e\u305f\u3001\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u7528\u30d5\u30a1\u30a4\u30eb\u306f \/home\/test\/ \u306b\u3042\u308b\u3068\u4eee\u5b9a\u3057\u3066\u3044\u307e\u3059\u3002 <br \/> \r\n(\u30d5\u30a1\u30a4\u30eb\u540d\u306f\u3001\u3054\u5165\u624b\u3044\u305f\u3060\u3044\u305f\u5b9f\u969b\u306e\u30d5\u30a1\u30a4\u30eb\u540d\u306b\u7f6e\u304d\u63db\u3048\u3066\u8aad\u307f\u9032\u3093\u3067\u304f\u3060\u3055\u3044)<\/p>\r\n\r\n\r\n<p>\r\n<table style=\"width: 100%; background-color: #000000;\">\r\n\t<tr>\r\n\t\t<td><span style=\"color: #ffffff;\">\r\n\t\t\t$ sudo su<br \/>\r\n\t\t\t# cd \/usr\/local<br \/>\r\n\t\t\t# tar -zxf \/home\/test\/Zen-EnterpriseServer-jajp-linux-x86_64-14.11.014.000.tar.gz<br \/>\r\n\t\t\t# cd actianzen\/etc<br \/>\r\n\t\t\t# .\/preinstall.sh<br \/>\r\n\t\t\t# .\/postinstall.sh<br \/>\r\n\t\t<\/span><\/td>\r\n\t<\/tr>\r\n<\/table>\r\n<\/p>\r\n\r\n\r\n<p>\u5ff5\u306e\u305f\u3081\u6b21\u306e\u30b3\u30de\u30f3\u30c9\u3067\u52d5\u4f5c\u3092\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002<br \/>\r\nZen \u30a8\u30f3\u30b8\u30f3\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u60c5\u5831\u304c\u8868\u793a\u3055\u308c\u308c\u3070 \u30a8\u30f3\u30b8\u30f3\u306f\u52d5\u4f5c\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\r\n\r\n\r\n<p>\r\n<table style=\"width: 100%; background-color: #000000;\">\r\n\t<tr>\r\n\t\t<td><span style=\"color: #ffffff;\">\r\n\t\t\t# su zen-svc<br \/>\r\n\t\t\t$ isql demodata<br \/>\r\n\t\t\tSQL> select @@version<br \/>\r\n\t\t\tSQL> quit<br \/>\r\n\t\t\t$ exit<br \/>\r\n\t\t<\/span><\/td>\r\n\t<\/tr>\r\n<\/table>\r\n<\/p>\r\n\r\n<h2>4. Node.js \u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h2>\r\n\r\n<p>\u7d9a\u3044\u3066 Node.js \u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002<\/p>\r\n\r\n\r\n<p>CentOS:<br \/>\r\n<table style=\"width: 100%; background-color: #000000;\">\r\n\t<tr>\r\n\t\t<td><span style=\"color: #ffffff;\">\r\n\t\t\t# curl -sL https:\/\/rpm.nodesource.com\/setup_10.x | bash &#8211;<br \/>\r\n\t\t\t# yum remove -y nodejs npm<br \/>\r\n\t\t\t# yum install -y nodejs<br \/>\r\n\t\t\t# node -v\r\n\t\t<\/span><\/td>\r\n\t<\/tr>\r\n<\/table>\r\n<\/p>\r\n\r\n\r\n<p>\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u305f node.js \u304c\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u8fd4\u305b\u3070\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3067\u304d\u3066\u3044\u307e\u3059\u3002<br \/>\r\n(\u3053\u3061\u3089\u306e\u74b0\u5883\u3067\u306f v10.21.0 \u304c\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u307e\u3057\u305f)<\/p>\r\n\r\n\r\n<p>Ubuntu\u306e\u5834\u5408\u306f\u3001\u6b21\u306e\u901a\u308a\u3067\u3059\u3002<\/p>\r\n\r\n\r\n<p>Ubuntu:<br \/>\r\n<table style=\"width: 100%; background-color: #000000;\">\r\n\t<tr>\r\n\t\t<td><span style=\"color: #ffffff;\">\r\n\t\t\t# apt install nodejs<br \/>\r\n\t\t\t# node -v\r\n\t\t<\/span><\/td>\r\n\t<\/tr>\r\n<\/table>\r\n<\/p>\r\n\r\n\r\n<p>(\u3053\u3061\u3089\u306e\u74b0\u5883\u3067\u306f v8.10.0 \u304c\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u307e\u3057\u305f)<\/p>\r\n\r\n<h2>5. \u30b5\u30f3\u30d7\u30eb\u7528\u30d5\u30a9\u30eb\u30c0\u306e\u4f5c\u6210<\/h2>\r\n\r\n<p>\u30b5\u30f3\u30d7\u30eb\u306e\u4f5c\u696d\u7528\u3068\u3057\u3066 ActianZen \u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u7528\u610f\u3057\u3001\u305d\u306e\u4e2d\u306b Swig4\u3001Demo \u306e2\u3064\u306e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\r\n\r\n\r\n<p>\r\n<table style=\"width: 100%; background-color: #000000;\">\r\n\t<tr>\r\n\t\t<td><span style=\"color: #ffffff;\">\r\n\t\t\t# exit<br \/>\r\n\t\t\t$ cd \/home\/test<br \/>\r\n\t\t\t$ mkdir ActianZen<br \/>\r\n\t\t\t$ cd ActianZen<br \/>\r\n\t\t\t$ mkdir Swig4<br \/>\r\n\t\t\t$ mkdir Demo\r\n\t\t<\/span><\/td>\r\n\t<\/tr>\r\n<\/table>\r\n<\/p>\r\n\r\n\r\n<p>\u305d\u308c\u305e\u308c\u306e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u30d5\u30a1\u30a4\u30eb\u3092\u914d\u7f6e\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\r\n\r\n<h2>6. SWIG \u306e\u5c0e\u5165<\/h2>\r\n\r\n<p>C\/C++ \u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u3067\u3042\u308b Btrieve 2 API \u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u3092 Javascript \u304b\u3089\u547c\u3073\u51fa\u305b\u308b\u3088\u3046\u3001\u30e9\u30c3\u30d1\u30fc\u30e9\u30a4\u30d6\u30e9\u30ea\u3092 swig \u3092\u4f7f\u3063\u3066\u751f\u6210\u3057\u307e\u3059\u3002<\/p>\r\n\r\n\r\n<p>swig \u672c\u4f53\u306f\u3001 <a href=\"http:\/\/www.swig.org\/\" target=\"_blank\" rel=\"noopener noreferrer\">http:\/\/www.swig.org\/<\/a> \u304b\u3089\u6700\u65b0\u306e \u30bd\u30fc\u30b9\u30d5\u30a1\u30a4\u30eb\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u3066\u304f\u3060\u3055\u3044\u3002<br \/>\r\n(Download -> Download Area -> The Latest Release \u306e swig-4.0.2 \u304b\u3089\u5165\u624b\u3067\u304d\u307e\u3059)  <\/p>\r\n\r\n\r\n<p>\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u305fswig-4.0.2.tar.gz \u306f\u3001Swig4 \u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u30b3\u30d4\u30fc\u3057\u3066\u304a\u304d\u307e\u3059\u3002<br \/>\r\n\u6b21\u306b\u3001swig \u306e\u30bd\u30fc\u30b9\u30d5\u30a1\u30a4\u30eb\u3092\u5c55\u958b\u3057\u307e\u3059\u3002<\/p>\r\n\r\n\r\n<p>\r\n<table style=\"width: 100%; background-color: #000000;\">\r\n\t<tr>\r\n\t\t<td><span style=\"color: #ffffff;\">\r\n\t\t\t$ cd \/home\/test\/ActianZen\/Swig4<br \/>\r\n\t\t\t$ tar -zxf swig-4.0.2.tar.gz<br \/>\r\n\t\t\t$ cd swig-4.0.2\r\n\t\t<\/span><\/td>\r\n\t<\/tr>\r\n<\/table>\r\n<\/p>\r\n\r\n\r\n\r\n<p>\u65e2\u306b\u74b0\u5883\u306b\u53e4\u3044\u30d0\u30fc\u30b8\u30e7\u30f3\u306e swig \u304c\u5c0e\u5165\u3055\u308c\u3066\u3044\u308b\u5834\u5408\u304c\u3042\u308b\u306e\u3067\u3001\u5ff5\u306e\u305f\u3081\u6b21\u306e\u30b3\u30de\u30f3\u30c9\u3067\u524a\u9664\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\r\n\r\n\r\n<p>CentOS:<br \/>\r\n<table style=\"width: 100%; background-color: #000000;\">\r\n\t<tr>\r\n\t\t<td><span style=\"color: #ffffff;\">\r\n\t\t\t$ sudo yum erase swig\r\n\t\t<\/span><\/td>\r\n\t<\/tr>\r\n<\/table>\r\n<\/p>\r\n\r\n\r\n<p>Ubuntu:<br \/>\r\n<table style=\"width: 100%; background-color: #000000;\">\r\n\t<tr>\r\n\t\t<td><span style=\"color: #ffffff;\">\r\n\t\t\t$ sudo apt remove swig\r\n\t\t<\/span><\/td>\r\n\t<\/tr>\r\n<\/table>\r\n<\/p>\r\n\r\n\r\n<p>swig \u306e\u52d5\u4f5c\u306b\u5fc5\u8981\u3068\u306a\u308b php\u3001python3 \u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002<\/p>\r\n\r\n\r\n<p>CentOS:<br \/>\r\n<table style=\"width: 100%; background-color: #000000;\">\r\n\t<tr>\r\n\t\t<td><span style=\"color: #ffffff;\">\r\n\t\t\t$ sudo yum install -y php<br \/>\r\n\t\t\t$ sudo yum install -y python3\r\n\t\t<\/span><\/td>\r\n\t<\/tr>\r\n<\/table>\r\n<\/p>\r\n\r\n\r\n<p>Ubuntu:<br \/>\r\n<table style=\"width: 100%; background-color: #000000;\">\r\n\t<tr>\r\n\t\t<td><span style=\"color: #ffffff;\">\r\n\t\t\t$ sudo apt install php-dev<br \/>\r\n\t\t\t$ sudo apt install python3-dev\r\n\t\t<\/span><\/td>\r\n\t<\/tr>\r\n<\/table>\r\n<\/p>\r\n\r\n\r\n<p>\u74b0\u5883\u306b\u5408\u308f\u305b\u305f\u8a2d\u5b9a\u3092\u884c\u3044\u3001make \u3092\u5b9f\u884c\u5f8c\u3001\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002<br \/>\r\n<table style=\"width: 100%; background-color: #000000;\">\r\n\t<tr>\r\n\t\t<td><span style=\"color: #ffffff;\">\r\n\t\t\t$ .\/configure &#8211;without-python &#8211;without-perl5 &#8211;with-php<br \/>\r\n\t\t\t$ make -j4<br \/>\r\n\t\t\t$ sudo make install<br \/>\r\n\t\t\t$ swig -version\r\n\t\t<\/span><\/td>\r\n\t<\/tr>\r\n<\/table>\r\n<\/p>\r\n\r\n\r\n<p>\u30d0\u30fc\u30b8\u30e7\u30f3\u60c5\u5831\u304c\u8868\u793a\u3055\u308c\u308c\u3070\u6210\u529f\u3067\u3059\u3002<\/p>\r\n\r\n<h2>7. \u30cd\u30a4\u30c6\u30a3\u30d6\u30a2\u30c9\u30aa\u30f3\u306e\u30b3\u30f3\u30d1\u30a4\u30eb<\/h2>\r\n\r\n<p>swig \u306e\u6e96\u5099\u304c\u3067\u304d\u305f\u306e\u3067\u3001Node.js \u7528\u306e\u30cd\u30a4\u30c6\u30a3\u30d6\u30a2\u30c9\u30aa\u30f3\u306e\u30b3\u30f3\u30d1\u30a4\u30eb\u3057\u307e\u3059\u3002<\/p>\r\n\r\n<p>\u307e\u305a\u306f\u3001Btrieve 2 API \u306e SDK \u30d5\u30a1\u30a4\u30eb\u3092\u5c55\u958b\u3057\u307e\u3059\u3002<br \/>\r\n\u3053\u3053\u3067\u306f Zen-SDK-Btrieve2API-linux-noarch-14.11.014.000.tar.gz \u306f ActianZen\/Demo \u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u7f6e\u304b\u308c\u3066\u3044\u308b\u3082\u306e\u3068\u3057\u307e\u3059\u3002<br \/>\r\n<table style=\"width: 100%; background-color: #000000;\">\r\n\t<tr>\r\n\t\t<td><span style=\"color: #ffffff;\">\r\n\t\t\t$ cd \/home\/test\/ActianZen\/Demo<br \/>\r\n\t\t\t$ tar -zxf Zen-SDK-Btrieve2API-linux-noarch-14.11.014.000.tar.gz<br \/>\r\n\t\t\t$ cd Zen-SDK-Btrieve2API-000-linux-noarch-14.11.014\/swig\/btrieveJavascript\r\n\t\t<\/span><\/td>\r\n\t<\/tr>\r\n<\/table>\r\n<\/p>\r\n\r\n\r\n<p>Btrieve 2 API \u306e\u30e9\u30c3\u30d1\u30fc\u30d5\u30a1\u30a4\u30eb\u3092swig\u3067\u751f\u6210\u3057\u307e\u3059\u3002<br \/>\r\n\uff08btrieveJavascript_wrap.cxx\u30d5\u30a1\u30a4\u30eb\u304c\u4f5c\u6210\u3055\u308c\u307e\u3059\uff09<br \/>\r\n<table style=\"width: 100%; background-color: #000000;\">\r\n\t<tr>\r\n\t\t<td><span style=\"color: #ffffff;\">\r\n\t\t\t$ swig -javascript -node -I..\/..\/include -c++ btrieveJavascript.swig\r\n\t\t<\/span><\/td>\r\n\t<\/tr>\r\n<\/table>\r\n<\/p>\r\n\r\n\r\n<p>\u6700\u5f8c\u306b Node.js \u306e\u30cd\u30a4\u30c6\u30a3\u30d6\u30a2\u30c9\u30aa\u30f3\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002 <\/p>\r\n\r\n\r\n<p>\u30a2\u30c9\u30aa\u30f3\u4f5c\u6210\u306e\u30c4\u30fc\u30eb\u3067\u3042\u308b node-gyp \u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002<\/p>\r\n\r\n\r\n<p>CentOS:<br \/>\r\n<table style=\"width: 100%; background-color: #000000;\">\r\n\t<tr>\r\n\t\t<td><span style=\"color: #ffffff;\">\r\n\t\t\t$ sudo npm install -g node-gyp\r\n\t\t<\/span><\/td>\r\n\t<\/tr>\r\n<\/table>\r\n<\/p>\r\n\r\n\r\n<p>Ubuntu:<br \/>\r\n<table style=\"width: 100%; background-color: #000000;\">\r\n\t<tr>\r\n\t\t<td><span style=\"color: #ffffff;\">\r\n\t\t\t$ sudo apt install aptitude<br \/>\r\n\t\t\t$ sudo aptitude install node-gyp\r\n\r\n\t\t<\/span><\/td>\r\n\t<\/tr>\r\n<\/table>\r\n<\/p>\r\n\r\n\r\n<p>\u3053\u308c\u3067 node-gyp \u304c\u6e96\u5099\u3067\u304d\u305f\u306e\u3067 Node.js \u306e\u30cd\u30a4\u30c6\u30a3\u30d6\u30a2\u30c9\u30aa\u30f3\u306e\u4f5c\u6210\u6e96\u5099\u304c\u6574\u3044\u307e\u3057\u305f\u3002<br \/>\r\n<table style=\"width: 100%; background-color: #000000;\">\r\n\t<tr>\r\n\t\t<td><span style=\"color: #ffffff;\">\r\n\t\t\t$ node-gyp configure<br \/>\r\n\t\t\t$ node-gyp build\r\n\t\t<\/span><\/td>\r\n\t<\/tr>\r\n<\/table>\r\n<\/p>\r\n\r\n<h2>8. \u30b5\u30f3\u30d7\u30eb\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u5b9f\u884c<\/h2>\r\n\r\n<p>\u30d5\u30a9\u30eb\u30c0\u306b\u30a2\u30af\u30bb\u30b9\u3092\u4e0e\u3048\u307e\u3059\u3002<br \/>\r\n\u307e\u305f\u3001Zen\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u306b\u3082\u30d1\u30b9\u3092\u6307\u5b9a\u3057\u3066\u304a\u304d\u307e\u3059\u3002<\/p>\r\n\r\n\r\n<p>\r\n<table style=\"width: 100%; background-color: #000000;\">\r\n\t<tr>\r\n\t\t<td><span style=\"color: #ffffff;\">\r\n\t\t\t$ chmod a+rwx .<br \/>\r\n\t\t\t$ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:\/usr\/local\/actianzen\/lib64\r\n\t\t<\/span><\/td>\r\n\t<\/tr>\r\n<\/table>\r\n<\/p>\r\n\r\n\r\n<p>\u30b5\u30f3\u30d7\u30eb bcreate_insert_read_sample2.js \u3092\u73fe\u5728\u306e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea<br \/>\r\n\/home\/test\/ActianZen\/BtrieveJavascript\/Zen-SDK-Btrieve2API-000-linux-noarch-14.11.014\/swig\/btrieveJavascript<br \/>\r\n\u306b\u30b3\u30d4\u30fc\u3057\u307e\u3059\u3002<\/p>\r\n\r\n\r\n<p>\u30b5\u30f3\u30d7\u30eb\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002<br \/>\r\n<table style=\"width: 100%; background-color: #000000;\">\r\n\t<tr>\r\n\t\t<td><span style=\"color: #ffffff;\">\r\n\t\t\t$ node bcreate_insert_read_sample2.js\r\n\t\t<\/span><\/td>\r\n\t<\/tr>\r\n<\/table>\r\n<\/p>\r\n\r\n\r\n<p>\u30c7\u30fc\u30bf\u30d5\u30a1\u30a4\u30eb\u304c\u4f5c\u6210\u3055\u308c\u308b\u5834\u6240\u306f\u3001\u30b9\u30af\u30ea\u30d7\u30c8\u306e\u5148\u982d\u3067\u6b21\u306e\u3088\u3046\u306b\u5b9a\u7fa9\u3055\u308c\u3066\u3044\u307e\u3059\u3002<br \/>\r\n<table style=\"width: 100%; background-color: #000000;\">\r\n\t<tr>\r\n\t\t<td><span style=\"color: #ffffff;\">\r\n\t\t\tbtrieveFileName = &#8220;\/usr\/local\/actianzen\/data\/test_cr_ins_read.btr&#8221;\r\n\t\t<\/span><\/td>\r\n\t<\/tr>\r\n<\/table>\r\n<\/p>\r\n\r\n\r\n<p>\u30d5\u30a1\u30a4\u30eb\u306f Zen \u30a8\u30f3\u30b8\u30f3\u304c\u8aad\u307f\u66f8\u304d\u3067\u304d\u308b\u5834\u6240\u306b\u4f5c\u6210\u3055\u308c\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<br \/>\r\n\u203b Zen \u30a8\u30f3\u30b8\u30f3\u306e\u52d5\u4f5c\u30a2\u30ab\u30a6\u30f3\u30c8\u306f\u3001\u30e6\u30fc\u30b6\u30fc\u540d zen-svc\u3001\u30b0\u30eb\u30fc\u30d7\u540d zen-data \u3067\u3059\u3002<\/p>\r\n\r\n\r\n<p>\u307e\u305f\u3001\u3053\u306e\u30b5\u30f3\u30d7\u30eb\u3067\u306f\u6700\u5f8c\u306e\u51e6\u7406\u3067\u4f5c\u6210\u3057\u305f\u30c7\u30fc\u30bf\u30d5\u30a1\u30a4\u30eb\u3092\u524a\u9664\u3059\u308b\u51e6\u7406\u304c\u542b\u307e\u308c\u3066\u3044\u307e\u3059\u304c\u3001\u4f5c\u6210\u3055\u308c\u305f\u30c7\u30fc\u30bf\u3092\u78ba\u8a8d\u3059\u308b\u305f\u3081\u306b\u3001\u524a\u9664\u51e6\u7406\u306f\u30b3\u30e1\u30f3\u30c8\u30a2\u30a6\u30c8\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\r\n\r\n\r\n<p>\u4f5c\u6210\u3055\u308c\u305fBtrieve\u30d5\u30a1\u30a4\u30eb\u3092Windows \u74b0\u5883\u306b\u30b3\u30d4\u30fc\u3057\u3066 Function Executor \u7b49\u306e Zen \u4ed8\u5c5e\u30c4\u30fc\u30eb\u3067\u66f8\u304d\u8fbc\u307e\u308c\u305f\u5185\u5bb9\u3092\u3054\u78ba\u8a8d\u304f\u3060\u3055\u3044\u3002<\/p>","protected":false},"excerpt":{"rendered":"Actian Zen \u3092\u3082\u3063\u3068\u3082\u9ad8\u901f\u306b\u6d3b\u7528\u3059\u308b\u305f\u3081\u306b\u3001Zen \u306e\u30cd\u30a4\u30c6\u30a3\u30d6 API \u3067\u3042\u308b Btrieve 2 API \u3092 Node.js \u304b\u3089\u547c\u3073\u51fa\u3059\u65b9\u6cd5\u306b\u3064\u3044\u3066\u89e3\u8aac\u3057\u307e\u3059\u3002 \u306f\u3058\u3081\u306b Node.js \u3092\u4f7f\u7528\u3059\u308c\u3070\u30b5\u30fc [&hellip;]","protected":false},"author":1,"featured_media":2374,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"product":[58,81,76],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.agtech.co.jp\/blog\/wp-json\/wp\/v2\/posts\/2335"}],"collection":[{"href":"https:\/\/www.agtech.co.jp\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.agtech.co.jp\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.agtech.co.jp\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.agtech.co.jp\/blog\/wp-json\/wp\/v2\/comments?post=2335"}],"version-history":[{"count":41,"href":"https:\/\/www.agtech.co.jp\/blog\/wp-json\/wp\/v2\/posts\/2335\/revisions"}],"predecessor-version":[{"id":7647,"href":"https:\/\/www.agtech.co.jp\/blog\/wp-json\/wp\/v2\/posts\/2335\/revisions\/7647"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.agtech.co.jp\/blog\/wp-json\/wp\/v2\/media\/2374"}],"wp:attachment":[{"href":"https:\/\/www.agtech.co.jp\/blog\/wp-json\/wp\/v2\/media?parent=2335"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.agtech.co.jp\/blog\/wp-json\/wp\/v2\/categories?post=2335"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.agtech.co.jp\/blog\/wp-json\/wp\/v2\/tags?post=2335"},{"taxonomy":"product","embeddable":true,"href":"https:\/\/www.agtech.co.jp\/blog\/wp-json\/wp\/v2\/product?post=2335"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}