Subject Re: [firebird-support] Cannot DROP TABLE due to resource being in use, how to close resource?
Author Uwe Grauer
Bhavbhuti Nathwani wrote:
> Hi all
>
> I know Temp Tables are round the corner but I have a requirement to
> use something similar earlier.
>
> I create a regular table using SQL Pass Thru from VFP. I append data
> to this table using VFP Remote View. I do further SQL Pass Thru using
> this table now populated with data.
>
> Now I try to DROP TABLE this (temp) table and I am not able to because
> the resource is in use.
>
> Is there any way I can use a command like CLOSE RESOURCE <tablename>?
>
> Please advise.
>
> Regards
> Bhavbhuti

I you want to mimic temp tables, add a field "jobid" to your table and
include your current jobid in all selects/inserts/updates.
After your current use of the jobid you can delete all records with this
jobid.
This way, there is no need to remove your temp-table.
Reuse your temp table for all future jobs using a different jobid.

Uwe