News for hackers. Stuff that matters.
Re:Ask HN: How do you store your external SQL statements? by svisser on Sunday July 19, 2015 @04:43PM (#9912752)
How about .sql files?
Re:Ask HN: How do you store your external SQL statements? by ajuc on Sunday July 19, 2015 @05:28PM (#9912892)
I imagine the problem is with assigning names to them.

Usually I've seen people keeping them in hibernate xml with named queries, or some proprietrary .xml files.

CDATA is overkill IMHO, easier to escape the few problematic characters.

Re:Ask HN: How do you store your external SQL statements? by SayWhatIMean on Monday July 20, 2015 @01:19AM (#9914124)
Nice becuase you can get SQL syntax highlighting.
Re:Ask HN: How do you store your external SQL statements? by angersock on Sunday July 19, 2015 @05:16PM (#9912850)
This.

Remember, SQL statements are source code.