-- define output file in override mode with header
output csv C:\temp\outputfile.csv replace;
format csv delimiter ; header true quote false;
-- connect to first datasource and run SQL statement
connect HSQLDB - Embedded.TEST1@<null>;
select 'ENV1' as env,owner,type,name from tt;
-- change output file in append mode without header
output csv C:\temp\outputfile.csv append;
format csv delimiter ; header false quote false;
-- connect to second datasource and run SQL statement
connect HSQLDB - Embedded.TEST2@<null>;
select 'ENV2' as env,owner,type,name from tt;
-- connect to third datasource and run SQL statement
connect HSQLDB - Embedded.TEST3@<null>;
select 'ENV3' as env,owner,type,name from tt;
-- create a datasource "temp" using csvjdbc given in the lib directory
-- driver: org.relique.jdbc.csv.CsvDriver
-- url: jdbc:relique:csv:C:\temp?separator=;
-- display in grid format the result of the pivot table
connect CsvJdbc.temp@<null>;
output grid ;
SELECT
OWNER, TYPE,
SQLeoPivot(outputfile,ENV,count,NAME)
FROM
outputfile
GROUP BY
OWNER, TYPE;
-- all this can be run by typing
CTRL-A
CTRL-Enter
Last edit: PAscal 2015-11-03
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
-- get help
help ;
-- define output file in override mode with header
output csv C:\temp\outputfile.csv replace;
format csv delimiter ; header true quote false;
-- connect to first datasource and run SQL statement
connect HSQLDB - Embedded.TEST1@<null>;
select 'ENV1' as env,owner,type,name from tt;
-- change output file in append mode without header
output csv C:\temp\outputfile.csv append;
format csv delimiter ; header false quote false;
-- connect to second datasource and run SQL statement
connect HSQLDB - Embedded.TEST2@<null>;
select 'ENV2' as env,owner,type,name from tt;
-- connect to third datasource and run SQL statement
connect HSQLDB - Embedded.TEST3@<null>;
select 'ENV3' as env,owner,type,name from tt;
-- create a datasource "temp" using csvjdbc given in the lib directory
-- driver: org.relique.jdbc.csv.CsvDriver
-- url: jdbc:relique:csv:C:\temp?separator=;
-- display in grid format the result of the pivot table
connect CsvJdbc.temp@<null>;
output grid ;
SELECT
OWNER, TYPE,
SQLeoPivot(outputfile,ENV,count,NAME)
FROM
outputfile
GROUP BY
OWNER, TYPE;
-- all this can be run by typing
CTRL-A
CTRL-Enter
Last edit: PAscal 2015-11-03