$sth = $dbh->prepare("select CODE_ID,NAME_CODE,SUM(INR_COL + OUT_COL) AS "TOTAL SUM" from nwsa where CODE_ID='L01A' OR CODE_ID='L01B'OR CODE_ID='L01C' OR CODE_ID='L01D' OR CODE_ID='L01DA' OR CODE_ID='L01E' OR CODE_ID='L02A' OR CODE_ID='L02B' OR CODE_ID='L02C' OR CODE_ID='L02E' OR CODE_ID='L02N' group by CODE_ID,NAME_CODE "); # your query here
$sth->execute( );
$out = DBIx::Dump->new('format' => csv, # excel or csv
'output' => $FILENAME, # file to save as
'sth' => $sth);
error coming as bareword found near "TOTAL SUM" .. what is the error..?
Escape the quotes:
or use single quotes: