title: Executing function without select
body: <p>I have two functions- one to set a variable and one to view it. The idea is to use the variable in a View.</p>
  
  <p>I'm really new to functions. Anyhoo, here's what they're supposed to do:</p>
  
  <p>GetSiteId:</p>
  
  <pre><code>BEGIN
  #Routine body goes here...
  RETURN @siteContext;
  END
  </code></pre>
  
  <p>SetSiteId:</p>
  
  <pre><code>BEGIN
      #Routine body goes here...
  set @siteContext := SiteId;
      RETURN @siteContext;
  END
  </code></pre>
  
  <p>This has an int parameter of SiteId.</p>
  
  <p>But when I try to execute them, I get an error.</p>
  
  <p>I execute them like so:</p>
  
  <pre><code>SetSiteId(1);
  select GetSiteId();
  </code></pre>
  
  <p>If I perform a select on SetSiteId it works fine, but I don't want to see it, I only want to see the result of GetSiteId, which should be 1.</p>
  
  <p>I thought maybe there was a specific keyword to execute the function, but I couldn't find any and Google was no help. I suspect I might be going about this all wrong, but I can't see how- it seems like it should be the simplest thing in the world to execute a function.</p>
  
  <p>The oh-so-unhelpful error I get is this: </p>
  
  <blockquote>
    <p>You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SetSiteId(1)' at line 1</p>
  </blockquote>