generate text file [message #213016] |
Tue, 09 January 2007 02:42 |
wreyaz
Messages: 44 Registered: April 2006 Location: Saudi Arabia
|
Member |
|
|
I want to create a text file (emp.txt) with the following code under when_button_pressed trigger, i am using forms 10g.
Declare
Cursor C1 IS SELECT * FROM pp_emp_mast WHERE
comp = :global.comp AND STS_FLAG != 'D' AND EMPNO != 0
ORDER BY EMPNO;
x sc_circular%rowtype;
out_file CLIENT_Text_IO.File_Type;
eno char(5);
nm CHAR(45);
bs CHAR(15);
tot CHAR(15);
Begin
out_file := CLIENT_Text_IO.Fopen('c:\EMP.txt','w');
FOR x IN C1
LOOP
ENO := nvl(x.EMPNO,' ');
CLIENT_Text_IO.Put(out_file,ENO);
NM := nvl(x.ENAME,' ');
CLIENT_Text_IO.Put(out_file,NM);
BS := lpad(nvl(x.F_BASIC,0.00),10,' ');
CLIENT_Text_IO.Put(out_file,BS);
TOT := lpad(to_char(nvl(x.T_SAL,0.00)),10,' ');
CLIENT_Text_IO.Put(out_file,TOT);
CLIENT_Text_IO.New_Line(out_file,1);
END LOOP;
CLIENT_Text_IO.Fclose(out_file);
MessageBox('message','Text File Generated..');
:global.view := 'Y';
End;
The module is working without any errors, but when i press the button to generate the text file, it didn't create the 'emp.txt' file. (it does nothing).
Is there any thing missing in the code? Please help me to solve the problem.
|
|
|
|
|
|
|
|
|
|