title: conversion microsoft sql to mysql
body: <p>I'm converting this into mysql from mssql but it is giving me this error: </p>
  
  <p><strong>Error Code : 1415 Not allowed to return a result set from a function</strong></p>
  
  <p>What am I doing wrong?</p>
  
  <pre><code>DELIMITER $$  
  
  CREATE    FUNCTION GetPositionList (orderDetID NUMERIC)  
  RETURNS NVARCHAR(200)    
  DETERMINISTIC   
  BEGIN   
  DECLARE strToReturn NVARCHAR(50);  
  DECLARE strPos NVARCHAR(50);  
  DECLARE strPosOtherRes NVARCHAR(50);  
  DECLARE strTPos NVARCHAR(50);  
  DECLARE strTPosOtherResr NVARCHAR(50)
  
  
  SET strToReturn = '';  
  SET strPos = SELECT `POSITION` FROM orderdetails WHERE OrderID = orderDetID;
  SET strPosOtherRes = SELECT SecPosition FROM orderdetails WHERE OrderID = orderDetID;
  SET strTPos = SELECT TeamPosition FROM orderdetails WHERE OrderID = orderDetID;
  SET strTPosOtherResr = SELECT TeamSecPosition FROM orderdetails WHERE OrderID = orderDetID;
  
  
  IF(strPos != '') THEN SET strToReturn = CONCAT(strPos , ',');
  END IF;
  IF(strPosOtherRes != '' ) THEN SET strToReturn = CONCAT(strToReturn ,  strPosOtherRes , ',');
  END IF;
  IF(strTPos != '' ) THEN SET strToReturn =  CONCAT(strToReturn ,  strTPos , ',');
  END IF;
  IF(strTPosOtherResr != '' ) THEN SET strToReturn =  CONCAT(strToReturn , strTPosOtherResr , ',');
  END IF;     
  RETURN SUBSTRING( strToReturn, 0, LENGTH(strToReturn) );  
  END $$  
  DELIMITER ; 
  </code></pre>