Home » Developer & Programmer » Forms » text_io
text_io [message #212174] Thu, 04 January 2007 02:54 Go to next message
abhisax1
Messages: 1
Registered: January 2007
Junior Member
Hi all,

I am using forms 6i. my database is oracle 9.2.0.7

I am using text_io to read/write files to the Operating system,
the problem is if i am running form in a normal way i is working fine but if i am running it in debug mode I am getting ORA-00600 error at line no. 21 (Utl_File.Get_Line(l_Unix_File,l_Line_Buffer) Wink

Sometimes i am getting this error while running in a normal way also.
can anyone help why this is happening.

Thanks,
Abhinav
abhinav.saxena@morganstanley.com

PROCEDURE p_xml_Transfer_Test
     (p_Local_File  IN VARCHAR2,
      p_uNix_File   IN VARCHAR2,
      p_Get_Put     IN VARCHAR2)
IS
  l_Local_File          Text_io.File_Type;
  l_uNix_File           utl_File.File_Type;
  l_Stripped_uNix_Name  VARCHAR2(300);
  l_Stripped_uNix_dir   VARCHAR2(1000);
  l_Line_Buffer         VARCHAR2(2000);
  Do_Nothing            EXCEPTION;
BEGIN
  l_Stripped_uNix_Name := Substr('/u/mstesttcs/abhi_test',Instr('/u/mstesttcs/abhi_test','/',- 1) + 1);
  l_Stripped_uNix_dir := Substr('/u/mstesttcs/abhi_test',1,Instr('/u/mstesttcs/abhi_test','/',- 1) - 1);
  
  IF p_Get_Put = 'GET' THEN
    l_uNix_File := utl_File.Fopen(l_Stripped_uNix_dir,l_Stripped_uNix_Name,
                                  'r');
    l_Local_File := Text_io.Fopen(p_Local_File,'w');
    
    BEGIN
      LOOP
        utl_File.Get_Line(l_uNix_File,l_Line_Buffer);
        Text_io.Put_Line(l_Local_File,l_Line_Buffer);
      END LOOP;
    EXCEPTION
      WHEN No_Data_Found THEN
        utl_File.fClose(l_uNix_File);
        Text_io.fClose(l_Local_File);
    END;
  ELSIF p_Get_Put = 'PUT' THEN
    l_Local_File := Text_io.Fopen(p_Local_File,'r');
    
    BEGIN
      l_uNix_File := utl_File.Fopen(l_Stripped_uNix_dir,l_Stripped_uNix_Name,
                                    'W');
    EXCEPTION
      WHEN OTHERS THEN
        Message('Unable to FTP file:'
                ||p_Local_File
                ||chr(10)
                ||'This file may already exists on server with read only permissions.');
        
        RAISE Do_Nothing;
    END;
    
    BEGIN
      LOOP
        Text_io.Get_Line(l_Local_File,l_Line_Buffer);
        utl_File.Put_Line(l_uNix_File,l_Line_Buffer);
      END LOOP;
    EXCEPTION
      WHEN No_Data_Found THEN
        utl_File.fClose(l_uNix_File);
        Text_io.fClose(l_Local_File);
      WHEN OTHERS THEN
        Message('Error at Stmt: '
                ||' Error:'
                ||SQLERRM);
    END;
  END IF;
EXCEPTION
  WHEN Do_Nothing THEN
    NULL;
  WHEN Value_Error THEN
    Message('The Line Size Exceeds Max Line Size');
    Message('The Line Size Exceeds Max Line Size');
    RAISE;
END;

[Updated on: Thu, 04 January 2007 05:54] by Moderator

Report message to a moderator

Re: text_io [message #212247 is a reply to message #212174] Thu, 04 January 2007 05:58 Go to previous message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
Have you googled 'ORA-00600'?

Have a look at http://www.dba-oracle.com/oracle_tips_ora_600.htm

Have you defined the output directory to your database?

David
Previous Topic: Record has already been inserted- Error message
Next Topic: Accessing Remote Database and Error connecting to Remote Database (merged)
Goto Forum:
  


Current Time: Mon Dec 05 09:06:11 CST 2016

Total time taken to generate the page: 0.13533 seconds