ERROR: syntax error at or near ")"
(CASE WHEN C\_Invoice.AD\_Org\_ID IS NULL THEN '' ELSE (TO\_CHAR(table2.Name) ) END) AS AD\_Org\_IDR,
C\_Invoice.C\_Order\_ID,
(CASE WHEN C\_Invoice.C\_Order\_ID IS NULL THEN '' ELSE (TO\_CHAR(table3