Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Please check this syntax
Josh White wrote:
> You (and DA Morgan) are right - there is real no need in this case for
> the execute immediate. But I have written it this way becuae I am sure
> that in the next week there will be new requirements to have this
> trigger work for many tables other than COMPBLDG - there are
> approximately 30 COMPxxx tables in the database. Writing it this way I
> am not hard-coding table names or IF statements.
>
> Does my code make more sense now - and more importantly for me - does
> it look syntactically correct?
>
> Thanks for your help,
> Josh.
To quote Jim Kennedy, "don't write generic code it will bite you."
That someone may wish to have you write 30 more is called job security. Code them properly and do not use native dynamic SQL. NDS may be simple ... but you pay a price in debugging and in the use of resources.
I can no longer, from my newreader see the code to determine if it is syntactically correct but the EXECUTE IMMEDIATE would never have generated an error so if the point was to generate an error in a specific condition your code wouldn't have accomplished that.
I would suggest reposting your code and, more importantly, describing the business rule.
Finally ... you obviously have a computer handy so why don't you also have Oracle on it?
-- Daniel A. Morgan University of Washington damorgan_at_x.washington.edu (replace 'x' with 'u' to respond)Received on Sat Apr 02 2005 - 09:18:42 CST
![]() |
![]() |