Quantcast
Channel: SCN : Discussion List - SAP HANA Developer Center
Viewing all articles
Browse latest Browse all 6412

XSDS - Different join conditions

$
0
0

Hi!

 

I have two legacy tables (created via script and not using hdbtable or hdbdd files). I defined them using $defineEntity of XSDS and I want to create an association between them.

 

After lots erros I could managed like below.

 

XSDS.$defineEntity("tab1", "\"SM\".\"TAB1\"", {

        FK1: {

          $association: {

            $entity: "tab2", // already defined in XSDS

            $on: "$SOURCE . \"FK1\" =  $SOURCE.\"FK1 FK1\" "

          }

        }

      }, {

        $entityName: "tab1",

        $schemaName: "SM"

      });

 

I know my $on condition looks very wierd... but it it worked somehow.

 

With the help of $sql method I could see that the generated query was using a LEFT OUTER JOIN.

 

So, I want to change the Join condition. Documentation has no information about that and the example of using Unmanaged Condition below is very limited.

 

$on: join-cond

 

There is a $SOURCE tag but not $TARGET..

 

In summary:

  • how to write the $on condition properly
  • how to change the join type to Inner join for example?

 

Thanks!


Viewing all articles
Browse latest Browse all 6412

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>