Nick,
I don't think the table gets added to the DBC with the SELECT statement, so there is nothing to DROP. You need the DATABASE clause in the SELECT to add it to the DBC.
Mark
>Thanks for replying Mark. I tried that and it give me the following error:
>Cannot find object _030xxxxx in the database.
>
>_03oxxxxx is the random table name being held in ranvar variable.
"It hit an iceberg and it sank. Get over it."
Robert Ballard, dicoverer of the Titanic wreckage.