Seen below is my mysql query which creates the output I want. My goal is to get the output into a grid created in Scriptcase.
I can’t figure out where to write my @sql variable, or where to execute it. I’ve tried to place the code to create it in the onapplicationinit event, but SC doesn’t like it.
SET @sql = NULL;
SELECT
GROUP_CONCAT(DISTINCT
CONCAT(
“sum(case when wohdate2 = '”, wohdate2,"’ then contract_price else 0 end) as ", wohdate2, "
"
)
)
into @sql
from wohdata;
SET @sql = CONCAT('SELECT woh_job_desc, ‘, @sql, ’ FROM wohdata GROUP BY woh_job_desc’);
PREPARE stmt FROM @sql;
EXECUTE stmt;