0 Replies Latest reply on Mar 13, 2014 9:10 PM by wanglei

    To perform VDBs the SQL query for help

    wanglei

      I use Jboss as 7 and Teiid8.2 to create a VDBs database. Use the datasource is sybiq database.

      VDB configure is:

      <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
      <vdb name="MyVDB" version="1">
      <description>My sybiq VDB</description>
      <property name="UseConnectorMetadata" value="true" />
      <model name="sybiq21w">
              <property name="importer.useFullSchemaName" value="true"/>
              <source name="sybiq21" translator-name="sybase" connection-jndi-name="java:sybiq21DS"/>
      </model>
      <model name="sybiq22w">
              <property name="importer.useFullSchemaName" value="true"/>
              <source name="sybiq22" translator-name="sybase" connection-jndi-name="java:sybiq22DS"/>
      </model>
      </vdb>

      DataSource sybiq21w(sybiq22w) configure is:

      <datasource jndi-name="java:/sybiq21DS" pool-name="sybiq21DS" enabled="true" use-java-context="true">
          <connection-url>jdbc:sybase:Tds:172.1.0.21:2640/dmpiq1</connection-url>
          <driver>sybase</driver>
          <security>
              <user-name>zcss7db</user-name>
              <password>zcss7db</password>
          </security>
      </datasource>
      <datasource jndi-name="java:/sybiq22DS" pool-name="sybiq22DS" enabled="true" use-java-context="true">
          <connection-url>jdbc:sybase:Tds:172.1.0.22:2640/dmpiq1</connection-url>
          <driver>sybase</driver>
          <security>
              <user-name>zcss7db</user-name>
              <password>zcss7db</password>
          </security>
      </datasource>
      
      

      Sybiq21w datasource and datasource sybiq22w hava a table vmt, and this table vmt with the same name and same structure. The table of VMT column id and column name to query. Now, to query the table vmt use vdbs.

      Ask: How to set I can use the sql as: s a aelect id,name from vmt elselect id,name from vmt ect id,name from vmt

      select id,name from vmt 
      
      

      rather than use the sql as:

      select id,name from sybiq21w.zcss7db.dmpiq1.vmt as 21w union all select id,name from sybiq22w.zcss7db.dmpiq1.vmt as 22w