Translate

Monday, 10 December 2012

AE out bound code to excel file

Local Record &rec;
Local File &file;
Local string &SEP = Char(9);

&file = GetFile("C:\temp\Envtt.XLS", "W", %FilePath_Absolute);
REM &arr = CreateArrayRept("", 0);

If &file.IsOpen Then
   &rec = CreateRecord(Record.EMP1); /*creating temp buffer table emp1 */
   &SQL = CreateSQL("SELECT * FROM PS_EMP1");
   While &SQL.FETCH(&rec)
      &DNO = &rec.DEPTNO.Value;
      &DNAME = &rec.ENAME.Value;
      &SAL = &rec.SAL.Value;
      &hidate = &rec.HIREDATE.Value;
      &file.WriteLine(&DNO | &SEP | &DNAME | &SEP | &SAL | &SEP | &hidate);
     
   End-While;
End-If;
&file.Close();

No comments:

Post a Comment