Example: exporting only database tables

Previous Next

This example is a solution to problems you may run into if the following statement raises an error when attempting to query a component table:

INVOKE XML.MultiExportTables WITH SELECT
    '(.*)'

To get around this error, you can call usmeta.tables(). The following example exports database tables, but not other types of table:

INVOKE XML.MultiExportTables WITH 
SELECT usxsl.apply
   (
      usmeta.tables()
   ,   '<?xml version="1.0" encoding="windows-1252"?>
        <xsl:stylesheet  version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
          <xsl:output method="text" encoding="UTF-8" omit-xml-declaration="no"/>
 
          <xsl:template match="/">
            <xsl:for-each select="*/*/*[@TABLE_TYPE=''DATABASE'']">
               <xsl:if test="position() &gt; 1">|</xsl:if>
               <xsl:value-of select="@TABLE_NAME"/>                
             </xsl:for-each>
           </xsl:template>
 
         </xsl:stylesheet>'
   )
,   'ConvertWhiteSpaces', 'yes'
,   'ProcessingInstruction', 'yes'
,   'WriteOutputTo', 'c:\temp\mydatabasetables.xml'

 

See also

XML.MultiExportTables

USMeta.Tables