I am trying to translate an Oracle query
SELECT name FROM emp START WITH name = 'Goyal' CONNECT BY PRIOR empid = mgrid
Getting error as unexpected token connect by.
I am trying to translate an Oracle query
SELECT name FROM emp START WITH name = 'Goyal' CONNECT BY PRIOR empid = mgrid
Getting error as unexpected token connect by.
To find dependencies on an object, you could try DBMS_UTILITY.GET_DEPENDENCY
If you are just interested in table dependencies (but for all tables), this is just one of a number of examples out on the web https://datageek.blog/2015/05/07/db2-administrative-sql-cookbook-identifying-dependent-mqts-and-views/
That only ever works when ORACLE compatibility is on. Set it as follows, then rerun the query:
$ db2set DB2_COMPATIBILITY_VECTOR=08
$ db2stop
$ db2start
Was your Db2 database created in Oracle Compatibility mode? If not, you won't have CONNECT BY
support enabled. You can enable CONNECT BY
independently of full Oracle support by setting the appropriate bit of the compatibility vector.
https://www.ibm.com/support/knowledgecenter/en/SSEPGG_11.1.0/com.ibm.db2.luw.apdv.porting.doc/doc/r0052877.html
BTW you should use the SYSCAT catalog views rather than the SYSIBM catalog views DB2 Query to retrieve all table names for a given schema