{"id":2575,"date":"2019-04-01T07:16:20","date_gmt":"2019-03-31T22:16:20","guid":{"rendered":"http:\/\/kats-eye.net\/info\/?p=2575"},"modified":"2019-04-15T22:54:17","modified_gmt":"2019-04-15T13:54:17","slug":"oracle-instant-2","status":"publish","type":"post","link":"https:\/\/kats-eye.net\/info\/2019\/04\/01\/oracle-instant-2\/","title":{"rendered":"Oracle \u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u691c\u7d22\u3059\u308b"},"content":{"rendered":"<table style=\"width: 100%; border-collapse: collapse; border-style: none; height: 27px;\" border=\"1\">\n<tbody>\n<tr style=\"height: 30px; border-bottom: 3px #0000ff solid;\">\n<td style=\"width: 1.5%; border-style: none; background-color: #0000ff; height: 27px;\"><\/td>\n<td style=\"width: 2.63291%; border-style: none; height: 27px; background-color: #ffffff;\"><\/td>\n<td style=\"border-style: none; height: 27px; background-color: #ffffff; width: 96.2025%;\"><span style=\"font-family: verdana, geneva, sans-serif;\"><strong><span style=\"font-size: 18pt; color: #0000ff;\">\u6982\u8981<\/span><\/strong><\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u5148\u56de\u30aa\u30e9\u30af\u30eb\u30a4\u30f3\u30b9\u30bf\u30f3\u30c8\u3068OCI\u62e1\u5f35\u30e2\u30b8\u30e5\u30fc\u30eb\u3092CentOS\u30b5\u30fc\u30d0\u30fc\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3057\u305f\u3002\u4ed6\u306e\u30aa\u30e9\u30af\u30eb\u30b5\u30fc\u30d0\u30fc\u306e\u30c7\u30fc\u30bf\u691c\u7d22\u304c\u51fa\u6765\u308b\u69d8\u306b\u306a\u308a\u307e\u3057\u305f\u306e\u3067\u3001PHP\u3067\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u4f5c\u6210\u3057\u3066\u307f\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002\u7d50\u679c\u306f\u3001\u3068\u308a\u3042\u3048\u305aOCI\u63a5\u7d9a\uff0cPDO\u63a5\u7d9a\u3068\u3082\u7c21\u5358\u306a\u691c\u7d22\u30fb\u633f\u5165\u30fb\u66f4\u65b0\u30fb\u524a\u9664\u304c\u53ef\u80fd\u3067\u3042\u308b\u3053\u3068\u3092\u78ba\u8a8d\u51fa\u6765\u307e\u3057\u305f\u3002<\/p>\n<table style=\"width: 100%; border-collapse: collapse; border-style: none; height: 27px;\" border=\"1\">\n<tbody>\n<tr style=\"height: 30px; border-bottom: 3px #0000ff solid;\">\n<td style=\"width: 1.5%; border-style: none; background-color: #0000ff; height: 27px;\"><\/td>\n<td style=\"width: 2.63291%; border-style: none; height: 27px; background-color: #ffffff;\"><\/td>\n<td style=\"border-style: none; height: 27px; background-color: #ffffff; width: 96.2025%;\"><span style=\"font-family: verdana, geneva, sans-serif;\"><strong><span style=\"font-size: 18pt; color: #0000ff;\">\u30d7\u30ed\u30b0\u30e9\u30e0\u6982\u8981<\/span><\/strong><\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><span style=\"text-decoration: underline;\">\uff08\uff11\uff09\u69cb\u3000\u6210<\/span><br \/>\n\u69cb\u6210\u306f\u6b21\u306e\u69d8\u306a\u30a4\u30e1\u30fc\u30b8\u3067\u3059\u3002\u30ed\u30fc\u30ab\u30eb\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u4e0a\u306e\u2460Windows\u30d1\u30bd\u30b3\u30f3\u304b\u3089URL\u6307\u5b9a\u3057\u3001\u2461CentOS\uff17\u30b5\u30fc\u30d0\u30fc\u4e0a\u306ePHP\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u8d77\u52d5\u3057\u307e\u3059\u3002PHP\u30d7\u30ed\u30b0\u30e9\u30e0\u304b\u3089\u00a0 \u2462OracleDB\u306bOCI\u63a5\u7d9a\uff0cPDO\u63a5\u7d9a\u3057\u3001\u30c7\u30fc\u30bf\u691c\u7d22\u30fb\u633f\u5165\u30fb\u66f4\u65b0\u30fb\u524a\u9664\u3057\u307e\u3059\u3002\u51e6\u7406\u7d50\u679c\u3092\u8868\u51fa\u529b\u3057\u3001\u2460Windows\u30d1\u30bd\u30b3\u30f3\u306e\u30d6\u30e9\u30a6\u30b6\u4e0a\u3067\u7d50\u679c\u3092\u78ba\u8a8d\u3059\u308b\u3053\u3068\u304c\u51fa\u6765\u307e\u3059\u3002<\/p>\n<table style=\"width: 100%; border-collapse: collapse; border-style: none;\" border=\"1\">\n<tbody>\n<tr style=\"border-style: none;\">\n<td style=\"width: 2.1097%; border-style: none;\"><\/td>\n<td style=\"width: 26.0397%; background-color: #64fef7; border-style: none; text-align: center;\">\u2462OracleDB<\/td>\n<td style=\"width: 7.74562%; border-style: none; text-align: center;\">\u21d4<\/td>\n<td style=\"width: 30.1084%; background-color: #64ffea; border-style: none; text-align: center;\">\u2461CentOS7 \uff7b\uff70\uff8a\uff9e\uff70<\/td>\n<td style=\"width: 7.74562%; border-style: none; text-align: center;\">\u21d4<\/td>\n<td style=\"width: 26.7329%; background-color: #64ffff; border-style: none; text-align: center;\">\u2460WindowsPC<\/td>\n<td style=\"width: 2.1097%; border-style: none;\"><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<p><span style=\"text-decoration: underline;\">\uff08\uff12\uff09\u30d7\u30ed\u30b0\u30e9\u30e0\u6982\u8981<\/span><br \/>\nCentOS\uff17\u30b5\u30fc\u30d0\u30fc\u4e0a\u3067\u52d5\u304f\u30d7\u30ed\u30b0\u30e9\u30e0\u6982\u8981\u306b\u3064\u3044\u3066\u30e1\u30e2\u3057\u307e\u3059\u3002\u4e0b\u306e\u56f3\u306fWindows\u30d1\u30bd\u30b3\u30f3\u306e\u30d6\u30e9\u30a6\u30b6\u30fc\u4e0a\u306e\u753b\u9762\u629c\u7c8b\u3067\u3059\u3002<br \/>\n\uff12\u3064\u306e\u30c7\u30fc\u30bf\u8868\u793a\u90e8\uff08\u8868\uff09\u304c\u3042\u308a\u307e\u3059\u304c\u3001\u4e0a\u6bb5\u306fOCI\u63a5\u7d9a\u691c\u7d22\uff0c\u4e0b\u6bb5\u304cPDO\u63a5\u7d9a\u691c\u7d22\u3057\u305f\u7d50\u679c\u3067\u3059\u3002\u5143\u30c7\u30fc\u30bf\u3068\u691c\u7d22\u65b9\u6cd5\u306f\u540c\u3058\u3067\u3059\u304c\u3001\u4e0a\u6bb5\u3068\u4e0b\u6bb5\u3067\u691c\u7d22\u4ef6\u6570\u304c\u7570\u306a\u308b\u306e\u306f\u3001\u305d\u308c\u305e\u308c\u306e\u691c\u7d22\u76f4\u524d\u306b\u30c7\u30fc\u30bf\u3092\uff11\u4ef6\u8ffd\u52a0\u3057\u3066\u3044\u308b\u70ba\u3067\u3059\u3002<br \/>\n\u30c6\u30b9\u30c8\u51e6\u7406\u3067\u3059\u306e\u3067\u3001\u30c7\u30fc\u30bf\u5185\u5bb9\u81ea\u4f53\u306b\u610f\u5473\u306f\u3042\u308a\u307e\u305b\u3093\u304c\u3001\u5de6\u304b\u3089\u3001ID\uff0c\u767b\u9332\u6642\u9593\uff0c\u63a5\u7d9a\u65b9\u5f0f\uff0c\u63a5\u7d9a\u65b9\u5f0f\uff0c\u56fa\u5b9a\u6587\u5b57(\u2019test&#8217;)\uff0c\u66f4\u65b0\u6642\u9593\u3068\u306a\u3063\u3066\u3044\u307e\u3059\u3002\u767b\u9332\u6642\u9593\u3068\u66f4\u65b0\u6642\u9593\u306f\u540c\u3058\u3067\u3059\u304c\u3001\u30d7\u30ed\u30b0\u30e9\u30e0\u4e0a\u306f\u3001\u201dINSERT\u201d \u5f8c\u3001 \u201cUPDATE\u201d \u3092\u4f7f\u3063\u3066\u51e6\u7406\u3057\u3066\u3044\u307e\u3059\u3002<br \/>\n<img loading=\"lazy\" class=\"aligncenter size-full wp-image-2582\" style=\"border: solid 1px black;\" src=\"https:\/\/kats-eye.net\/info\/wp-content\/uploads\/2019\/04\/001.png\" alt=\"\" width=\"563\" height=\"419\" srcset=\"https:\/\/kats-eye.net\/info\/wp-content\/uploads\/2019\/04\/001.png 563w, https:\/\/kats-eye.net\/info\/wp-content\/uploads\/2019\/04\/001-300x223.png 300w\" sizes=\"(max-width: 563px) 100vw, 563px\" \/><br \/>\n\u30da\u30fc\u30b8\u3092\u958b\u304d\u76f4\u3059\u3054\u3068\u306b\u3001OCI\u63a5\u7d9a\uff0cPDO\u63a5\u7d9a\u3067\u5404\uff11\u4ef6\u30c7\u30fc\u30bf\u3092\u8ffd\u52a0\u3057\u3001\u5404\u51e6\u7406\u6bce\u306e\u4ef6\u6570\u304c\u8a2d\u5b9a\u6570\u3092\u8d85\u3048\u308b\u3068\u5bfe\u8c61\u3092\u524a\u9664\u3057\u307e\u3059\u3002<br \/>\n\u4e0a\u306e\u56f3\u306fOCI\u63a5\u7d9a\u3067\u8ffd\u52a0\u3057\u305f\u5168\u30c7\u30fc\u30bf\u304c\u62b9\u6d88\u3055\u308c\u305f\u76f4\u5f8c\u306e\u72b6\u614b\u3068\u306a\u308a\u307e\u3059\u3002\u4e0b\u306e\u56f3\u306f\u305d\u306e\u5f8c\u4f55\u5ea6\u304b\u30da\u30fc\u30b8\u3092\u958b\u304d\u76f4\u3057\u3066\u30c7\u30fc\u30bf\u304c\u8ffd\u52a0\u3055\u308c\u305f\u72b6\u614b\u3067\u3059\u3002<\/p>\n<p><img loading=\"lazy\" class=\"aligncenter size-full wp-image-2585\" style=\"border: solid 1px black;\" src=\"https:\/\/kats-eye.net\/info\/wp-content\/uploads\/2019\/04\/004.png\" alt=\"\" width=\"562\" height=\"682\" srcset=\"https:\/\/kats-eye.net\/info\/wp-content\/uploads\/2019\/04\/004.png 562w, https:\/\/kats-eye.net\/info\/wp-content\/uploads\/2019\/04\/004-247x300.png 247w\" sizes=\"(max-width: 562px) 100vw, 562px\" \/><\/p>\n<p><span style=\"text-decoration: underline;\">\uff08\uff13\uff09\u30d7\u30ed\u30b0\u30e9\u30e0\u30e1\u30e2<\/span><br \/>\n\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u53c2\u8003\u8868\u793a\u3057\u307e\u3059\u3002\uff08\u63a5\u7d9a\u60c5\u5831\u7b49\u306b\u3064\u3044\u3066\u306f\u65e5\u672c\u8a9e\u8868\u8a18\u3057\u3001\u629c\u3044\u3066\u3044\u307e\u3059\uff09\u3000OCI\u63a5\u7d9a\u95a2\u9023\u304c\u884c\u756a38\uff5e104\u3001PDO\u63a5\u7d9a\u95a2\u9023\u304c\u884c\u756a108\uff5e167\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002\u305d\u308c\u305e\u308c\u57fa\u672c\u7684\u306a\u51e6\u7406\u5185\u5bb9\u306f\u540c\u3058\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002\u5404\u51e6\u7406\u524d\u306b\u30b3\u30e1\u30f3\u30c8\u3067\u30c7\u30fc\u30bf\u691c\u7d22\u30fb\u633f\u5165\u30fb\u66f4\u65b0\u30fb\u524a\u9664\u7b49\u8a18\u8f09\u3057\u3066\u3044\u307e\u3059\u306e\u3067\u3001\u8a73\u7d30\u306e\u8a18\u8ff0\u306f\u7701\u7565\u3057\u307e\u3059\u3002\u3044\u305a\u308c\u306e\u63a5\u7d9a\u65b9\u6cd5\u3082SQL\u6587\u3092\u4f5c\u6210\u3057\u3001\u5b9f\u884c\u3059\u308c\u3070\u3068\u308a\u3042\u3048\u305a\u6a5f\u80fd\u3059\u308b\u69d8\u3067\u3059\u306e\u3067\u5c11\u3057\u5b89\u5fc3\u3057\u307e\u3057\u305f\u3002\u5909\u6570\u90e8\u5206\u306e\u8a2d\u5b9a\u3084\u691c\u7d22\u7d50\u679c\u53d6\u5f97\u7b49\u3001\u3061\u3087\u3063\u3068\u3057\u305f\u30c6\u30af\u30cb\u30c3\u30af\u7684\u306a\u65b9\u6cd5\u3082\u3042\u308b\u69d8\u3067\u3059\u306e\u3067\u3001\u6a5f\u4f1a\u304c\u3042\u308c\u3070\u52c9\u5f37\u3057\u305f\u3044\u3068\u601d\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"height-set:true height:800 lang:php decode:true\">&lt;!doctype html&gt;\r\n&lt;html lang=\"ja\"&gt;\r\n\r\n&lt;head&gt;\r\n&lt;meta charset=\"UTF-8\"&gt;\r\n&lt;title&gt;cent_os_test&lt;\/title&gt;\r\n&lt;style&gt;\r\n\ttable { border-collapse: collapse; }\r\n\ttable th, table td { border: solid 1px black; }\r\n\r\n&lt;\/style&gt;\r\n&lt;\/head&gt;\r\n\r\n&lt;body&gt;\r\n\t&lt;H2&gt;Hello CentOS7 !\u3000( OCI \/ PDO \u63a5\u7d9a\u8a55\u4fa1\uff09 &lt;\/H2&gt;\r\n\r\n\t&lt;?php\r\n\t\t$date_tmp = mb_substr(str_replace(\"-\",\"\/\",date(\"Y-m-d H:i:s\",strtotime(\"-50 day\"))),0,10) ;\r\n\t\techo \"\u691c\u7d22\u65e5\u4ed8 : \".date(\"Y\/m\/d H:i:s\") ;\r\n\t\techo \"&lt;BR&gt;\u5bfe\u8c61\u65e5\u4ed8 : \".$date_tmp.\" \uff5e\";\r\n\r\n\t\t$date_cur = date(\"Y\/m\/d H:i:s\");\r\n\r\n\t\t\/\/ \u30aa\u30e9\u30af\u30eb\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u63a5\u7d9a\u60c5\u5831\r\n\t\t$tns_str = '(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST={IP \uff71\uff84\uff9e\uff9a\uff7d}) (PORT=1521))(CONNECT_DATA=(SERVICE_NAME={\uff7b\uff70\uff8a\uff9e\uff70\uff7b\uff70\uff8b\uff9e\uff7d\u540d})))';\r\n\t\t$con_nam = \"\uff95\uff70\uff7b\uff9e\uff70\u540d\" ;\r\n\t\t$con_pas = \"\uff8a\uff9f\uff7d\uff9c\uff70\uff84\uff9e\" ;\r\n\r\n\t\t\/\/ \u691c\u7d22SQL\uff11\r\n\t\t$sql = \"SELECT ID_NO , to_char(DATE_LCY,'yyyy\/mm\/dd hh24:mi:ss') , SYS_NAME , CHR_NAME , KUBUN , to_char(DATE_FNS,'yyyy\/mm\/dd hh24:mi:ss') \" ;\r\n\t\t$sql = $sql.\"FROM TEST_TABLE_NAME WHERE KUBUN= 'test' AND DATE_LCY &gt;= '\".$date_tmp.\"' ORDER BY DATE_LCY DESC , SYS_NAME\" ;\r\n\r\n\t\t\/\/ \u691c\u7d22SQL\uff12\r\n\t\t$sql_mik = \"SELECT ID_NO , to_char(DATE_LCY,'yyyy\/mm\/dd hh24:mi:ss') , SYS_NAME , CHR_NAME , KUBUN , to_char(DATE_FNS,'yyyy\/mm\/dd hh24:mi:ss') \" ;\r\n\t\t$sql_mik = $sql_mik.\"FROM TEST_TABLE_NAME WHERE KUBUN= 'test' AND DATE_FNS IS NULL ORDER BY DATE_LCY , SYS_NAME\" ;\r\n\r\n\r\n\t\t\/\/ \u25c6\u25c6\u25c6\u3000OCI\u3000\u63a5\u7d9a\u3000TEST\u3000\u25c6\u25c6\u25c6\r\n\t\t$conn = oci_connect( $con_nam , $con_pas , $tns_str , 'AL32UTF8' );\t\t\t\t\/\/ \u76f4\u63a5\u8a18\u8f09,\u6587\u5b57\u30b3\u30fc\u30c9\u6307\u5b9a\uff08AL32UTF8\uff09\r\n\t\tif(!$conn){\r\n\t\t\techo \"&lt;P&gt;\u00d7\u3000\uff2f\uff23\uff29\u63a5\u7d9a\u5931\u6557\u3000\u00d7&lt;\/P&gt;&lt;BR&gt;&lt;BR&gt;\";\r\n\t\t}else{\r\n\t\t\t\/\/\u3010SELECT\u3011\u767b\u9332\u4ef6\u6570\u691c\u7d22\uff08KUBUN = 'test' AND SYS_NAME = 'OCI'\uff09\r\n\t\t\t$sql_chk = \"SELECT COUNT(*) AS NUMBER_OF_ROWS FROM TEST_TABLE_NAME WHERE KUBUN = 'test' AND SYS_NAME = 'OCI'\" ;\r\n\t\t\t$stid = oci_parse($conn, $sql_chk) ;\r\n\t\t\toci_define_by_name($stid, 'NUMBER_OF_ROWS', $number_of_rows) ;\r\n\t\t\toci_execute( $stid ) ;\r\n\t\t\toci_fetch( $stid ) ;\r\n\r\n\t\t\tif($number_of_rows&gt;10){\r\n\t\t\t\t\/\/\u3010DELETE\u3011\u767b\u9332\u691c\u7d22\u5897\u52a0\u6642\u3001\u62b9\u6d88\r\n\t\t\t\t$sql_del = \"DELETE FROM TEST_TABLE_NAME WHERE KUBUN = 'test' AND SYS_NAME = 'OCI'\";\r\n\t\t\t\t$stid = oci_parse($conn, $sql_del);\r\n\t\t\t\toci_execute( $stid );\r\n\t\t\t}else{\r\n\t\t\t\t\/\/\u3010INSERT\u3011\u767b\u9332\u4ef6\u6570\u304c\u6761\u4ef6\u4ee5\u4e0b\u306e\u6642\u3001\u65b0\u898f\u767b\u9332\r\n\t\t\t\t$nam_reg = \"\u25c7\".substr( \"00000000\".strval(floor(100000000 * microtime())) , -8 ).\"\u25c7\" ;\r\n\t\t\t\t$sql_ins = \"INSERT INTO TEST_TABLE_NAME ( ID_NO , DATE_LCY , SYS_NAME , CHR_NAME , KUBUN , DATE_FNS ) \";\r\n\t\t\t\t$sql_ins = $sql_ins.\"VALUES ('\".$nam_reg.\"',TO_DATE('\".$date_cur.\"','YYYY:MM.DD:HH24\/MI\/SS'),'OCI','\u25c7OCI-CONN\u25c7','test','')\";\r\n\r\n\t\t\t\t$stid = oci_parse($conn, $sql_ins);\r\n\t\t\t\toci_execute( $stid );\r\n\t\t\t}\r\n\r\n\t\t\techo \"&lt;P&gt;\u25ce\u3000\uff2f\uff23\uff29\u63a5\u7d9a\u6210\u529f\u3000\u25ce&lt;\/P&gt;\";\r\n\r\n\t\t\t\/\/\u3010SELECT\u3011DATE_FNS \u65e5\u4ed8\u672a\u8a2d\u5b9a\u306e\u30c7\u30fc\u30bf\u6709\u7121\u691c\u7d22\r\n\t\t\t$stid = oci_parse( $conn , $sql_mik );\r\n\t\t\toci_execute( $stid );\r\n\t\t\t$reWrtID=\"\";\r\n\t\t\twhile ($row = oci_fetch_array($stid, OCI_NUM + OCI_RETURN_NULLS)) {\r\n\t\t\t\t\/\/ \u767b\u9332\u65e5\u4ed8\u306e\u53e4\u3044\uff11\u4ef6\u306e\u307f\u3092\u5bfe\u8c61\u3068\u3059\u308b\r\n\t\t\t\t$reWrtID = $row[0];\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\/\/\u3010UPDATE\u3011DATE_FNS \u65e5\u4ed8\u66f4\u65b0\r\n\t\t\tif($reWrtID!=\"\"){\r\n\t\t\t\t$sql_upd = \"UPDATE TEST_TABLE_NAME SET DATE_FNS = TO_DATE('\".$date_cur.\"','YYYY:MM.DD:HH24\/MI\/SS') \";\r\n\t\t\t\t$sql_upd = $sql_upd.\"WHERE ID_NO ='\".$reWrtID.\"'\";\r\n\t\t\t\t$stid = oci_parse( $conn , $sql_upd );\r\n\t\t\t\toci_execute( $stid );\r\n\t\t\t}\r\n\r\n\t\t\t\/\/\u3010SELECT\u3011\u767b\u9332\u30c7\u30fc\u30bf\u691c\u7d22\u30fb\u8868\u793a\r\n\t\t\t$stid = oci_parse( $conn , $sql );\r\n\t\t\toci_execute( $stid );\r\n\r\n\t\t\t$rw_cnt = 0 ;\r\n\t\t\twhile ($row = oci_fetch_array($stid, OCI_NUM + OCI_RETURN_NULLS)) {\r\n\t\t\t\tif($rw_cnt == 0){ echo \"&lt;TABLE&gt;\" ; }\r\n\t\t\t\t\r\n\t\t\t\techo \"&lt;TR&gt;\" ;\r\n\t\t\t\tfor ($i = 0 ; $i &lt; count($row); $i++){\r\n\t\t\t\t\techo \"&lt;TD&gt;\".$row[$i].\"&lt;\/TD&gt;\" ; \r\n\t\t\t\t}\r\n\t\t\t\techo \"&lt;\/TR&gt;\" ;\r\n\r\n\t\t\t\t$rw_cnt = $rw_cnt + 1 ;\r\n\t\t\t}\r\n\r\n\t\t\tif($rw_cnt &gt; 0){ echo \"&lt;\/TABLE&gt;\" ; }\r\n\t\t}\r\n\t\t$conn = null ;\r\n\r\n\t\techo \"&lt;BR&gt;&lt;BR&gt;\";\r\n\r\n\t\t\/\/ \u25c6\u25c6\u25c6\u3000PDO\u3000\u63a5\u7d9a\u3000TEST\u3000\u25c6\u25c6\u25c6\r\n    \t\ttry {\r\n        \t\t$db = new PDO('oci:dbname='.$tns_str.';charset=utf8' , $con_nam , $con_pas );\r\n\t\t\t$db-&gt;setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\r\n\r\n        \t\techo \"&lt;P&gt;\u25ce\u3000\uff30\uff24\uff2f\u63a5\u7d9a\u6210\u529f\u3000\u25ce&lt;\/P&gt;\";\r\n\r\n\t\t\t\/\/\u3010SELECT\u3011\u767b\u9332\u4ef6\u6570\u691c\u7d22\uff08KUBUN = 'test' AND SYS_NAME = 'PDO'\uff09\r\n\t\t\t$sql_chk = \"SELECT COUNT(*) FROM TEST_TABLE_NAME WHERE KUBUN = 'test' AND SYS_NAME = 'PDO'\" ;\r\n\t\t\t$stmt = $db-&gt;query($sql_chk);\r\n\t\t\t$dat_cnt=$stmt-&gt;fetchColumn();\r\n\r\n\t\t\tif($dat_cnt&gt;5){\r\n\t\t\t\t\/\/\u3010DELETE\u3011\u767b\u9332\u691c\u7d22\u5897\u52a0\u6642\u3001\u62b9\u6d88\r\n\t\t\t\t$sql_del = \"DELETE FROM TEST_TABLE_NAME WHERE KUBUN = 'test' AND SYS_NAME = 'PDO'\";\r\n\t\t\t\t$res_del = $db-&gt;query($sql_del);\r\n\r\n\t\t\t}else{\r\n\t\t\t\t\/\/\u3010INSERT\u3011\u767b\u9332\u4ef6\u6570\u304c\u6761\u4ef6\u4ee5\u4e0b\u306e\u6642\u3001\u65b0\u898f\u767b\u9332\r\n\t\t\t\t$nam_reg = \"\u25c6\".substr( \"00000000\".strval(floor(100000000 * microtime())) , -8 ).\"\u25c6\" ;\r\n\t\t\t\t$sql_ins = \"INSERT INTO TEST_TABLE_NAME ( ID_NO , DATE_LCY , SYS_NAME , CHR_NAME , KUBUN , DATE_FNS ) \";\r\n\t\t\t\t$sql_ins = $sql_ins.\"VALUES ('\".$nam_reg.\"',TO_DATE('\".$date_cur.\"','YYYY:MM.DD:HH24\/MI\/SS'),'PDO','\u25c6PDO-CONN\u25c6','test','')\";\r\n\t\t\t\t$res_ins = $db-&gt;query($sql_ins);\r\n\t\t\t}\r\n\r\n\t\t\t\/\/\u3010SELECT\u3011DATE_FNS \u65e5\u4ed8\u672a\u8a2d\u5b9a\u306e\u30c7\u30fc\u30bf\u6709\u7121\u691c\u7d22\r\n\t\t\t$reWrtID=\"\";\r\n\t\t\t$res_upd = $db-&gt;query($sql_mik);\r\n\t\t\twhile($row = $res_upd -&gt; fetch(PDO::FETCH_NUM)) {\r\n\t\t\t\t$reWrtID = $row[0];\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\/\/\u3010UPDATE\u3011DATE_FNS \u65e5\u4ed8\u66f4\u65b0\r\n\t\t\tif($reWrtID!=\"\"){\r\n\t\t\t\t$sql_upd = \"UPDATE TEST_TABLE_NAME SET DATE_FNS = TO_DATE('\".$date_cur.\"','YYYY:MM.DD:HH24\/MI\/SS') \";\r\n\t\t\t\t$sql_upd = $sql_upd.\"WHERE ID_NO ='\".$reWrtID.\"'\";\r\n\t\t\t\t$res_upd = $db-&gt;query($sql_upd);\r\n\t\t\t}\r\n\r\n\t\t\t\/\/\u3010SELECT\u3011\u767b\u9332\u30c7\u30fc\u30bf\u691c\u7d22\u30fb\u8868\u793a\r\n\t\t\t$rw_cnt = 0 ;\r\n\t\t\t$stmt = $db-&gt;query($sql);\r\n\t\t\twhile($row = $stmt -&gt; fetch(PDO::FETCH_NUM)) {\r\n\t\t\t\tif($rw_cnt == 0){ echo \"&lt;TABLE&gt;\" ; }\r\n\t\t\t\t\r\n\t\t\t\techo \"&lt;TR&gt;\" ;\r\n\t\t\t\tfor ($i = 0 ; $i &lt; count($row); $i++){ echo \"&lt;TD&gt;\".$row[$i].\"&lt;\/TD&gt;\" ; }\r\n\t\t\t\techo \"&lt;\/TR&gt;\" ;\r\n\r\n\t\t\t\t$rw_cnt = $rw_cnt + 1 ;\r\n\t\t\t}\r\n\r\n\t\t\tif($rw_cnt &gt; 0){ echo \"&lt;\/TABLE&gt;\" ; }\r\n\r\n\t\t} catch (PDOException $e) {\r\n\t\t\techo \"&lt;P&gt;\u00d7\u3000\uff30\uff24\uff2f\u63a5\u7d9a\u5931\u6557\u3000\u00d7&lt;\/P&gt;\";\r\n\t\t\techo \"ERROR : \".$e-&gt;getMessage();\r\n\t\t}\r\n\t\t$db = null ;\r\n\r\n\t\techo \"&lt;BR&gt;&lt;BR&gt;\" ;\r\n\t\techo \"&lt;BR&gt;\u691c\u7d22\u7d42\u4e86\u3002\u304a\u3057\u307e\u3044!!\" ;\r\n\t?&gt;\r\n\r\n&lt;\/body&gt;\r\n\r\n&lt;\/html&gt;\r\n<\/pre>\n<p>&nbsp;<\/p>\n<table style=\"width: 100%; border-collapse: collapse; border-style: none; height: 27px;\" border=\"1\">\n<tbody>\n<tr style=\"height: 30px; border-bottom: 3px #0000ff solid;\">\n<td style=\"width: 1.5%; border-style: none; background-color: #0000ff; height: 27px;\"><\/td>\n<td style=\"width: 2.63291%; border-style: none; height: 27px; background-color: #ffffff;\"><\/td>\n<td style=\"border-style: none; height: 27px; background-color: #ffffff; width: 96.2025%;\"><span style=\"font-family: verdana, geneva, sans-serif;\"><strong><span style=\"font-size: 18pt; color: #0000ff;\">\u307e\u3068\u3081<\/span><\/strong><\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u30aa\u30e9\u30af\u30eb\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u63a5\u7d9a\u3067\u304d\u308b\u69d8\u306b\u306a\u308b\u3068\u3001\u500b\u4eba\u7684\u306b\u306f\u30d6\u30e9\u30a6\u30b6\u30fc\u4e0a\u3067\u7de8\u96c6\u3059\u308b\u753b\u50cf\u60c5\u5831\u306a\u3069\u3068\u65e2\u5b58\u306e\u7ba1\u7406\u60c5\u5831\u306a\u3069\u3068\u306e\u9023\u643a\u304c\u3057\u3084\u3059\u304f\u306a\u308b\u3068\u601d\u3063\u3066\u3044\u307e\u3059\u3002\u3084\u3063\u3066\u307f\u3066\u826f\u304b\u3063\u305f\u3068\u3044\u3046\u306e\u304c\u6b63\u76f4\u306a\u611f\u60f3\u3067\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6982\u8981 \u5148\u56de\u30aa\u30e9\u30af\u30eb\u30a4\u30f3\u30b9\u30bf\u30f3\u30c8\u3068OCI\u62e1\u5f35\u30e2\u30b8\u30e5\u30fc\u30eb\u3092CentOS\u30b5\u30fc\u30d0\u30fc\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3057\u305f\u3002\u4ed6\u306e\u30aa\u30e9\u30af\u30eb\u30b5\u30fc\u30d0\u30fc\u306e\u30c7\u30fc\u30bf\u691c\u7d22\u304c\u51fa\u6765\u308b\u69d8\u306b\u306a\u308a\u307e\u3057\u305f\u306e\u3067\u3001PHP\u3067\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u4f5c\u6210\u3057\u3066\u307f\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002\u7d50\u679c\u306f\u3001\u3068\u308a\u3042\u3048 &hellip; <a href=\"https:\/\/kats-eye.net\/info\/2019\/04\/01\/oracle-instant-2\/\" class=\"more-link\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"screen-reader-text\">Oracle \u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u691c\u7d22\u3059\u308b<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":2598,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[61],"tags":[63,67,45],"_links":{"self":[{"href":"https:\/\/kats-eye.net\/info\/wp-json\/wp\/v2\/posts\/2575"}],"collection":[{"href":"https:\/\/kats-eye.net\/info\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kats-eye.net\/info\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kats-eye.net\/info\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kats-eye.net\/info\/wp-json\/wp\/v2\/comments?post=2575"}],"version-history":[{"count":16,"href":"https:\/\/kats-eye.net\/info\/wp-json\/wp\/v2\/posts\/2575\/revisions"}],"predecessor-version":[{"id":2597,"href":"https:\/\/kats-eye.net\/info\/wp-json\/wp\/v2\/posts\/2575\/revisions\/2597"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/kats-eye.net\/info\/wp-json\/wp\/v2\/media\/2598"}],"wp:attachment":[{"href":"https:\/\/kats-eye.net\/info\/wp-json\/wp\/v2\/media?parent=2575"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kats-eye.net\/info\/wp-json\/wp\/v2\/categories?post=2575"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kats-eye.net\/info\/wp-json\/wp\/v2\/tags?post=2575"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}