text_io

text_io

 

  

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) ;

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

Thanks,
Abhinav
abhinav.[Email address protected]

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;
--------------------------------------------------------

NOTICE: If received in error, please destroy and notify sender. Sender does not intend to waive confidentiality or privilege. Use of this email is prohibited when received in error.

Oracle LazyDBA home page