The SqlRender package translates SQL to the target database dialect. In this case, it should have transformed CONCAT with more than 2 arguments into nested CONCATs (Oracle does have CONCAT, it just doesn’t support more than 2 arguments). It seems there is a bug in the mapping so it failed to do that.
I opened an issue against SqlRender, since the philosophy as I understand it is “write MS SQL Server SQL and let SqlRender translate it for other databases.” But I’m not set up to build or test SqlRender.
There isn’t anything wrong with changing the query to use nested concats, but I think that’s working around the problem rather than fixing it. Sometimes a workaround is the pragmatic path to a quick solution, though.
The query in question isn’t subject to SqlRender translation. It’s a WebAPI database call that goes through Hibernate to do the translation. However, in this case, it uses a custom query that will need to be written in a cross-dialect manner. I think this is the most pragmatic approach in this case, but it would be good to handle it for other queries that run through SqlRender.
Ouch. Looking at the SqlRender transformations, it looks like netezza and sqlite do not support concat, and of course SQL Server does not support the SQL standard “||” operator, using “+” instead. Writing a cross-dialect query that uses string concatenation could be a challenge.