title: firebird procedural query throwing "token unknown" error at "SET TERM #;"
body: <p>I am quering a firebird 2.5 database using php (ibase). Simple queries are working fine, but when I try to use the following procedural query I get a "token unknown" error at line 1, column 5 - ie when "TERM" is encountered. I feel I am missing something very basic here!</p>
  
  <pre><code>$query = &lt;&lt;&lt;X
  SET TERM #;
  EXECUTE BLOCK 
     RETURNS (product INT, minPrice FLOAT, maxPrice FLOAT)
  AS
  DECLARE transID INT = 8733;
  
  BEGIN
    FOR
      SELECT "Product", MIN("CurrencyRate" * "UnitPrice"), MAX("CurrencyRate" * "UnitPrice")
      FROM "CustomerStockInDetail"
      HAVING "Product" = :transID
      INTO :product, :minPrice, :maxPrice
    DO
       SUSPEND;
  END#
  SET TERM ;#
  X;
  </code></pre>