Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    qualifyColumnNames for multiple table

    Hi,
    I have cross reference table that I am pulling data from multiple reference tables to some mapping tables. These tables have the same field name ie. "name" and "name" to be generic. When I look at the result data from the query I can see the reference object data, however the field "name" is obmitted?

    I tried setting the qualifyColumnNames to true with no luck on the result data.

    Anyway, I was wondering what I need to do in this case?

    Thanks,

    #2
    See the QuickStart Guide chapter on SQL Templating. You should set "tableName" on the DataSourceField to indicate that a field is from another table.

    Comment


      #3
      Yes I did set the field from the other table.

      <DataSource ID="esdProductLine"
      serverType="sql"
      tableName="ESD_PRODUCT_LINE"
      qualifyColumnNames="false">
      <fields>
      <field name="id" type="sequence" primaryKey="true" hidden="true" />
      <field name="productname" type="text" required="true" length="100" title="Product Line"/>
      <field name="status" type="enum" title="Status" required="true"
      length="1">
      <valueMap>
      <value ID="A">Active</value>
      <value ID="I">Inactive</value>
      </valueMap>
      </field>

      <field name="tblname" type="text" customSQL="true" tableName="esdTbl" />

      <field name="user_added" type="text" length="30" hidden="true" />
      <field name="user_added_date" type="datetime" hidden="true" />
      <field name="user_modified" type="text" length="30"/>
      <field name="user_modified_date" type="date" title="Modified Date" />

      </fields>
      <schema>ESD</schema>
      <serverObject lookupStyle="new" className="com.halliburton.lgc.esd.server.ProductLineDMI"/>

      <operationBindings>
      <operationBinding operationType="fetch"
      customValueFields="tblname"
      customCriteriaFields="tblname">
      <selectClause>$defaultSelectClause, esdTbl.tblname as tblname </selectClause>>
      <tableClause>esdProductLine, esdTbl</tableClause>
      <whereClause>esdProductLine.tbl = esdTbl.id AND ($defaultWhereClause)</whereClause>
      </operationBinding>
      </operationBindings>
      </DataSource>


      Reference table

      <DataSource ID="esdTbl" serverType="sql" tableName="ESD_TBL" qualifyColumnNames="false">
      <fields>

      <field name="id" type="sequence" primaryKey="true" sequenceName="ESD_SEQ" hidden="true" />
      <field name="tblname" type="text" required="true" length="200" title="Business Line"/>
      <field name="status" type="enum" title="Status"
      length="1">
      <valueMap>
      <value ID="A">Active</value>
      <value ID="I">Inactive</value>
      </valueMap>
      </field>
      <field name="user_added" type="text" length="30" hidden="true" />
      <field name="user_added_date" type="datetime" hidden="true" />
      <field name="user_modified" type="text" length="30"/>
      <field name="user_modified_date" type="date" title="Modified Date" />
      </fields>
      <schema>ESD</schema>
      <dbName></dbName>

      <serverObject lookupStyle="new" className="com.halliburton.lgc.esd.server.TBLDMI"/>
      </DataSource>

      Comment


        #4
        Have you read the QuickStart sections on SQL Templating? Because there's an explanation in there of how to tackle this exact use case and further there's a link to this sample which covers the same thing, yet you seem to be using some other properties (customCriteriaFields, customValueFields) which have an unrelated purpose and are not needed here.

        Comment

        Working...
        X