mysqlprepared-statementmysql-workbench

Get prepared statements list in mysql


As this document says prepared statements are server side statements like functions or procedures (correct me if I'm wrong).

But I have some trouble finding defined prepared statement on my database. I'm currently working with MySQL Workbench and in the left side pane I can see all my procedures and functions and I can't see any of defined prepared statements here.

So is there any query which I can use to get their names?


Solution

  • The doc says

    A prepared statement is specific to the session in which it was created. If you terminate a session without deallocating a previously prepared statement, the server deallocates it automatically.

    So Prepared Statements get deleted automtically after the session ends. Besides, a Prepared Statement does not have a name It is just a query string.