search

Home  >  Q&A  >  body text

How to find where Mysql functions are used

<p>I am using Mysql 8. In one of the views I'm working on, there is a function called <code>calculateGP</code>. I want to modify this function but I'm not sure if this function is used elsewhere in the database. Is there a query that would let me know if this function is referenced elsewhere in the database? </p>
P粉573943755P粉573943755460 days ago506

reply all(2)I'll reply

  • P粉346326040

    P粉3463260402023-08-19 10:11:34

    By taking a MySQL structure dump of the database and doing a text search on the dump file, I was able to find a reference to the function calculateGP. This is an alternative way to find references in the database without running a MySQL query.

    reply
    0
  • P粉378890106

    P粉3788901062023-08-19 09:35:59

    I will do this:

    SELECT TABLE_NAME
    FROM INFORMATION_SCHEMA.VIEWS
    WHERE VIEW_DEFINITION LIKE '%`calculateGP`%'

    If your table, column, or other identifier is also named calculateGP, this may find the wrong match.

    reply
    0
  • Cancelreply