Archives of the TeradataForum
Message Posted: Mon, 12 Oct 2009 @ 13:46:19 GMT
Subj: | | Re: Volatile table in procedure |
|
From: | | Geoffrey Rommel |
This will not work. A volatile table exists only during the session in which it is created. When a procedure is compiled, the parser resolves
certain object references. The above statement tells the parser that you want to create a volatile table VT2 during a session (S2) that does not
yet exist.
However, you can use dynamic SQL:
set create_stmt = 'create volatile table VT2 .......';
call DBC.SysExecSQL(create_stmt);
Why? Because now the statement will not be executed until run time, i.e. when session S2 does exist.
I prefer permanent tables or GTT's for this sort of thing.
|