for select statements fbsql _ query returns a new result identifier that you can pass to fbsql _ result when you are done with the result set you can free the resources associated with it by calling fbsql _ free _ result although the memory will automatically be freed at the end of the scripts execution 