title: Firebird TIBQuery insert with returning ... INTO
body: <p>I have a firebird 2.x database with Generator and a trigger to generate the key field.
  I need to get the returned value from below query.</p>
  
  <pre><code>INSERT INTO XXXX (vdate,description) values ('"+ VDate +"','"+ Description +"') returning vno INTO :ParamVoucherNo
  </code></pre>
  
  <p>I tried several versions of below code but it dont wrok and I get </p>
  
  <blockquote>
    <p>Dynamic sql error sql error code = -104</p>
  </blockquote>
  
  <p>Is it really possible to get the return value in delphi using TIBQuery ?</p>
  
  <pre><code>Query1-&gt;SQL-&gt;Clear();
  Query1-&gt;SQL-&gt;Add("INSERT INTO XXXX (vodate,description) values ('"+ VDate +"','"+ Description +"') returning vno INTO :ParamVoucherNo");
  
  Query1-&gt;Params-&gt;ParamByName("ParamVoucherno")-&gt;ParamType = ptResult;
  Query1-&gt;Params-&gt;ParamByName("ParamVoucherno")-&gt;DataType = ftInteger;
  Query1-&gt;Params-&gt;ParamByName("ParamVoucherno")-&gt;Value = "";
  Query1-&gt;Prepare();
  Query1-&gt;ExecSQL();
  </code></pre>
  
  <p>Any suggestions?</p>