Unanswered: syntax error near unexpected token `('
total2: line 1: syntax error near unexpected token `('
total2: line 1: `db2 "select COALESCE(prod_type, 'TOTAL') as "Prod Type", cast(to_char(count(prod_type),'99,999') as char(10)) as "Customer(#)" from dm.ref_to_date_prod_pilot group by Prod_type with ROLLUP order by Prod_type" >> todate-prod.out2'
I ran the above select statement alone using 'db2 -tvf <file>', it ran successfully.
However, with the same query after adding db2 "select ...." in a unix file and executed it using 'sh +x <script>', I got syntax error near expected token. `('