============================================================================== /*--------------------------------------------------------------------------*/ /* Example of FTP 'get' (Binary File) */ /*--------------------------------------------------------------------------*/ declare l_ret_value varchar2(100); l_ret_status varchar2(100); begin QSTFND_FTP_PKG.ftp ('GET', 'MY_DB_DIR', 'local_file.txt', 'server_name', 21, '/apps/appl/product/115/DBNAME/reports/US', 'remote_file.txt', 'username', 'password', 'BINARY', l_ret_value, l_ret_status); dbms_output.put_line(l_ret_status||' - '||l_ret_value); end; ============================================================================== /*--------------------------------------------------------------------------*/ /* Example of FTP 'put' (Binary File) */ /*--------------------------------------------------------------------------*/ declare l_ret_value varchar2(100); l_ret_status varchar2(100); begin QSTFND_FTP_PKG.ftp ('PUT', 'QSTAR_REPORTS', 'local_file.txt', 'server_name', 21, '/apps/appl/product/115/DBNAME/reports/US', 'remote_file.txt', 'username', 'password', 'BINARY', l_ret_value, l_ret_status); dbms_output.put_line(l_ret_status||' - '||l_ret_value); end; ============================================================================== /*--------------------------------------------------------------------------*/ /* Example of FTP 'get' (ASCII File) */ /*--------------------------------------------------------------------------*/ declare l_ret_value varchar2(100); l_ret_status varchar2(100); begin QSTFND_FTP_PKG.ftp ('GET', 'QSTAR_DATA_OUT', 'local_file.txt', 'server_name', 21, '/apps/appl/product/115/DBNAME/reports/US', 'remote_file.txt', 'username', 'password', 'ASCII', l_ret_value, l_ret_status); dbms_output.put_line(l_ret_status||' - '||l_ret_value); end; ============================================================================== /*--------------------------------------------------------------------------*/ /* Example of FTP 'put' (ASCII File) */ /* */ /* Also this is an example to show you can use physical dir's, if they have*/ /* an associated database directory defined. The FTP procedure will */ /* validate that one is defined before proceding. */ /*--------------------------------------------------------------------------*/ declare l_ret_value varchar2(100); l_ret_status varchar2(100); begin QSTFND_FTP_PKG.ftp ('PUT', '/apps/appl/product/115/DBNAME/reports/US', -- Note that a db directory must exist with this path if physical directory is used. 'local_file.txt', 'server_name', 21, '/apps/appl/product/115/DBNAME/reports/US', 'remote_file.txt', 'username', 'password', 'ASCII', l_ret_value, l_ret_status); dbms_output.put_line(l_ret_status||' - '||l_ret_value); end; ==============================================================================