I want to write a procedure in SQL anywhere which can check if a local temporary table exists and if it does use it. I do not want to drop the table. I have already found a way to drop local temporary table which is:
DROP TABLE IF EXISTS t;
I have also tried following: I created a local temporary table TEMP_TABLE. Then I tried to run this query:
select object_id('tempdb..TEMP_TABLE')
This just gives me NULL. But if I try
select * from TEMP_TABLE
it works perfectly fine.
So can anyone please help me find a way to check if the local temporary table exists in sql anywhere.