PDA

View Full Version : Problems creating an sql FTP


Miquel Angel Bada
03-23-2004, 04:41 AM
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@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;


MyLounge.com Site Map
Forum: Cars, Cell Phone, Database, Games, Home Improvement, IT, Music, School, Sports, Web Design, Web Server, Weight Loss

The MyLounge.com forum is intended for informational use only and should not be relied upon and is not a substitute for any advice. The information contained on MyLounge.com are opinions and suggestions of members and is not a representation of the opinions of MyLounge.com. MyLounge.com does not warrant or vouch for the accuracy, completeness or usefulness of any postings or the qualifications of any person responding. Please consult a expert or seek the services of an attorney in your area for more accuracy on your specific situation. Please note that our forums also serve as mirrors to Usenet newsgroups. Many posts you see on our forums are made by newsgroup users who may not be members of MyLounge.com Term of Service