Re: o:XML Syntax
Martin Klang <[email protected]> Thu, 26 Aug 2004 11:33:58 +0100
| Newsgroups | gmane.text.xml.o-xml |
|---|---|
| Message-ID | <[email protected]> |
On 25 Aug 2004, at 16:30, Dave Jarvis wrote: > Hi, Martin. > >> Thanks for the kind words! > > My pleasure. > >>> Instead of having to supply the same SQL information for every call, >> I'm afraid I don't quite understand. Are you referring to the >> connection details? Or db:query params? The latter could allow >> default values, but > > The connection details, similar to setting the log output stream. put them in a separate file, and XInclude that file ie <o:program> <xi:include href="connection.xml"/> ..stmts.. </o:program> you can define several connections and use them as such: <db:query connection="ex:ora1">...</db:query> <db:execute connection="ex:mysql" sql="xxx"/> > Now if you would like another idea, consider a framework around the > SQL that would allow pluggable equivalent code to be written. > Apologies for not using your syntax, however, here is an example of > what I'm thinking: to achieve db independence? I will always recommend using straight, standard SQL throughout the application layer. If this really isn't possible, though most of the time it is, then at least isolate all platform dependent db access. Now how about this for an idea: - First define an XML vocabulary for SQL queries - let's call it SQL-ML. - Build an SQL query parser that generates SQL-ML queries. - Develop XSL transformations that changes eg Oracle-specific constructs to SQL-Server format, etc. I'm not an expert on SQL db variations, but I think this approach will work because statements can be replaced, rearranged, rewritten by the transformation. For example Oracle sequences can be easily simulated on other platforms. With extensions for PL-SQL you could even transform stored procedures to code and queries executed on the client side. > Then consider a vendor-neutral fashion for executing some SQL: > > <sql source-file="update-users.oxml" /> With a flexible db object model, as intended for the next db release, it should be quite easy to implement very flexible batch-execution. /m ______________________________________________________________________ This email has been scanned by the MessageLabs Email Security System. For more information please visit http://www.messagelabs.com/email ______________________________________________________________________