Posts

Showing posts from October, 2021

Comma-separated string to tabular format

  Comma-separated string to tabular data Sometimes we need to extract individual data from the comma-separated strings. We can use the following query to do that in oracle. SELECT REGEXP_SUBSTR('my comma separated string', '[^,]', 1, LEVEL) TYPE, LEVEL FROM DUAL CONNECT BY LEVEL <= REGEXP_COUNT('my  comma separated string','[^,]') ;

Text search in saved PL/SQL

Text search in saved PL/SQL Sometimes we need to search a text to know where this text has been used in saved PL/SQLs. We can use the following query to fetch this. SELECT * FROM ALL_SOURCE  WHERE UPPER(TEXT) LIKE '%MY TEXT%' AND TYPE = 'PACKAGE BODY'  ; Here TYPE is optional. It can be PROCEDURE, FUNCTION, PACKAGE, PACKAGE BODY, etc.