Querying the backend datastore tables using SQL to find details on the parent - child relationship defined in concepts.

Querying the backend datastore tables using SQL to find details on the parent - child relationship defined in concepts.

book

Article ID: KB0084579

calendar_today

Updated On:

Products Versions
TIBCO BusinessEvents Enterprise Edition -
Not Applicable -

Description

Resolution:
Description:
============
How to query the backend datastore tables using SQL to find the details on the parent - child relation ship defined in concepts (both inheritance and contained concepts).


Environment:
===========
   o TIBCO BusinessEvents 3.0.1, 4.0.1
   o Oracle Database 10g, 11g


Resolution:
==========

To query on a Reference relationship:
------------------------------------

Ex: Concept Order - references - Concept Customer

In oracle types, the below query can be used to get a list of order ids that refer a customer id of ‘Customer1’.

select r.id$ from d_Customer d, table (d.entity."REVERSEREFS$") r where d.entity.extid$ = 'Customer1'

In JDBC types, the below query can be used

select id$ from D_Customer_rrf$ where pid$ = (select pid$ from d_Customer where extid$ = ‘Customer1’)

To query on a Containment relationship:
--------------------------------------

Ex: Shop contains Car

Oracle types, the below query can be used to get a list of car ids that a shop instance (extid =’Sunnyvale’) contains

select r.id$ from d_Shop d, table(d.entity."Car") r where d.entity.extid$='Sunnyvale'

JDBC types, the below query can be used

Select id$ from D_Shop_Car where pid$ = (select pid$ from d_Shop where extid$ = ‘Sunnyvale‘);


Attachments:
===========
None.

References:
==========
None

Issue/Introduction

Querying the backend datastore tables using SQL to find details on the parent - child relationship defined in concepts.