Problems creating an sql FTP

From: Miquel Angel Bada <mbada_at_settingconsultoria.es>
Date: Tue, 23 Mar 2004 13:41:49 +0100
Message-ID: <c3pas8$d4a$1_at_nsnmrro2-gest.nuria.telefonica-data.net>



Hi,

I want to make an FTP with stored Procedures and Functions in a database, in order to download some files, as is shown at http://www.revealnet.com/newsletter-v3/0302_C.htm

but there is a problem ... I try to create all the code at TOAD 7.6, but it crashes because the following code crashes

does aybody knows why it hapens?

Sincerely yours,

Miquel Angel

TYPE TStringTable IS TABLE OF VARCHAR2(2000);

TYPE TServerReply IS RECORD (

     Rpt CHAR, -- Holds symbol: "-" if ftp reply consist of several

  • lines, otherwise equal space

     Code VARCHAR2(3), -- Tree digit reply code

     Message VARCHAR2(256)); -- Descriptive Message

TYPE TServerReplyA IS TABLE OF TServerReply;

TYPE TConnectInfo IS RECORD (IP VARCHAR2(22),

                             Port PLS_INTEGER );

CREATE OR REPLACE PROCEDURE Main
IS

v_reply TServerReplyA;
v_file TStringTable;
v_conn utl_tcp.connection;

BEGIN
v_conn := Login('ftp.ftp.com', 21, 'anonymous', 'dbouzolin_at_yahoo.com'); v_file := GetTextFile(v_conn, 'pub/support/banner.msg'); Logout(v_conn);
utl_tcp.close_all_connections;
FOR i IN 1 .. v_file.count LOOP
dbms_output.put_line(substr(v_file(i),1,100)); END LOOP;
v_file.delete;
EXCEPTION
WHEN OTHERS THEN
Logout(v_conn);
utl_tcp.close_all_connections;
dbms_output.put_line('ERROR: '||substr(SQLERRM, 1, 80)); END; Received on Tue Mar 23 2004 - 13:41:49 CET

Original text of this message