{"id":568,"date":"2011-04-13T08:32:38","date_gmt":"2011-04-13T00:32:38","guid":{"rendered":"http:\/\/j178.mtgbb.com\/?p=568"},"modified":"2018-02-19T01:10:33","modified_gmt":"2018-02-18T17:10:33","slug":"oracle-db-%e6%aa%a2%e6%9f%a5%e6%aa%94%e6%a1%88%e6%98%af%e5%90%a6%e5%ad%98%e5%9c%a8","status":"publish","type":"post","link":"https:\/\/j178.mtgbb.com\/?p=568","title":{"rendered":"Oracle DB \u6aa2\u67e5\u6a94\u6848\u662f\u5426\u5b58\u5728"},"content":{"rendered":"<p>\u6700\u8fd1\u5beb\u7684\uff0c\u5728 oracle 9i \u5e95\u4e0b\uff0c\u6aa2\u67e5\u6a94\u6848\u662f\u5426\u5b58\u5728<\/p>\n<p><!--more--><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"sql\">-- \u9a57\u8b49\u6a94\u6848\u662f\u5426\u5b58\u5728\r\nFUNCTION chk_exists(p_dir IN VARCHAR2, p_filename IN VARCHAR2)\r\n  RETURN BOOLEAN IS\r\n  \/* declare an handle for the file *\/\r\n  fhandle  utl_file.file_type;\r\n  v_exists BOOLEAN;\r\nBEGIN\r\n  v_exists := FALSE;\r\n  \/* try openning file for reading *\/\r\n  fhandle := utl_file.fopen(p_dir, p_filename, 'R');\r\n \r\n  IF utl_file.is_open(fhandle) THEN\r\n    v_exists := TRUE;\r\n    utl_file.fclose(fhandle);\r\n  END IF;\r\n \r\n  RETURN v_exists;\r\nEXCEPTION\r\n  -- in any error case report that file does not exist.\r\n  WHEN OTHERS THEN\r\n    RETURN FALSE;\r\nEND chk_exists;\r\n \r\n-- \u8907\u88fd\u6a94\u6848\r\nFUNCTION exe_fcopy(p_dir1  IN VARCHAR2,\r\n                   p_file1 IN VARCHAR2,\r\n                   p_dir2  IN VARCHAR2,\r\n                   p_file2 IN VARCHAR2) RETURN BOOLEAN IS\r\nBEGIN\r\n  -- \u5c07 p_dir1 \u7684 p_file1 \u8907\u88fd\u5230 p_dir2 \u7684 p_file2\r\n  utl_file.fcopy(p_dir1, p_file1, p_dir2, p_file2);\r\n \r\n  RETURN TRUE;\r\nEXCEPTION\r\n  WHEN OTHERS THEN\r\n    RETURN FALSE;\r\nEND exe_fcopy;<\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6700\u8fd1\u5beb\u7684\uff0c\u5728 oracle 9i \u5e95\u4e0b\uff0c\u6aa2\u67e5\u6a94\u6848\u662f\u5426\u5b58\u5728<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[22,12],"tags":[23],"class_list":["post-568","post","type-post","status-publish","format-standard","hentry","category-oracle-erp","category-database","tag-oracle-db"],"_links":{"self":[{"href":"https:\/\/j178.mtgbb.com\/index.php?rest_route=\/wp\/v2\/posts\/568","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/j178.mtgbb.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/j178.mtgbb.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/j178.mtgbb.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/j178.mtgbb.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=568"}],"version-history":[{"count":1,"href":"https:\/\/j178.mtgbb.com\/index.php?rest_route=\/wp\/v2\/posts\/568\/revisions"}],"predecessor-version":[{"id":1167,"href":"https:\/\/j178.mtgbb.com\/index.php?rest_route=\/wp\/v2\/posts\/568\/revisions\/1167"}],"wp:attachment":[{"href":"https:\/\/j178.mtgbb.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=568"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/j178.mtgbb.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=568"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/j178.mtgbb.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=568"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}