I've SQL files on my database server which is a unix box. I am trying to find out what are the *.sql files which use a particular column of a table. For eg the content of my_dir/SALES_TERRITORY.sql
is
Select segment1,segment2
from HZ_CUST_SITE_USES_ALL
where territory_id = :p_territory_id;
So , my requirement is when I run my command I should get all the files which have the combination of 'HZ_CUST_SITE_USES_ALL' and 'territory_id'.
I did below by searching the internet but I am not getting the desired output.
grep -i "HZ_CUST_SITE_USES_ALL\|TERRITORY_ID" *
My expectation is that the above command will give me a result like this
grep -i "HZ_CUST_SITE_USES_ALL\|TERRITORY_ID" my_dir/*
SALES_TERRITORY.sql
Any help is much appreciated.
Regards,