p baji
asked on
How to read .csv file from FTP or SFTP server using Oracle PL SQL ?
I tried the below code and it showing output like SSH-2.0-OpenSSH_5.3 that means connected i hope.
declare c utl_tcp.connection; -- TCP/IP connection to the Web server ret_val pls_integer;
BEGIN c := utl_tcp.open_connection(re mote_host => 'ftp.******.******.com'
,remote_port => 21 ,charset => 'US7ASCII' --
,wallet_path => '****************' --
,wallet_password => '**********' ); -- open connection
-- ret_val := utl_tcp.write_line(c, 'GET / HTTP/1.0'); -- send HTTP request
ret_val := utl_tcp.write_line(c);
BEGIN LOOP dbms_output.put_line(utl_t cp.get_lin e(c, TRUE)); -- read result
END LOOP;
EXCEPTION
WHEN utl_tcp.end_of_input THEN NULL; -- end of input
END;
utl_tcp.close_connection(c );
END;
/
Could someone help me on next steps on How to open and read the .csv file present in SFTP/FTP server and load it into Oracle DB table ?
declare c utl_tcp.connection; -- TCP/IP connection to the Web server ret_val pls_integer;
BEGIN c := utl_tcp.open_connection(re
,remote_port => 21 ,charset => 'US7ASCII' --
,wallet_path => '****************' --
,wallet_password => '**********' ); -- open connection
-- ret_val := utl_tcp.write_line(c, 'GET / HTTP/1.0'); -- send HTTP request
ret_val := utl_tcp.write_line(c);
BEGIN LOOP dbms_output.put_line(utl_t
END LOOP;
EXCEPTION
WHEN utl_tcp.end_of_input THEN NULL; -- end of input
END;
utl_tcp.close_connection(c
END;
/
Could someone help me on next steps on How to open and read the .csv file present in SFTP/FTP server and load it into Oracle DB table ?
This question needs an answer!
Become an EE member today
7 DAY FREE TRIALMembers can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
https://www.experts-exchange.com/articles/3043/How-to-FTP-with-Oracle-PL-SQL.html