0

I would like to detect which tables are used to get data from in procedure and function code in oracle.

... from <tablename>;
... from <tablename> <alias>;
... from <tablename> <alias> where ...;
... from <tablename> <alias> (, <tablename> <alias>)* where ...
... from <tablename> <alias> (<join> <tablename> <alias> on <onclause>)* where ...

These are some of the possible constructions.

I would like to use the module 're' in python. Any insights of how can i achieve this?

This is what I came up with so far:

[(procedure.split()[0], re.findall('FROM \w+ \w* [WHERE|,|;]*', procedure, flags=re.IGNORECASE)) for procedure in procedures]

JaviOverflow
  • 1,434
  • 2
  • 14
  • 31

0 Answers0