Automated SC tables export

Dear all,

I’ve a Double Select field where I read all DB tables of my SC application.

SELECT table_name FROM INFORMATION_SCHEMA.TABLES
WHERE table_schema = ‘associations_mng’

The result of it is an array with the list of selected tables separated by a “;”.
For istance:
[size=14pt]
activities;activitygroups;activitytypes;agencies;board;calendar[/size]

Now my willing is to make an export of selected tables for istance as CSV file or XLS.

What can I do and which is the code I have to insert in ON VALIDATE event ?

Thanks
Giovannino