开发者

using pl/sql how do I open a directory?

开发者 https://www.devze.com 2023-01-13 08:40 出处:网络
using pl/sql开发者_如何学运维 how do I open a directory?This is only valid for Oracle 10g+ (lots of info in the comment here):

using pl/sql开发者_如何学运维 how do I open a directory?


This is only valid for Oracle 10g+ (lots of info in the comment here):

DECLARE

  pattern VARCHAR2(1024) := 'C:\temp\*';
   ns VARCHAR2(1024);

BEGIN
  SYS.DBMS_BACKUP_RESTORE.searchFiles(pattern, ns);

  -- List files in the directory
  FOR each_file IN (SELECT FNAME_KRBMSFT AS name FROM X$KRBMSFT) LOOP
    DBMS_OUTPUT.PUT_LINE(each_file.name);
  END LOOP;

END;
/


Keep in mind you'll need DBA privileges to write to the file system, or have a DBA that's willing to grant you those privileges (which in many environments is not likely).

0

精彩评论

暂无评论...
验证码 换一张
取 消