This tag is used to perform several nested SQL queries. The tag union will be as the tag root which encapsulates the selects.

1 union

<union
    prefix='prefix'
    type='all'
    prepare='true|false'
>
    <select /> *
</union>
Example

Queries sqls with union.

Copy
<xsql-script name='sql_sql2xml1'>
    <body>

        <foreach>
            <union prefix='m_'>
                <select>
                    <columns>'COM' tab, gcompedh.third</columns>
                    <from table='gcompedh' />
                </select>
                <select>
                    <columns>'VEN tab, gvenpedh.third</columns>
                    <from table='gvenpedh' />
                </select>
            </untion>
            <do>
                <println><m_tab/>: <m_third /></println>
            </do>
        </foreach>
    </body>
</xsql-script>