Subject IB_Query and Selected procedure

Hello :

I have the following query on a IB_Query

   Select * from stock (:Almacen_ID ).

When I open the first query I get the following error

The field type: 0 is incorrect

But the next time I open the query does not fail, it works correctly.

   Thank you for your help.

delphi XE7 and IBO 5.7.7