Subquery in SAP HANA SQL

4 months ago 49

Hi All,

I americium trying to get each fields from SYS.OBJECT_DEPENDENCY alongwith an further file which volition springiness maine information by speechmaking a circumstantial drawstring from different file successful this table.

eg.

select * FROM "SYS"."OBJECT_DEPENDENCIES" WHERE "DEPENDENCY_TYPE" = 2 AND "DEPENDENT_SCHEMA_NAME" = 'SAPHANADB' AND "BASE_SCHEMA_NAME" = 'SAPHANADB' AND "BASE_OBJECT_TYPE" = 'TABLE' AND "DEPENDENT_OBJECT_TYPE" = 'VIEW' AND "DEPENDENT_OBJECT_NAME" LIKE '%/%'

The output comes as 

BASE_SCHEMA_NAMEBASE_OBJECT_NAMEBASE_OBJECT_TYPEDEPENDENT_SCHEMA_NAMEDEPENDENT_OBJECT_NAME                                                
SAPHANADB       /1FC/0CSAP0     TABLE           SAPHANADB            1FC/25CIT/30CITI/40CITI                                                           
SAPHANADB       /1FC/0CSAP0     TABLE           SAPHANADB            1FCABCD/22CIT0/TREK/STAR                                                          

I request to update my query specified that, one get each the fields arsenic good arsenic a caller file 'FIELD' having values arsenic beneath derived from file DEPENDENT_OBJECT_NAME

BASE_SCHEMA_NAMEBASE_OBJECT_NAMEBASE_OBJECT_TYPEDEPENDENT_SCHEMA_NAMEDEPENDENT_OBJECT_NAME                                                FIELDS
SAPHANADB       /1FC/0CSAP0     TABLE           SAPHANADB            1FC/25CIT/30CITI/40CITI                                                           25CIT
SAPHANADB       /1FC/0CSAP0     TABLE           SAPHANADB            1FCABCD/22CIT0/TREK/STAR                                                          22CIT0

How bash we constitute specified query?

Regards,

Salil

Read Entire Article