Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Using FTP via PL/SQL

OraclePSPNov 14 2012 — edited Nov 22 2012
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
This post has been answered by AlbertoFaenza on Nov 15 2012
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 20 2012
Added on Nov 14 2012
27 comments
14,524 views