I'll preface this question by saying that I am very new to professional software dev.
I work on a team that takes data in from other groups in my company and turns this data into reports usable by business execs.
In the process of transferring and parsing data we have some SQL statements that do a lot of processing of the data. Nearly every
CAST etc extensively to reduce fields to the proper size and format. Additionally there are a lot of special cases that are accounted for by using
CASE statements within
The Teradata server software that we use emits remarkably cryptic error messages. As a result we do a lot of guesswork about what data is breaking which SQL statement.
My question is: would it be a good idea to reduce these somewhat complex SQL statements to a less complex form that omits the processing and special case handling, and instead do this work in an external script or program? Does this make any sense?