A Global Temporary Table is a template to be used by multiple sessions/users.
It's created once and then each session can materialize it's own version using Insert.
Why do you think you must use a GTT instead of a Volatile table?
Can't you create a random table name within the application?
Thanks. I don't get this clear explanation from reading the documentation.
The application has backends for alot of databases and Teradata is the one I am trying to build for. There is a bit of generic code in the application that goes something like this
if(temporary) then create temoporary table
else create permanent table
if(table_exists(sometable) then do this
Since the create_table_function and function2 are indepedent and they are meant to work for all databases, if I create a temporary table using volatile then function2 won't work as it can't find the table in Teradata. In other databases e.g. sqlite I can create a "temporary" table and function can still check if it exists.