I’m looking for a solution that will format SQL statements from within a Delphi application.
No visual interface is required, just something that when passed a string containing an SQL query will return the same statement with some sort of sensible formatting.
That one’s no good. The parser unit is provided in DCU form and he provides the DCU for just one Delphi version. He doesn’t even tell you which Delphi version the DCU is for. Too big a risk to rely on, even if he did supply versioned DCUs.
I have a very simple SQL formatter we used years ago. Not sure if it would work for you. Do you have a simple example I could run through it to see what it gives?
SELECT studentID
, FullName
, sat_score
, recordUpdated
FROM student
WHERE ( studentID BETWEEN 1 AND 5
OR studentID = 8
OR FullName LIKE '%Maximo%' )
AND sat_score NOT IN ( 1000, 1400 )
SynEdit highlights as … (new lines inserted by me)
Which one is that? If it’s the SqlToys/SqlFormatter repository on GitHub I’ve eliminated that one from consideration already due to the DCU issue but I’m curious about which Delphi version you built the EXE with.