I wrote a PL/SQL procedure to connect to an FTP server. I am able to write a file to that FTP server. Using the same code I tried to connect to an SFTP server, but it failed
SFTP requires SSH plus the implementation of a protocol. As far as my PL/SQL knowledge reaches and Google's, there are currently no available implementation of SSH or this protocol in PL/SQL. There are some alternatives:
I would go for the second option. If you need further details, please let me know.
You can try the commercial ORA_SFTP package provided from DidiSoft:
connection_id := ORA_SFTP.CONNECT_HOST(...
ORA_SFTP.UPLOAD(connection_id, data, 'remote_file.dat');
Disclaimer: I work for DidiSoft