1 Introduction

To write SQL statements, Deister has created a grammar for Axional Studio in order to have automatic compatibility with the different database agents supported by the system. The xml2sql transformations act on demand, adapting to the engine on which database access operations are applied.

 

2 Conversion process

This section shows the process that is developed to convert an XML text into an SQL statement. You can write XML code in the statement of a dictionary object (wic_jrep_object), in the physical dictionary of tables (wic_table_object) and in the definition of triggers (wic_trig_object). When the XML code is inserted, after saving the changes, the following operations are performed:

  • 1. DTD validation: the purpose of a DTD (Document Type Definition) is to define the correct construction of an XML document. The DTD document defines the structure of the document with a list of legal elements, specifies the elements that can be used, the attributes of the elements, the values of the elements and attributes, the order of the elements... This serves to verify that text is well formed and has been written following specifications.
  • 2. Code Transformation: once code is validated, it will be transformed to SQL language to execute into a specific database. The strength of transformation process is that is independent of database agent, and can transform the code considering the particularities of major databases agent.

If errors should occur:

  • DTD validation errors: errors are shown at the end of the XML text. For each error, the line and column where it occurred and the cause of the error are indicated. Also, in the XML text itself, the lines that contain error appear in a different color at the bottom of the block and with an icon at the beginning of the line that contains in the ALT the cause of the error.
  • Transformation errors to the BD agents: the DTD validation has been carried out successfully and the transformation to the different agents is performed, but an error could occur during this process. If this was the case, the cause of the transformation error would be shown at the end of the XML text.

In both cases, if an error occurs, the tabs are not shown to display the generated SQL code for the different agents.