Home » SQL & PL/SQL » SQL & PL/SQL » Problem in uploading file (10g, XP)
Problem in uploading file [message #395975] Fri, 03 April 2009 07:01 Go to next message
delna.sexy
Messages: 941
Registered: December 2008
Location: Surat, The Diamond City
Senior Member
Hi gurus,

My problem continues in uploading file.
Please provide suggestion if any.
I am using FTP package available on link
http://www.oracle-base.com/dba/miscellaneous/ftp.pkb
And I am using that package as

DECLARE
  l_conn  UTL_TCP.connection;
BEGIN
  l_conn := ftp.login('198.168.101.25', '21', 'dev', 'eloper');
  ftp.ascii(p_conn => l_conn);
  ftp.put(p_conn      => l_conn,
          p_from_dir  => 'SEO_DIRECTORY',
          p_from_file => 'file1.txt',
          p_to_file   => 'file1.txt');
  ftp.logout(l_conn);
  utl_tcp.close_all_connections;
END;


while using like this,
SQL *Developer hangs, nothing is shown in output.
But one blank file is created on ftp server with name file1.
Don't know why it is not writing(uploading) data in file.

regards,
Delna
Re: Problem in uploading file [message #395981 is a reply to message #395975] Fri, 03 April 2009 07:15 Go to previous messageGo to next message
Frank
Messages: 7880
Registered: March 2000
Senior Member
Here's some tips on how to debug stuff like this (i.e. a package that seems to be doing nothing)

Create a table containing a date or timestamp and a large text column
Create a procedure with pragma autonomous transaction that writes its input into the text column of the table, together with sysdate/systimestamp
Sprinkle your code with (conditional!! you do NOT want this in PROD) calls to this procedure.

Now you can trace the run of the procedure by selecting the data from the table. That way it's easier to pinpoint where the code "hangs"
Re: Problem in uploading file [message #395982 is a reply to message #395981] Fri, 03 April 2009 07:23 Go to previous messageGo to next message
delna.sexy
Messages: 941
Registered: December 2008
Location: Surat, The Diamond City
Senior Member
Thank you frank sir.

I am going to follow your advice.
But there is another problem also that
It does create blank file on ftp server.
In does not write anything in that.

regards,
Delna
Re: Problem in uploading file [message #395984 is a reply to message #395982] Fri, 03 April 2009 07:26 Go to previous message
Frank
Messages: 7880
Registered: March 2000
Senior Member
As you can see in the code, the put_remote_ascii_data procedure loops through the data found in your infile.
I did not investigate, but this might be an infinite loop, other things may be faulty.
Previous Topic: Using Substr
Next Topic: Financial week and year problem
Goto Forum:
  


Current Time: Wed Dec 07 03:07:01 CST 2016

Total time taken to generate the page: 0.11415 seconds