Oracle PL/SQL stored procedure to search a regular expression across all text columns of a database.
To import the grep() procedure in your current database, download the
file grep.sql and then run the following command in SQLPlus:
SQL> @grep.sql
The grep() procedure takes two arguments: the name of the schema to
search and a pattern compatible with the SQL operator LIKE. For
example:
SQL> EXECUTE grep('HR', '%John%');
The output of the procedure is in CSV format (without headers). Each row is a match found in the database. For each match, the columns are the searched pattern, the schema name, the table name, the column name and the column value. For example, the output might look like this:
"%John%","HR","employees","first_name","John"
"%John%","HR","employees","full_name","John Doe"
"%John%","HR","employees","email_address","john.doe@example.com"
See test.sql for a full-fledged example.
Please read CONTRIBUTING.md for details on our code of conduct and the process for submitting pull requests.
Please read SECURITY.md for details on our security policy and how to report security vulnerabilities.
Please read CODE_OF_CONDUCT.md for details on our code of conduct.
This project is licensed under the terms of the LICENSE file.