Doug:

Here's how to check the existence of a TEMPORARY table.

-- Check to see if the temporary table exist
   SET VAR vRows INTEGER = 0
   SELECT COUNT(*) INTO vRows INDIC iv1 FROM SYS_TABLES +
WHERE SYS_TABLE_NAME = 'temptablename' AND SYS_TABLE_TYPE = 'TABLE' AND SYS_TEMPORARY = 1

Variable vRows will return the value of 0 or 1.

Another approach to create TEMPORARY table ...

   SET ERROR MESSAGE 2038 OFF
   DROP TABLE tablename
   SET ERROR MESSAGE 2038 ON

   PROJECT TEMPORARY tablename ....
   OR
   CREATE TEMPORARY TABLE tablename ...

That's all there is to it!

Very Best R:egards,

Razzak

At 11:32 AM 5/1/2018, Doug Hamilton wrote:

I'm drawing a blank - is there a command/function (in 9.5) to check for the existence of a table?
I want to see if a temp table exists before I try to recreate it.

I could try to count rows and check for error messages if the table isn't there but I suspect there's a more elegant method.
'Course, recreating an existing table would also give an error message...



--
For group guidelines, visit 
http://www.rbase.com/support/usersgroup_guidelines.php
--- You received this message because you are subscribed to the Google Groups "RBASE-L" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rbase-l+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to