Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>It means that the function or procedure contains no SQL in it.</p> <p>From the <a href="http://dev.mysql.com/doc/refman/5.6/en/create-procedure.html" rel="nofollow">online docs</a>:</p> <ul> <li><code>NO SQL</code> indicates that the routine contains no SQL statements.</li> </ul> <p>It's <em>probably</em> in there as an optimisation assistance method, allowing the function to be flagged as not requiring processing that would be necessary for SQL. The other options in that group all indicate varying levels of data processing:</p> <ul> <li><p><code>CONTAINS SQL</code> indicates that the routine does not contain statements that read or write data. This is the default if none of these characteristics is given explicitly. Examples of such statements are <code>SET @x = 1</code> or <code>DO RELEASE_LOCK('abc')</code>, which execute but neither read nor write data.</p></li> <li><p><code>NO SQL</code> indicates that the routine contains no SQL statements.</p></li> <li><p><code>READS SQL DATA</code> indicates that the routine contains statements that read data (for example, <code>SELECT</code>), but not statements that write data. </p></li> <li><p><code>MODIFIES SQL DATA</code> indicates that the routine contains statements that may write data (for example, <code>INSERT</code> or <code>DELETE</code>). </p></li> </ul> <p>These are actually clauses defined by the SQL standard but it's interesting to note another quote from that linked page:</p> <blockquote> <p>In MySQL, these characteristics are advisory only. The server does not use them to constrain what kinds of statements a routine will be permitted to execute.</p> </blockquote> <p>In other words, they don't actually <em>do</em> anything in MySQL other than make the language compatible with the standards.</p> <p>In terms of an example of a function that uses <em>no</em> SQL, you may have one that takes a string and returns a hash value for storage into a database later on.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload