Global temp OR Derived table
Teradata Teradata Discussion Forums Teradata.com Discussion Forum
Visit Teradata.com
Home       Guidelines    Member List
Welcome Guest ( Login | Register )
        


This online forum is for user-to-user discussions of Teradata products, and is not an official customer support channel for Teradata. If you require direct assistance, please contact Teradata support.


Global temp OR Derived table Expand / Collapse
Author
Message
Posted 9/29/2009 2:26:01 PM
Junior Member

Junior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior Member

Group: Forum Members
Last Login: 11/11/2009 1:12:32 PM
Posts: 14, Visits: 39
the query which im executing is very big..so i need to create a global temp table or derived table...



how do i do it...

do i need to include the database name before the table name??



for example...for the following query..how to i create a temp table or derived table....







sel e.firstname, c.year, e.month, sum(c.salary)



from employers e

join customers c

on c.salary_key = e.salary_key

and salary like any (1%, 2%, 3%)



group by 1,2,3









Also, do i need to run the gtt every time before running the main query in which gtt is included??

-Thank you


-Thank you
Post #16983
Posted 9/29/2009 2:45:42 PM
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Forum Members
Last Login: 10/8/2009 1:16:14 PM
Posts: 79, Visits: 105
Hi,

Global temp table/Volatile table will be created in the spool space which is allocated to the logon user ID, so DB name is not required to mention for this.

The data loaded in this table is valid only for that particular logon session, so you need not rerun temp table query until your session got terminated.

To know more on limitations and syntax of GTT/Volatile table do refer SQL Data Definition PDFs in www.info.teradata.com

Regards,
Balamurugan
Post #16985
Posted 9/30/2009 9:17:26 AM
Forum Member

Forum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum Member

Group: Forum Members
Last Login: 2 days ago @ 7:45:03 AM
Posts: 39, Visits: 169
Global Temporary Tables are created in user's 'temporary space', so user must have some temporary space allocation to materialize GTT. Also, base definition of GTT is stored in the Data Dictionary, which not in case of Volatile table
Post #16990
« Prev Topic | Next Topic »


Reading This Topic Expand / Collapse
Active Users: 0 ( 0 guests, 0 members, 0 anonymous members )
No members currently viewing this topic.


All times are GMT -5:00, Time now is 9:31pm

Powered By InstantForum.NET v4.1.4 © 2009
Execution: 0.203. 6 queries. Compression Disabled.