title: Create procedure Informix gives syntax error
body: <p>Ia m trying to create a stored procedure that will simply return the related records based on the ID passed. Based on research I found something that led me make the Stored Proc like this:</p>
  
  <pre><code>CREATE PROCEDURE procMessageMembershipSelect1 (membershipnumber char(10))
  RETURNING CHAR(10) AS membership_number, SMALLINT as message_id , varchar(200) as 
  message, CHAR(1) AS target, DATETIME as date_time_creation, DATETIME as 
  date_time_display;
  DEFINE rsMembershipNumber CHAR(10);
  DEFINE rsMessageID smallint;
  DEFINE rsMessage VARCHAR(200);
  DEFINE rsTarget CHAR(1);
  DEFINE rsDateTimeCreation datetime;
  DEFINE rsDateTimeDisplay datetime;
  FOREACH
  SELECT membership_number, message_id, message, target,date_time_creation, 
  date_time_display
  INTO rsMembershipNumber, rsMessageID, rsMessage, rsTarget, rsDateTimeCreation, 
  rsDateTimeDisplay
  FROM MessageMembership
  WHERE membership_number = membershipnumber    
  ORDER BY date_time_display
  RETURN rsMembershipNumber, rsMessageID rsMessage, rsTarget, rsDateTimeCreation,   
  rsDateTimeDisplay WITH RESUME;
  END FOREACH
  END PROCEDURE;
  </code></pre>
  
  <p>Can you please help me with that?</p>