title: When a syntax error occurs in the declaration declare postgresql
body: <pre><code>CREATE OR REPLACE FUNCTION fn_SplitArrayStr( anyelement , anyelement )
  RETURNS anyarray 
  LANGUAGE SQL 
  AS $$
  DECLARE f1 text , f2  text ; 
  BEGIN
      f1 := $1::text ; 
      f2 := $2::text ; 
      SELECT * FROM UNNEST( string_to_array(f1, f2) ) as c1 ; 
  END ;
  $$; 
  </code></pre>
  
  <blockquote>
    <p>ERROR : Syntax error at or near "text"<br>
    LINE 2 : DECLARE f1  text , f2  text ; </p>
  </blockquote>
  
  <p>How do I change? </p>