Suggest a feature
×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: SQL
Posted by: matias s..
Added: Sep 20, 2018 2:08 PM
Views: 6
Tags: mysql
Searchs a provided string into all procedures and returns a list with the procedures that contain the searched string.
  1. SELECT name PROCEDURE ,
  2.         TRIM(SUBSTRING(
  3.         SUBSTRING_INDEX(CAST(body AS CHAR(10000) CHARACTER SET utf8),"*/", 1)
  4.         FROM POSITION("/*" IN CAST(body AS CHAR(10000) CHARACTER SET utf8))+2
  5.         )) Description
  6. ,CAST(param_list AS CHAR(10000) CHARACTER SET utf8) INPUT_PARAMETERS
  7. FROM
  8. mysql.proc
  9. WHERE
  10.   db='db_name'
  11. AND TYPE='PROCEDURE'
  12. AND body LIKE '%string_to_search%'
  13. ;
Comments disabled