Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Re: ORA 6502 - False alarm?

Re: ORA 6502 - False alarm?

From: Hudson N. Jackson II <h2jackson_at_prodigy.net>
Date: 2000/09/20
Message-ID: <001601c022c4$c9dfddc0$53441440@default>#1/1

> Sorry to say so, but this is an example of bad design.
>
> There are many problems in the design and the code
> - Under Oracle 8i the table desc fails to create because desc is a
 reserved
> word.
>
> - Secondly you're trying to make 'intelligent' id's in the table orig.
> Generally speaking you shouldn't do this.
> It is always more difficult to 'parse' an 'intelligent' number, than
 to
> concatenate it afterwards.
>
> -It very much looks like you have a very bad design.
> Your hardcoded 'manager' etc, should have gone into a separate table,
 with a
> foreign key from the orig table to the separarate table. In that case
 you
> won't need the descr table. Please try to study database design and
 above
> all normalization, otherwise you will soon find your self in a
 *complete*
> mess.

I do want to thank you for your help. There a few things I should clarify, too:

> With respect to your 6502
> the correct code is this
>
> 1 create or replace trigger trig after update or insert on orig
> 2 declare
> 3 v_descrip descr.description%type;
> 4 idcheck descr.id%type;
> 5 cursor c is
> 6 select * from orig;
> 7 v_sqlstring varchar2(1000);

[snip]

Just out of curiosity, how does the parse string length affect things? When I added the concatenation symbols in the parse string which sends the decode statement, I still got the ORA 6502 message. I increased v_sqlstring to 1000 characters as shown in your correction, and it went away.

The professor looked at this today, and he was surprised I used the dynamic SQL in the first place. He was telling me that the easier way would have been to use a row trigger instead of a statement-level trigger. I know now how that's done, but I would never have pulled it off in that manner earlier.

Again, thanks for the help.

--
Posted from pimout4-ext.prodigy.net [207.115.63.103] 
via Mailgate.ORG Server - http://www.Mailgate.ORG
Received on Wed Sep 20 2000 - 00:00:00 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US