开发者

Problem creating a Directory object in Oracle

开发者 https://www.devze.com 2023-01-22 05:36 出处:网络
The code is this: Originally:(http://www.oracle-base.com/articles/misc/FTPFromPLSQL.php) The approach uses a combination of the UTL_TCP and UTL_FILE packages to create a simple FTP API (ftp.pks, ftp

The code is this:

Originally:(http://www.oracle-base.com/articles/misc/FTPFromPLSQL.php)

The approach uses a combination of the UTL_TCP and UTL_FILE packages to create a simple FTP API (ftp.pks, ftp.pkb). Once the API is loaded into the appropriate schema simple FTP commands can be initiated as follows:

CREATE OR REPLACE DIRECTORY my_docs AS '/u01/app/oracle/';
SET SERVEROUTPUT ON SIZE 1000000
@c:\ftp.pks
@c:\ftp.pkb


-- Send an ASCII file to a remote FTP server.
DECLARE
  l_conn  UTL_TCP.connection;
BEGIN
  l_conn := ftp.login('ftp.company.com', '21', 'ftpuser', 'ftppassword');
  ftp.ascii(p开发者_StackOverflow中文版_conn => l_conn);
  ftp.put(p_conn      => l_conn,
          p_from_dir  => 'MY_DOCS',
          p_from_file => 'test_get.txt',
          p_to_file   => '/u01/app/oracle/test_put.txt');
  ftp.logout(l_conn);
END;
/

The problem is that when I try to create the directory object I get an error saying that Create symbol wasnt expected.

where this line should be created?


Is there anything preceding the create statement line in your script? It looks like there might be something you left off the post.

0

精彩评论

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