volatile Table

Analytics
Highlighted
Enthusiast

volatile Table

Hi

Anybody please explain volatile Table in teradata.

Bcoz i have a couple of questions about for the same.




6 REPLIES
Enthusiast

Re: volatile Table

Hello,

Volatile Tables - VT Tables, are temporary tables which are created and populated/materialized under user's space. If not dropped explicitly, they are dropped when the session has ended!

HTH!

Regards,

Adeel
Enthusiast

Re: volatile Table

Hi adeel

For example, suppose you log on two sessions, Session 1 and Session 2. Assume the default
database name is your login user name. Consider the following scenario.


Create a permanent
table with an unqualified
table name of VT2.


Session 1 creates a permanent table
named VT2 using your login user name
as the database.



Create a volatile
table named VT2.


Session 2 receives a CREATE TABLE
error, because there is already a
permanent table with that name.


Create a volatile table
named VT3.



Session 1 creates a volatile table named
VT3 using your login user name as the
database.


Create a permanent
table with an
unqualified table
name of VT3.


Session 2 creates a permanent table
named VT3 using your login user name
as the database.
Because a volatile table is known only
to the session that creates it, a
permanent table with the same name as
the volatile table VT3 in Session 1 can
be created as a permanent table in
Session 2.


Please explain me clearly am not able understand above exaples




Enthusiast

Re: volatile Table

Let me rephrase what you described as follows:

Suppose following:
CT = Create Table
CVT = Create Volatile Table
T* = Time

T1: Session1 => CT => VT2 - Done
T2: Session1 => CVT => VT2 - Error
T3: Session1 => CVT => VT3 - Done
T4: Session2 => CT => VT3 - Done

Now, what exactly is your question? 'Why it allowed last statement?', The answer is, because regardless of what the user was, in that session (Session2), there is no table named VT3, so it was allowed!

HTH!

Regards,

Adeel

Enthusiast

Re: volatile Table

Hi

thanks

objects are created in user space right

Enthusiast

Re: volatile Table

Not all objects, but Volatile tables!

Regards,

Adeel
Enthusiast

Re: volatile Table


I hope that top metion question is like below.......



T1: Session1 => CT => VT2 - Done

T2: Session2 => CVT => VT2 - Error

T3: Session1 => CVT => VT3 - Done

T4: Session2 => CT => VT3 - Done



 



Why its giveing the error at T2 ???



can u please clarify it ???