Hi all,
i have the need to implement an FTP procedure and accordingly to what i found here : http://www.oracle-base.com/articles/misc/ftp-from-plsql.php i try this code:
DECLARE
l_conn UTL_TCP.connection;
l_result PLS_INTEGER;
BEGIN
l_conn := UTL_TCP.open_connection('remotehost', '21');
dbms_output.put_line('1 '||UTL_TCP.get_line(l_conn, TRUE));
l_result := UTL_TCP.write_line(l_conn, 'USER user');
dbms_output.put_line('2 '||UTL_TCP.get_line(l_conn, TRUE));
l_result := UTL_TCP.write_line(l_conn, 'PASS passord');
dbms_output.put_line('3 '||UTL_TCP.get_line(l_conn, TRUE));
l_result := UTL_TCP.write_line(l_conn, 'cwd /some/remote/path');
begin
loop
dbms_output.put_line('4 '||UTL_TCP.get_line(l_conn, TRUE));
end loop;
exception
when UTL_TCP.END_OF_INPUT then
null;
end;
l_result := UTL_TCP.write_line(l_conn, 'bye');
UTL_TCP.close_connection(l_conn);
END;
in order to intercept all the returning messages ... but the loop never raise exception.
Any suggestion?
Thanks
Alex