Forum OpenACS Q&A: Re: .xql file

Collapse
3: Re: .xql file (response to 1)
Posted by Don Baccus on
I'll make the statement more strongly - packages we release will have the queries separated out in query files because we're interested in supporting both Oracle and PG as "equal citizens."

And this requires customizing a considerable number of queries, though the number will shrink as future versions of Oracle and PostgreSQL gravitate towards supporting the SQL 99 standard.

We decided early on we'd rather put all queries in query files rather than attempt to pick-and-chose those that need customization.  One reason for that decision was to make it easier to port to a third database.  At the time there was a lot of interest in InterBase as an alternative to PostgreSQL, though InterBase now appears to be going no where fast (or slow, for that matter.)

But as Robert says - if you're writing a custom package for your own use that doesn't need to support both Oracle and PostgreSQL, isn't generalized and won't be part of a standard suite or packages or part of our contrib suite of code, then there's absolutely nothing wrong with writing your queries inline.  It's easier and more convenient to do so, the value of extracting them to query files lies only in simplifying the porting process to various RDBMS back ends.