Re: Hi all
From: Tim X <timx_at_nospam.dev.null>
Date: Tue, 18 Aug 2009 18:17:03 +1000
Message-ID: <87bpmd5yf4.fsf_at_lion.rapttech.com.au>
pal <jayadevpaleri_at_gmail.com> writes:
Date: Tue, 18 Aug 2009 18:17:03 +1000
Message-ID: <87bpmd5yf4.fsf_at_lion.rapttech.com.au>
pal <jayadevpaleri_at_gmail.com> writes:
> Can any one tell me how to declare a temporary table in a trigger(like
> in SQL Server)?
>
OMG! Do NOT do it!
- Avoid triggers unless there is a very good reason and no other solution will work. Triggers can easily get unmanageable and are effectively side effects that can make maintenance and debugging a nightmare (especially if different teams end up doing the maintenance).
- Creating tables is a DDL (Data Definition Language) statement and therefore causes an implicit commit. This would cause unexpected behavior with transaction management etc (actually, I don't think you can have DDL in triggers for this reason).
- Maybe consider a temporary global table which is created already and take advantage of its support for transaction independence etc. While its not clear why you want to create a table in a trigger, it is likely that the features of a temporary global table would provide what you are after - though I'm totally guessing of course as we have no details on what your trying to do).
Tim
-- tcross (at) rapttech dot com dot auReceived on Tue Aug 18 2009 - 03:17:03 CDT