<p>I created a view on a machine using the <em>substring</em> function from Firebird, and it worked.  When I copied the database to a different machine, the view was broken.  This is the way I used it:</p>

<pre><code>SELECT SUBSTRING(field FROM 5 FOR 15) FROM table;
</code></pre>

<p>And this is the output on the machine that does not accept the function:</p>

<pre><code>token unknown:  FROM
</code></pre>

<p>Both computers have this configuration:</p>

<ul>
<li><em>IB Expert</em> version 2.5.0.42 to run the queries and deal with the database.</li>
<li><em>Firebird</em> version 1.5 as server to database.</li>
<li><em>BDE Administration</em> version 5.01 installed, with <em>Interbase</em> 4.0 drivers.</li>
</ul>

<p>Any ideas about why it's behaving differently on these machines?</p>

[{'answer_id': 5148, 'author': 'Lasse V. Karlsen', 'author_id': 267, 'author_profile': 'https://Stackoverflow.com/users/267', 'pm_score': 0, 'selected': False, 'text': '<p>Different engine versions?</p>\n\n<p>Have you tried naming that expression in the result?</p>\n\n<pre><code>SELECT SUBSTRING(field FROM 5 FOR 15) AS x FROM table;\n</code></pre>\n'}, {'answer_id': 65043, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': 2, 'selected': False, 'text': "<ol>\n<li><p>Make sure Firebird engine is 1.5 and there's no InterBase server running on this same box on the port you expected Firebird 1.5.</p>\n</li>\n<li><p>Make sure you don't have any UDF called 'substring' registered inside this DB so that Firebird is expecting different parameters.</p>\n</li>\n</ol>\n"}]
['https://Stackoverflow.com/questions/5142', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/431/']