This functionality aims to save the data processing defined in the ETL file in a splx file in the form of an SPL script. After the SPL script is executed, you can generate the actual data file according to the exported settings.
Click Tool -> Create SPLX File in the above ETL interface and save the splx file as EmpForETL.splx. Below is content of the script:
|
A |
1 |
=connect("demo") |
2 |
="D:\\file\\ETL\\" |
3 |
=A1.query("SELECT Distinct GENDER FROM EMPLOYEE") |
4 |
=A3.(GENDER).new(#:gender_id,~:gender).keys@i(gender) |
5 |
=file(A2+"EMPLOYEE_GENDER.btx").export@b(A4) |
6 |
=file(A2+"department.txt").import@t(DEPT,MANAGER;," ") |
7 |
=A6.keys@i(DEPT) |
8 |
=file(A2+"department.btx").export@b(A6) |
9 |
=A1.cursor("SELECT EID,NAME,GENDER,BIRTHDAY,DEPT,SALARY FROM EMPLOYEE ") |
10 |
=A9.new(#@:id,EID,NAME,A4.pfind(GENDER):GENDER,BIRTHDAY,A7.pfind(DEPT):DEPT,SALARY,age(BIRTHDAY):AGE) |
11 |
=file(A2+"EMPLOYEE.ctx").create@yp(#id,EID,NAME,GENDER,BIRTHDAY,DEPT,SALARY,AGE).append(A10).close() |
12 |
=A1.close() |
Execute the script in IDE and EMPLOYEE.ctx, EMPLOYEE_GENDER.btx and department.btx are generated in D:/file/ETL. Here are the three files:
EMPLOYEE.ctx:
EMPLOYEE_GENDER.btx:
department.btx: