3 Replies Latest reply on Dec 7, 2017 5:51 AM by rareddy

    SOURCE_NAME - source database, table,column in model

    omarbkhan

      Hi,

       

      I did some reading about SOURCE_NAME, but not entirely clear on how we could use it.

      MultiSource Models · Teiid Documentation

       

      Could we get in the SQL from teiid from the model the source database, table, and column - which perhaps could be used as a composite key from a source. Not sure what it would include? Or if it's limited to multi-source models?

       

      Omar

        • 1. Re: SOURCE_NAME - source database, table,column in model
          rareddy

          It is relevant only in the multi-source models. This defines the name of the source, which you define when building the VDB with multiple sources. Using this you can reduce the query from fanning into querying multiple sources, into single or selective sources by using this column in the "where" clause. If you make it part of the view PK that is fine.

           

          I do not think I fully understand your question either, so you want to rephrase it  what you are looking for I can answer.

          • 2. Re: SOURCE_NAME - source database, table,column in model
            omarbkhan

            Hi Ramesh,

             

            Sorry if I wasn't clear. Let me try to rephrase it....

             

            Is there a way that we can use Teiid to query data and then construct a file where each record is a key-value pair.


            The key is a composite key that identifies the source database, table, and column. The value is the actual source value.
            We feed this file into a data masking engine, the data masking engine outputs a masked file.
            We then feed the masked file and the original unmasked file to a QA group validate integrity of the masking.
            Once validated we transmit the file to another server. We then use Teiid to load each of the target data stores on another server based on the composite key?

             

            Omar

            • 3. Re: SOURCE_NAME - source database, table,column in model
              rareddy

              Yes, I believe so. Most what you are asking are client side activities like creation of file and masking etc. The only information from Teiid is SOURCE_NAME and table name is given from your query. The so a query like

               

              Select SOURCE_NAME, 'foo' as table_name, mycol from Foo

               

              Should get results you looking for. As per loading in separate server is not a feature that Teiid supports. You would need to create another utility load into table(s). Or You could try using the file translator to load the data and materializing to your target database(s).

               

              Ramesh..