vasanth
I'm new here

How to form Inner Query in Query template ??

Hello All,

I am a novicw to First Spirit, I am having 3 tables, please see the below pictures and its relation

hrs table issue.jpg

In the form of Table 1, i have show the name of Table 2 and its relavant information of Table 3 (In separate column). Is it possible to have inner query in <QUERY> to get the table 3 info from the table 1 ?? or which is the best way to implement this feature..

Advance Thank you !!!.

Regards,

Vasanth

0 Kudos
3 Replies
broszeit
I'm new here

Hello Vasanth,

what do you mean with an inner join? A subselect or a real join?

You can access the data from other tables via dot notation.

For example when you query for Table1 you can get the name in Table3 like that:

Table2.Table3List.get(0).Name

Note: If you have a List you have to iterate over it or just select the first element by get(0);

Regards,

Rouven

0 Kudos

Hello Rouven,

Its a real join rouven. My aim is to display the Table 3 Names (nameList) in the Table 1's Template's form

From your above explanantion, if i want to see the table 3 Name in the Table 1 form will look like below code

<CMS_INPUT_COMBOBOX name="cs_table_1" hFill="yes" singleLine="no" useLanguages="no">

    <CMS_INCLUDE_OPTIONS type="database">

      <LABELS>

        <LABEL lang="*">#item.table3List.get(0).Name</LABEL>

      </LABELS>     

      <TABLE>schema.table2</TABLE>

    </CMS_INCLUDE_OPTIONS>

    <LANGINFOS>

      <LANGINFO lang="*" label="Name"/>

    </LANGINFOS>

  </CMS_INPUT_COMBOBOX>

But is it possible to show all values of the table3List in the Table 1 Form ??

Thank You,

Vasanth

0 Kudos

Can you provide some information about the particular usecase? Which relationships do you want to project with this database scheme?

Which entries do you want to show in the form of table 1? All entries which are in table3 or only those which match a special condition? If so: What is the condition?

Regards,

Rouven

0 Kudos