Create a FETCH command

To build a report the first thing to do is check if a FETCH command already exists that returns the required data.  If one exists, you are ready to Create a Pitram Report. If not, you can create a new FETCH command. The easiest way to do this is to modify an existing one.

  1. First, create an SQL query that returns the data you require for the report.
  2. Secondly, make a copy of an existing FETCH command file and rename the file. FETCH commands are located in the following folder:
  3. C:\Program Files\Micromine PtyLtd\Micromine DOMEConnector\Config\<sitename>\Pitram\ODBC\REPORTING

  4. Open the copied and renamed file and make the following edits:
  5. In the <m_commandName> tags, type the name of the new FETCH command. The command name must match the name of the file

    Inside the <m_queryTemplate> tags and inside the <![CDATA[ and ]]> opening and closing tags, replace the existing SQL query with your new query: 

    <?xml version="1.0" encoding="utf-8"?>

    <PITRAMCommandDefinitionxmlns:xsd="http://www.w3.org/2001/XMLSchema"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

    <m_commandName>FetchTestReport</m_commandName>

    <m_queryTemplate>

    <!

    -- INSERT YOUR QUERY HERE

    ]]>

    </m_queryTemplate>

    </PITRAMCommandDefinition>

     

    To edit FETCH commands and queries, use a good text editor such as Notepad++.

    When an SQL statement is wrapped automatically, the SQL statement may not compile correctly. Also, some SQL implementations may not permit a statement or clause to be split over more than one line.

    Refer to the SQL Examples chapter for more information.

  6. Save your changes to the FETCH Command file in the same folder:
  7. C:\Program Files\Micromine PtyLtd\Micromine DOMEConnector\Config\<sitename>\Pitram\ODBC\REPORTING

Create a Pitram Report